Text editors - mcedit¶
Now it is the turn of mcedit from the exceptional file manager Midnight Commander, whose editor is based on cooledit.
Warning
Some of the mcedit features are not available if started from the command line, for example the F11 user menu. So when in doubt always start it internally from mc.
I have to admit off the bat that I probably wouldn’t have ever used cooledit, not for any valid reasons mind you. I’ve been happy with my editor choices for a long time, although every now and then someone introduces me to something new or I see an exciting feature I would like to have. cooledit doesn’t really have any tractor features as far as I’m concerned, but as an internal editor in Midnight Commander mcedit has all the features you probably need. Don’t ge me wrong, I think cooledit is a great editor it is about exposure though. Midnight Commander is a fantastic file manager, and the fact it chooses to fire off this “mcedit” by default for files means you quickly get used to it. It sneaks in, while your guard is down ;)
Note
I forgot to add that the tractor features for mcedit in my opinion don’t really exist in cooledit, even though they are heavily related. When ever I have tried cooledit I always found the interface totally unworkable, and to be honest quite ugly.
Note
By happy for a long time I mean using MicroEmacs, my first emacs, almost 15 years ago for school projects on the Amiga ;)
So with the backchasing out of the way what do you get with mcedit? Well, the top of list has to be syntax highlighting and extensibility through the user defined menus. Further down the list are high quality macro support, support for massive files(in a text editor sense), column selection(a vital feature for an editor in my eyes) and incredible search and replace support. Then there are the the usual features you expect like auto indentation.
One of the best features of mcedit in my opinion is the fact most of the commands you may want to use are external. For example, pressing F19(which you may need to press S-F9 to use depending on your keyboard and terminal setup) will reformat a file for you based on the contents of ~/.mc/cedit/edit.indent.rc. You can add support for XML reformatting just by editing that file, my particular entry for xml-style files is as follows:
xml|xsl|gdi)
xmllint --format $2 | asc2xml | unexpand --first-only -t 2 >$2.tmp
[ -s $2.tmp ] && mv $2.tmp $2 || rm $2.tmp ;;
The list of supported syntax highlighting is impressive, and adding support for more syntax files is a simple enough task. The format of the syntax files is described fully and generally easy to learn, even if apparently a little strange at first.
It also features word completion in the editor, type part of a word followed by M-Tab and the word will complete. A nice advantage when editing XML files with the enormous repetition that normally involves.
Like every command line tool it needs to support transparency for my candy needs to be met, and sure enough it does. My personal MC_COLOR_TABLE consists of the following to use nice transparent backgrounds in the editor. export MC_COLOR_TABLE=editnormal=,default globally in the environment, or from the command line with mcedit -C editnormal=,default: to only set it for a single instance.
Note
If you are interested in the rest of my colour chart for both the editor and the file manager drop me a mail. At 500+ characters I’m going to spare you from it now ;)
All in all I think mcedit is a wonderful editor, I don’t really use it outside of mc sessions but the amount of time I spend with mc running probably means its usage exceeds some of the editors I’ve mentioned elsewhere in this text.