replit/codemirror-vim

Visual mode: arrow keys do not select text

Closed this issue · 5 comments

When in visual mode, I can select using h/j/k/l but not with the arrow keys.

In fact, if I start the selection with h/j/k/l and then I press any of the arrow keys, the selection disappears.

In any case the arrow keys are moving the cursor, the issue is only with the selection.

Do you see this same issue on https://raw.githack.com/replit/codemirror-vim/master/dev/web-demo.html too? If no could you tell us more about the configuration with which you use codemirror-vim, the most likely explanations are that either some other codemirror plugin has higher precedence and is handling keyboard events before vim, or a browser extension like vimium interferes.

That demo works fine.

Thx for the tip on plugin precedence, I'll play with the order of the plugins and will let you know which one was the culprit.

Found it! By mistake I was loading the defaultKeymap and vim's.

Loading just vim's fixed the issue, obviously.

Thx for pointing me in the right direction.

you need to include the default keymap too, in order for insert mode to work, just include it after vim

I just figure out exactly that, but the hard way :-S