Ticket #4588 (closed enhancement: fixed)

Opened 3 weeks ago

Last modified 6 days ago

Improved Keymap for MC: Convenience for Vim Users

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

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

diff-mc.default.keymap-mc.vim.keymap.txt (7.0 KB) - added by krekhov 3 weeks ago.
mc.vim.keymap (6.5 KB) - added by krekhov 3 weeks ago.

Change History

comment:1 Changed 3 weeks ago by zaytsev

  • Status changed from new to accepted
  • Owner set to zaytsev
  • 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.

Changed 3 weeks ago by krekhov

Changed 3 weeks ago by krekhov

comment:2 Changed 2 weeks ago by zaytsev

Branch: 4588_vim_keymap
Initial changeset:f425b90402af73ccd347d4ee2a05e7461ec929c3

comment:3 Changed 2 weeks ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from no branch to approved

comment:4 Changed 2 weeks ago by zaytsev

  • Status changed from accepted to testing
  • Priority changed from major to minor
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:5 Changed 6 days ago by zaytsev

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.