VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.73k stars 1.31k forks source link

Placing marker does not work when creating mapping (but works in regular vim) #9131

Open ahmedsayman03 opened 1 month ago

ahmedsayman03 commented 1 month ago

Describe the bug I want to be able to press [ to create a new blank line above the current line (with my cursor remaining its current place). Also want to be able to create a new blank line below the current cursor line (cursor should not change positions).

This is my .vimrc file.

map [ mcO<Esc>`c
map ] mco<Esc>`c

map f /

map U <C-r>

This works in Vim terminal. When I click [ a new line is created above, and remains in normal mode. ] creates a new line below.

But in VSCode with this vim extension, creating a new line below works as expected but creating a new line above does not: what happens is that a new line is created but the cursor moves to the line above.

To Reproduce Steps to reproduce the behavior:

  1. Copy paste my .vimrc file
  2. try to create a new line above and below the current line with the cursor moved to somewhere in the middle of the current line

Expected behavior The cursor should remain in it's current place as a new line is created above and below the current line. It can create a new line below the cursor no problem, but when creating a new line above, the cursor moves to the line above.

Environment (please complete the following information):