0

I reduced my _vsvimrc file to a single line :

inoremap jk <esc>

Now whenever I hit jk or esc directly, it gets back to normal mode but also puts the cursor at the column 0 : gif showing the behavior.

Removing the mapping of jk resolves the issue.

Is this expected behavior ? I did the same test in Gvim and it does not seem to have the same issue.

Related issue on github

Sbu
  • 910
  • 11
  • 22

1 Answers1

3

This behavior is operating by design here. In this example the caret is in virtual space when you hit <Esc> (either directly or via jk). When that occurs VsVim will put the caret in the last real space on the same line.

It's easier to see this behavior if you enable white space viewing in Visual Studio:

  • Edit -> Advanced
  • Check View White Space
JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
  • Alright, thanks for the tip. Do you know if we can replace the virtual space by actual spaces ? – Sbu Jan 05 '18 at 14:43
  • For now as it happens mostly when I hit `o`, I remapped it `nnoremap o o_` to simulate the actual creation of whitespaces... far from perfect ! – Sbu Jan 05 '18 at 14:50
  • I don't know of a way. Vim by default doesn't insert spaces here and I don't know of a way to make it do that. If it exists I'd def be willing to implement in VsVim. – JaredPar Jan 05 '18 at 18:50