If I save a macro by typing:
:let @s='/{<C-v><C-m>'<Enter>
which looks like:
:let @s='/{^M'
the macro that is actually saved is /{^M^M
,
with an extra linebreak (that I did not type) appended at the end,
and not /{^M
(which I intended).
This can be seen by running the macro (@s
),
or by pasting the macro in the command-line mode by typing:
:let @s='<C-r>s'
What appears is:
:let @s='/{^M^M'
and not what I had originally wrote, which is:
:let @s='/{^M'
This only happens when I write macros in command-line mode,
and not when I create macros with q
.
I did a bit of testing and this seems to be the case
with any macro ending with ^M
.
What is the reason for this behavior, and how do I disable it?
I am using VIM 9.0 on Linux.