which-key.nvim
which-key.nvim copied to clipboard
Combination of `langmap`, 'which-key', and some keymap breaks `langmap`
I understand, that this is a rather weird, niche, and hard to track issue.
Steps to reproduce (how I did it):
- Create fresh '.config/nvim'.
- Put this plugin to 'pack/plugins/opt' under 'which-key' (I used b582c9d7 commit).
- Create startup file with the following content (I named it 'init_which-key.vim'):
'init_which-key.vim'
" Summary:
" - Combination of set up 'which-key.nvim' (with call to `setup()`), set
" `langmap` and certain keymap disables certain keys from `langmap`.
" - If don't set up 'which-key', everything works as expected.
" - If don't add any mappings, everything works as expected.
" - Having kemaps from both listed groups disable all present `langmap` keys.
" So it seems they 'act separately'.
" - Keys from `langmap` don't work when applied in Normal mode. In Visual mode
" everything works as expected.
" - Having `nnoremap` instead of `nmap` shows similar behavior.
" - Disabling in 'which-key' all plugins (with `plugins` field inside `setup`
" argument) has no effect on behavior.
" Add plugin 'folke/which-key.nvim' in any preferred way and set it up
packadd which-key
lua require('which-key').setup({})
" There are other letters that get broken, but thoroughly tested only these
set langmap=рh,оj,лk,дl,щo
" With any of these keymaps (but not limited to) 'о', 'л', 'д' stop working
nmap Ж :
" nmap м v
" nmap в d
" nmap а f
" nmap е t
" With any of these keymaps (but not limited to): 'р', 'щ' stop working
" nmap ф a
" nmap я z
" nmap ч x
" nmap с c
- Run
nvim -u init_which-key.vimfrom '.config/nvim' and try using cyrillic keys fromlangmap. To see different groups of keys being disabled, uncomment mapping from other set.
The summary of what I found with ~~painfully lot of~~ trial and error is inside 'init_which-key.vim'. I also tried replacing local secret to something else (i tried ß) but no luck.
I understand that this is a rather niche and rare issue, but maybe it is a consequence of something bigger.