Archive for the ‘vim editor’ Category

Set mcedit as default text editor for mc (midnight commander) on Linux

Thursday, October 4th, 2018

set-default-text-editor-for-midnight-commander-to-mcedit-linux-howto

If you're a vim (VI Improved) fan and you set your Linux server / desktop to use VIM as a default text editor, for those who don't know this is done either locally for user (if you're not superuser on remote server) by adding:

export VISUAL=vim
export EDITOR="$VISUAL"

to ~/.bashrc or ~/.bash_profile, e.g.

 

echo 'export VISUAL=vim; export EDITOR="$VISUAL"' >> ~/.bashrc
echo 'export VISUAL=vim; export EDITOR="$VISUAL"' >> ~/.bash_profile

 

or if you're root on the system e.g. it is your Linux desktop / administered by you (debian / ubuntu) server to set VIM as default text editor for all applications with cmd:

 

 # update-alternatives –config editor

 

or if you haven't unset the EDITOR variable the default behavior on some Ubuntu (10.10) etc. versions mc editting would edit with nano text editor.

Just like me however you work also regularly with Midnight Commander (mc) the Linux equivalent of good old Norton Commander you might end up with Midnight Commander opening your files with F4 command with VIM text editor instead of the default.

So here is how to change this behavior in order to end up editting with mcedit any edited file via mc:

mc-menu-options-layout-screenshot

1. Press F9 to Activate the top menu.
2. Press o to Select the Option menu.
3. Press c to Open the configuration dialog.
4. Press i to Toggle the use internal edit option.
5. Press s to Save your preferences.

midnight-commander-configure-options-use-internal-edit-screenshot
Hooray, you're done now mc will use mcedit again as default just like it was intended to be in old times on most GNU / Linux distributions.
Enjoy!