22

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?

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
user1839724
  • 261
  • 2
  • 4
  • 6

2 Answers2

12

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

Community
  • 1
  • 1
champost
  • 463
  • 4
  • 9
  • 4
    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. – Wolfson Sep 01 '20 at 21:00
  • For Homebrew installation the path would be a bit different: `/usr/local/opt/mc/etc/mc/mc.keymap` – bora89 Aug 25 '23 at 10:52
  • Another path for Homebrew might be: `/opt/homebrew/Cellar/midnight-commander/4.8.29_1/etc/mc` – bora89 Aug 25 '23 at 11:29
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

Jake
  • 189
  • 2
  • 9