Making key bindings of midnight commander like Vim
Asked Answered
M

2

23

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?

Merat answered 10/2, 2013 at 22:48 Comment(0)
J
13

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

Janes answered 3/10, 2013 at 9:2 Comment(3)
still in /etc/mc/mc.keymap on Ubuntu 20.04. Just look for the [panel] section and append ; j, ; k, ; h and ; l to the lines starting with Down, Up, Left and Right respectively. In my case line 90 to 93.Topsyturvydom
For Homebrew installation the path would be a bit different: /usr/local/opt/mc/etc/mc/mc.keymapBuckthorn
Another path for Homebrew might be: /opt/homebrew/Cellar/midnight-commander/4.8.29_1/etc/mcBuckthorn
A
2

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

Abessive answered 10/4, 2013 at 16:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.