Home > Tips and Tricks > Midnight Commander’s Editor

Midnight Commander’s Editor

For those of you who are vim, emacs et alias aficionados you may have noticed that those tools are missing from the SCLive distribution. As you know I have tried to keep this distribution lean and focused on SystemC as a result I had to make some compromise regarding the selection of tools available on this distribution. In exchange though the SCLive is small enough to be burnt on a USB stick or a mini CD as well as being run inside a virtual environment such as QEMU or VMware player.

Rejoice! Although the SCLive does not have vi, vim or emacs it has a perfectly good alternative called Midnight Commander.

Midnight Commander has a large following in the Linux / UNIX world as it is a very light but fully featured file management tool that has an equally powerful file editor inside it.

To invoke Midnight Commander, type: mc

The editor part of Midnight Commander runs as a text based interface, very much like vi or nano and is very easy to utilize. It features:

Block copy, move, delete, cut, paste; key for key undo; pull-down menus; file insertion; macro definition; regular expression search and replace (and our own scanf-printf search and replace); shift-arrow MSW-MAC text highlighting (for the linux console only); insert-overwrite toggle; word-wrap; a variety of tabbing options; syntax highlighting for various file types such as C++.

To invoke the Midnight Commander’s editor, type: mcedit

Alternatively if you are already inside a Midnight Commander window you can select the file you want to edit and then press F4.

Using the editor is very intuitive and you can even configure it to work like emacs. One little tip though; In addition to the functions that can be access directly via the Function keys, don’t forget to press F9 to have access to the top menu bar from which you can do a myriad of operations.

That’s it, give it a go you will see how suprisingly easy it is to use. You can use the command:

mcedit sc_main.cpp

David Cabanis

Categories: Tips and Tricks
  1. November 21, 2006 at 11:40 am

    Thank you: very useful mcedit tut esp the F9 key hint!

  2. G-man
    April 24, 2011 at 2:48 am

    Thanks for the handy little editor for MC, mcEdit..

    I am looking for an explanation of the status bar at the top of the editing screen.. [—O] is ‘Overtype’, but I am wondering about B, M, and the third position, which I can not get to appear.. the rest of the line has some statistics I can probably figure out.


  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: