18

I haven't found anything on the topic in the Internet.

The only line from .mc/ini that looks related to the question is keymap=mc.keymap, but I have no idea what to do with it.

29

Okiedokie... lets see

$ man-section mc | head -n20
mc (1)
--
 Name
 Usage
 Description
 Options
 Overview
 Mouse support
 Keys
 Redefine hotkey bindings

8th section... is that possible? Lets look

man mc (scroll,scroll,scroll)

Redefine hotkey bindings
    Hotkey bindings may be read from external file (keymap-file).  A keymap-
    file is searched on the following algorithm  (to the first one found):

     1) command line option -K <keymap> or --keymap=<keymap>
     2) Environment variable MC_KEYMAP
     3) Parameter keymap in section [Midnight-Commander] of config file.
     4) File ~/.config/mc/mc.keymap
     5) File /etc/mc/mc.keymap
     6) File /usr/share/mc/mc.keymap

Bingo!

cp /etc/mc/mc.keymap ~/.config/mc/

Now edit the key mappings as you like and save ~/.config/mc/mc.keymap when done

For more info, read the Keys (man mc) section and the three sections following that.


$ cat /home/jaroslav/bin/man-sections 
#!/bin/sh
MANPAGER=cat man $@ | grep -E '^^[[1m[A-Z]{3,}'
3
  • Thanks. What's man-section? – woky Dec 29 '14 at 0:14
  • @woky it's a regex pipe for troff output (man page format) – Ярослав Рахматуллин Dec 29 '14 at 10:07
  • I've been trying to get those good old shortcuts that my old fingers were used to on Norton Commander, and I put that in my ~/.config/mc/mc.keymap : cat .config/mc/mc.keymap [panel] SortByName = ctrl-f3 SortByExt = ctrl-f4 SortBySize = ctrl-f6 SortByMTime = ctrl-f5 But hélas, this does not have any effect. What did I do wrong? – Pierre Mar 25 '20 at 21:31
0

In Ubuntu the keymaps are in /etc/mc/mc.keymap

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.