我搜索了一些文档,但似乎找不到令人满意的答案。
基本上我想在每个缓冲区的末尾插入一个新行并填充此行 与打开缓冲区的修改文件名。
示例:
SomeText
\<old_eof\>
成为
Some text
result of substitute(expand("%t"), "txt", "csv", "") and some wrapping text
\<new_eof\>
我已经尝试过
:bufdo normal Go<C-R>=substitute(expand("%t"), "txt", "csv", "")
但是,这仅输出
<C-R>=substitute(expand("%t"), "txt", "csv", "")
我通过简单地录制宏并使用来找到了一个部分解决方案
:bufdo normal @a
然而,这不是我想要的路。
你是怎么做到的
<C-R>
?您是否按 <
、C
、-
、R
和 >
?你按Ctrl+R
吗?
无论如何,使用普通模式宏听起来并不是一个很好的方法来做你想做的事。
:help :put
更合适:
:bufdo $put=substitute(expand('%t'), 'txt', 'csv', '')
其中
$
是最后一行的地址。
请注意,我用单引号替换了双引号,因为,好吧……我们可以说
:put
有它的特性。