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. – Vivian De Smedt Sep 24 '22 at 22:12.vimrcstarting Vim with the-U NONE -i NONEoptions to reduce the impact of previous sessions. – Vivian De Smedt Sep 24 '22 at 22:18.vimrcapart from those key mappings and the problem remained. – paradroid Sep 24 '22 at 22:53.vimrcwith nothing else and it still didn't work. Very strange. https://vim.fandom.com/wiki/Moving_lines_up_or_down#Mappings_to_move_lines – paradroid Sep 24 '22 at 23:02