Ticket #4588 (accepted enhancement)

Opened 25 hours ago

Last modified 20 hours ago

Improved Keymap for MC: Convenience for Vim Users

Reported by: krekhov Owned by: zaytsev
Priority: major Milestone: 4.8.33
Component: mc-key-bindings Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Hi, I really like mc and vim, but I don't like the hotkeys in mc (like many vim users):
/etc/mc/mc.default.keymap
/etc/mc/mc.emacs.keymap

I think they are inconvenient and have some ugly hotkeys, for example:

SplitMore = alt-shift-right
SplitLess = alt-shift-left
CdChild = ctrl-pgdn
CdParent = ctrl-pgup
History = alt-shift-h
HistoryPrev = ...; ctrl-down
HistoryNext = ...; ctrl-up
PageUp = ...; alt-v
PageDown = ...; ctrl-v

etc.

I wrote mc.vim.keymap file, which may be interesting and convenient for vim users (simplified some hotkeys and added more convenient hotkeys - this opens up a new experience for mc user).

I suggest adding this to the upstream, do you think it will be useful ? I tested this patch, hotkeys work, very convenient. Users can use it like this:

$ mc --keymap=/etc/mc/mc.vim.keymap

or directly add this command to your ~/.bashrc:

alias mc='mc --keymap=/etc/mc/mc.vim.keymap'

or:

export MC_KEYMAP=/etc/mc/mc.vim.keymap

or any other method described in mc -> F1 -> contents -> Keys -> Redefine hotkey bindings

I know that Linux has a tool called vifm, I was thinking of using it, but I noticed that mc is much more powerful (which is cool!).

You can see the new changes in the diff-mc.default.keymap-mc.vim.keymap.txt file.

I tested mc.vim.keymap with this version:
GNU Midnight Commander 4.8.29
Built with GLib 2.74.5
Built with S-Lang 2.3.3 with terminfo database
Built with libssh2 1.10.0
With builtin Editor and Aspell support
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:

cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, sftpfs, fish

Data types:

char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

Attachments

mc.vim.keymap (6.5 KB) - added by krekhov 25 hours ago.
diff-mc.default.keymap-mc.vim.keymap.txt (8.4 KB) - added by krekhov 25 hours ago.

Change History

Changed 25 hours ago by krekhov

Changed 25 hours ago by krekhov

comment:1 Changed 20 hours ago by zaytsev

  • Owner set to zaytsev
  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.33

I would have no problem adding a new keymap that mimics traditional vim shortcuts. I don't use vim much, so I can't judge how good is it, but maybe vim users can say something about it.

Note: See TracTickets for help on using tickets.