记录的VIM宏已保存到文件并再次加载看起来很奇怪

发布于 2025-01-21 17:16:20 字数 775 浏览 1 评论 0 原文

我在寄存器中录制了一个宏。

我用“ ap ”粘贴了它,它看起来像:

“在此处intraim

保存文件,退出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:

enter image description here

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

enter image description here

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

戴着白色围巾的女孩 2025-01-28 17:16:20

宏存储键代码和密钥代码在回声上时具有奇怪的表示形式。 ^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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文