2009-07-23 10 views

回答

68

在VIM命令提示:

:read new_file 

或簡稱:

:r new_file 

這將插入下光標所在的new_file內容。舉例來說,如果這是new_file內容:

 
I do not like green eggs and ham 
I do not like you sam I am 

這就是你正在編輯的文本:

 
I meant what I said and I said what I meant 
An elephant's faithful one hundred percent. 

而且你的光標在第一行,鍵入:

:read new_file    

然後你的緩衝區將是:

 
I meant what I said and I said what I meant 
I do not like green eggs and ham 
I do not like you sam I am 
An elephant's faithful one hundred percent. 
+22

作爲一個方面的說明,加上!你也可以將命令的輸出讀入vim。 :r!ls – Blixtor 2009-07-23 07:07:52

相關問題