I have macro lines in my vimrc file like:
let @i = "oif (^[a) {^[a^M}^[k0f)"
Where the "^[" and "^M" are characters which were entered via "Ctrl-V" in the insert mode, so they must be Escape and Newline (I'm using Linux, and Vim is configured to use '\n' newlines, but what this character is exactly in the vimrc file I don't know).
When I search for such a line with grep -B 2 'i = "' ~/.vimrc
I see a completely broken output:
hi Comment cterm=none ctermbg=226 ctermfg=009 guibg=#ffff00 guifg=#ff0000
}0f)"i = "oif () {
While I would want:
hi Comment cterm=none ctermbg=226 ctermfg=009 guibg=#ffff00 guifg=#ff0000
let @i = "oif (^[a) {^[a^M}^[k0f)"
Or at least something similar, with the third line starting with let @i
. But I see }0f)"i = "oif () {
and there is no sign of let @i
.
I tried to investigate a bit and found that it works correctly until the line has the "^M" character.
Could anyone please say how to fix it, or at least explain what is going there?