Making key bindings of midnight commander like Vim

13.2k Views Asked by At

I would like to have hjkl key to go through directories/files of my panel. This is a bit like elinks with hjkl, less with hjkl, or vifm.

Ctrl+ key left to do a sort of alt+i.

Do you know if those shortcuts are possible?

If yes, please would you mind providing some help or examples of a config file?

2

There are 2 best solutions below

0
On

looking for the same info btw. I want to completely config my mc keybindings. Hope someone comes along...

fwiw I found this:

6.1.1 The Default Key Bindings Suck!

>Problem    B_alertblock
>The default key bindings suck! I want to change them!
>
>Solution    B_alertblock
>Despite what the Internet tells you, with a recent enough
>Midnight Commander, one can change the key bindings.
>
>Quip    B_block
>But you'll need a PhD to figure out how.

>

Source: http://www.nawaz.org/media/docs/mc/mc.html

3
On

Check this excellent answer:

The configuration is stored in

$HOME/.config/mc/

In your case edit the file $HOME/.config/mc/ini. You can check which files are actually read in by midnight-commander using strace:

strace -e trace=open -o mclog mc

I found my key bindings (on Ubuntu 12.04) at /etc/mc/mc.keymap