![](/img/trans.png)
[英]how to append the content of one file at the of the content of another file in python
[英]Vim: how to append the content of a variable to a file?
我想知道:是否有可能写一个变量的内容(在我的情况下,最后搜索) 与命令文件?
我尝试了以下方法:
:echo @/ >> /tmp/foo.txt
:@/w /tmp/foo.txt
但这没有用。 知道什么是正确的方法吗?
romain提议的替代解决方案是使用redir
命令,该命令将消息重定向到文件。 如:help redir
,
作为命令输出的消息将写入该文件,直到重定向结束。
要附加搜索寄存器的内容,请运行以下命令序列:
redir >> /tmp/foo.txt
echo @/
redir END
该序列可以转换为功能和/或用作键映射。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.