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.
Background:
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.
Question:
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+O
in normal mode is equivalent toctrl+R
, and works as expected.- In insert mode, neither
ctrl+O =
norctrl+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 ?
Thanks!
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 DEFAULTS
ornvim -u NORC
enter insert mode and type
abc abc abc
ctrl + R
displays"
in place, waiting for a register. Typing=
triggers the expression register and open=
in the command bar. Typing1+2 <Enter>
inserts 3, text becomesabc abc abc 3
ctrl + W
deletes3
ctrl + O
displays-- (insert) --
in the status line for a one-shot normal mode action
- with langmap
<esc>:set langmap=or,éw<enter>
i
to enter insert mode againctrl + É
deletes the word before, asctrl + W
did.ctrl + O
still activates-- (insert) --
, I expected"
in the text asctrl + R
did.
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.
:h 'langmap'
Your language characters will be understood as normal vim English characters(according to the langmap mappings) when typing Register names after CTRL-R in Insert/Replace Mode. Is it NOT behaving that way? Or are you talking about what to use for CTRL-R itself? Ctrl-R, no?'keymap'
option to remap them to bépo in insert mode? I understand that "O" in bépo is where "R" is in querty... So in Insert mode you have to use Ctrl+O (in bépo) instead of Ctrl+R to enter a register... Are you talking about using Ctrl+R (in bépo) to enter a register when using bépo keymap?