1

For testing purpose I created simple macro which wraps current line into single quotes and goes to next line.

Here is output from the register the macro is saved in: I'^[A'^[j
And here is testing text:
Line number 1 Line number 2

if I trigger the macro on the line number 1, cursor position should be changed to the line number 2 and the text should be changed to:

'Line number 1' Line number 2{CURSOR_POSITION}

Instead of the expected result, vim stays in insert mode at the end of line 1 and result is following:

'Line number 1'ê{CURSOR_POSITION} Line number 2
...where {CURSOR_POSITION} is current cursor position

Why vim place ê character at the end of first line and doesn't go to the next line?

I got same result when I ran vim with --noplugin option.
I use xterm-256color
Vim 7.4

user2694295
  • 366
  • 6
  • 16

1 Answers1

2

This is kind of a bug (discussion here). I know it is stupid but this should work :-)

I'^[A'^[1j

It is because ^[j can be interpreted as a Ctrl+V Alt+J (link here).

Community
  • 1
  • 1
ryuichiro
  • 3,765
  • 1
  • 16
  • 21