user2694295
user2694295

Reputation: 390

vim - when triggering a macro, normal mode isn't switched from insert mode (xterm)

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

Upvotes: 1

Views: 116

Answers (1)

ryuichiro
ryuichiro

Reputation: 3865

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).

Upvotes: 2

Related Questions