我在寄存器中录制了一个宏。
我用“ ap
”粘贴了它,它看起来像:
保存文件,退出vim并将其加载到新的vim实例中,该行已更改为:

对不起,我无法复制这些线条
。
echo& enc = utf-8
echo& fenc = latin1
echo& ff = dos
,其中_vimrc中定义以下内容:
设置ff = dos
设置fenc = utf-8
SET ENC = UTF-8
我试图将一些宏保存在文件中,并通过在寄存器中复制再次加载它。
如果我可视选择该行,它可以工作,然后将其复制以注册“ Ay
)。
但是,一旦我保存文件并将其加载到vim的新实例中,宏线看起来很奇怪。
有什么想法吗?
I recorded a macro in register a.
I pasted it with "ap
and it looks like:

Saving the file, quitting vim and loading it in a new vim instance the line is altered into:

Sorry for the graphics, I couldn't copy the lines.
What me also confuses is:
echo &enc = utf-8
echo &fenc = latin1
echo &ff = dos
where the following is defined in the _vimrc:
set ff=dos
set fenc=utf-8
set enc=utf-8
I'm trying to save some macros in a file and loading it again by copying in the register.
It works if I visual select the line, and copy it to register a"ay
.
But as soon as I save the file and load it in a new instance of vim the macro lines look weird.
Any idea?
发布评论
评论(1)
宏存储键代码和密钥代码在回声上时具有奇怪的表示形式。
^m
is enter ,^[
is esc ,箭头键看起来更奇怪。最重要的是:不要看宏,只需创建,存储和使用它们即可。
Macros store key codes and key codes have strange representations when echoed to a terminal.
^M
is Enter,^[
is Esc, arrow keys look even more strange.The bottom line: don't look at macros, just create, store and use them.