r/neovim•
luetage

Mapping: how to switch accent with grave accent (backtick)?

I'm trying to switch accent with backtick in my init.vim for a german keyboard. The accent is its own key and the backtick is done with shift-accent. So far I haven't been successful and would be glad for any pointers.

Latest try:

nnoremap ´ `
inoremap ´ `
cnoremap ´ ` 
nnoremap ` ´
inoremap ` ´
cnoremap ` ´

When using the key it always triggers backtick, shift-accent doesn't trigger accent.

Posted May 4, 2020, 11:54 AM UTC

13
rnevius•

Look into :help i_CTRL-V

2
luetageOP•

Thank you, that's a good workaround I didn't know about. Since I'd only ever need accent in insert mode this is sufficient.

Would still be interested why the remapping fails though :/

1
rnevius•

You can use i_CTRL-V while defining any mappings. It just returns the literal representation of the character/keys you're pressing.

1