Is there a way to change shortcuts in midnight commander?

by rride   Last Updated February 04, 2018 20:01 PM

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.



Answers 2


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 [email protected] | grep -E '^^[[1m[A-Z]{3,}'
Ярослав Рахматуллин
Ярослав Рахматуллин
October 14, 2012 18:14 PM

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

weberjn
weberjn
February 04, 2018 19:43 PM

Related Questions


Where can I find keyboard key names using in mc.keymap?

Updated February 23, 2016 01:00 AM



Midnight Commander function keys not working

Updated May 06, 2017 17:01 PM