I have these key mappings that I use a lot in nvim, but they don't work in vim:
" Move lines with Alt+Shift+j/k
nnoremap <A-S-j> :m .+1<CR>==
nnoremap <A-S-k> :m .-2<CR>==
inoremap <A-S-j> <Esc>:m .+1<CR>==gi
inoremap <A-S-k> <Esc>:m .-2<CR>==gi
vnoremap <A-S-j> :m '>+1<CR>gv=gv
vnoremap <A-S-k> :m '<-2<CR>gv=gv
Instead I get the Join Words and Help actions as though the Alt
key wasn't being pressed (in Normal Mode).
I have tried using capital J
and K
instead, but that didn't help.
Does vim not accept key bindings with Alt
and Shift
together, or is there some option that needs to be enabled or disabled?
MORE INFO: I explicitly set as many options as I can for consistency, as I use the same configuration between nvim, vim and gvim and Linux and Windows, but there are so many that I don't have all of them set.
Currently I am using:
Linux x86_64 I use nvim 0.72 (appimage) and vim 8.2 for git
Linux aarch64 I am using vim 8.2
On Windows I am using vim 9.0 and gvim 9.0
These key mappings are only working on nvim.
<A-a>
and<A-S-a>
to two different key sequence on Windows 10 with gVim 8.1, 8.2 and 9.0..vimrc
starting Vim with the-U NONE -i NONE
options to reduce the impact of previous sessions.