Open huyz opened 2 years ago
Sorry for the late reply. I'd really prefer if we "just" list these bindings in the README
and docs for the simple reason not to break existing configurations for who-knows-how-many Mac users.
Your configuration gave me a lot of inspiration, thanks
After my comments a couple of weeks ago on https://github.com/matze/vim-move/pull/71#issuecomment-1199893686, I realized that not everything was working. So I revisited the configuration. My conclusion is that the default bindings for
vim-move
are not ideal.Here are the problems as I see them:
C
as the modifier because<C-l>
is useful for redrawing the screen (and in neovim, also clearing any search highlighting).S
as the modifier because I'd like to figure out mappings that would work the same with vim and with JetBrains and VS code and the Shift key is often used in GUI apps to mean "extend the selection"A
modifier which on macOS is the Option key.A
, there are problems with using theh
,j
,k
,l
keys. In the terminal (at least iTerm), the recommended setting is to make the left Option key map to<Esc>+
. The problem comes when you're in visual mode in the terminal and you hit Esc to exit out of Visual mode and then hit one of the above motion keys, such ash
. What happens is that because of the vim-move mappings, this would be interpreted as a vim-move operation. One workaround is to hit Esc and wait until vim times out—but who wants to wait around? So the solution is to map to arrow keys instead ofh
and friends. Bonus: JetBrains and VS Code IDEs already use the arrow keys for moving line/statements, so the mappings will be similar or even the same (default VS code mappings for moving a line is indeed Option + arrow keys).This is what I've figured out works very well for vim and neovim in iTerm2 terminal and in MacVim and VimR:
It took quite some time to figure this out. So I think that it would help mac users if either these were the defaults or there was a section in the README that listed all of these.