# Using GNU Emacs Key Bindings in GNU Midnight Commander's Mcedit I've been playing with the GNU Midnight Commander (mc) lately (I'm editing this post in mc). I've always had a soft spot for orthodox file managers [0] since my DOS days using Norton Commander, and mc has some great features, including remote editing, familiar to anyone who uses GNU Emacs' tramp mode. However, this feature only works with mc's internal editor (mcedit, which can also be used as a very capable standalone editor). However, I've never cared for the default key bindings in mcedit. Old versions of mc could be configured to use Emacs key bindings in the editor preferences, but newer versions have a much more configurable way to change them. Mc ships with a key binding config file you can use to emulate Emacs (and edit yourself if needed, it is fairly self-explanatory), it is easy to enable: cp /etc/mc/mc.emacs.keymap ~/.config/mc cd ~/.config/mc ln -sv mc.emacs.keymap mc.keymap You can just delete this mc.keymap symlink to go back to the default key bindings, if needed. After this change, when you restart mc, select a file and hit F4 for edit (or shift-F4 to open a blank file), and most of the common Emacs bindings will be there for you. There are some exceptions - you still need to hit F2 to save your document, and the analogue to Emacs' fill-paragraph behavior is bound to M-p, not M-q (word wrap line length, what Emacs calls the fill-column, can be set in the editor general options). The commands for dealing with text rectangles are also different in mcedit, I'll go over how to deal with columns of text in another post. One behavior that I needed to get used to was with ctrl-k - in Emacs, you can delete a blank line with ctrl-k. In mcedit, ctrl-k just literally deletes to the end of the current line, but does not delete newlines. So blank lines have to be deleted with ctrl-space ctrl-n ctrl-w (set mark, move down a line, kill region in Emacs), or by just hitting the backspace key from the beginning of the following non-blank line, which is probably easier. Of course, you can configure mc to use an external editor like emacsclient or vim, but if you do, you lose the remote editing capability that is builtin to mc, and its ability to switch between multiple editing sessions and panels (called 'screens' in mc) with M-`. [0]: gopher://gopherpedia.com/0/File%20manager