I am using Vim with a QWERTY/BÉPO langmap setting which allows me to use the French dvorak-like keymap for inputting text and the QWERTY commands for the normal and visual mode.
I am really satisfied with this dual keymap solution, as inputting text in Bépo has really become physical muscle memory, and I do not have to think at all about the location of each letter but I am rather focused on the words and the general content.
On the other hand, vim commands are letter-based, so having two different letters depending on the context (normal mode or insert mode) for the same key has really become second nature.
However, I don’t know how to be able to use the mappings for some commands in insert mode, like expression register.
- in QWERTY:
ctrl+R =displays the input for quick calculation as expected in insert mode.
- in BÉPO:
ctrl+Oin normal mode is equivalent to
ctrl+R, and works as expected.
- In insert mode, neither
ctrl+O %work. I get the (insert) status bar,
that is expected but(see edit below) I do not get the command input that I would like to get.
Does anyone knows whether it is possible and how to implement a mapping for this ?
added for clarification and additionnal findings
I am wondering if this is a bug related to ctrl + O taking precedence despite the langmap. I could not find a way to reproduce it using only the QWERTY layout, so I am not totally sure if
CTRL+<KEY> in insert mode uses the original language or the one remapped using langmap.
:h langmap This will allow you to activate vim actions without having to switch back and forth between the languages. Your language characters will be understood as normal vim English characters (according to the langmap mappings) in the following cases: o Normal/Visual mode (commands, buffer/register names, user mappings) o Insert/Replace Mode: Register names after CTRL-R o Insert/Replace Mode: Mappings
** steps to reproduce the bug **
- without langmap:
vim -u DEFAULTSor
nvim -u NORC
enter insert mode and type
abc abc abc
ctrl + Rdisplays
"in place, waiting for a register. Typing
=triggers the expression register and open
=in the command bar. Typing
1+2 <Enter>inserts 3, text becomes
abc abc abc 3
ctrl + Wdeletes
ctrl + Odisplays
-- (insert) --in the status line for a one-shot normal mode action
- with langmap
ito enter insert mode again
ctrl + Édeletes the word before, as
ctrl + Wdid.
ctrl + Ostill activates
-- (insert) --, I expected
"in the text as
ctrl + Rdid.
I could not find for a Qwerty layout a key equivalent to the
é that would enable to reproduce the discrepancy of behavior that I get with Bépo.
I believe this question could be of interest / tested by Colemak or Dvorak users that have switched to these new layouts after learning vim and use langmap to keep using QWERTY and their muscle memory for vim commands, as described in this Vim tip.