歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> vi同時編輯多個文件

vi同時編輯多個文件

日期:2017/2/27 9:22:57   编辑:更多Linux
  我有3個文件要同時編輯:文件是A.C,B.C和C.BAS,vi命令如何實現,vi中如何在這3個文件中進行切換? vim可以在多分割窗口(multi-split-screen )環境下編輯多個文件。想了解有關詳情可輸入:help usr_08.txt。 要分割屏幕顯示多個不同文件,在vi命令提示符後輸入: :split another-file :vsplit another-file 不知道你在安裝系統的時候是否裝screen了?我裝了,如果裝了,直接打screen,然後Ctrl a + c 為創建新窗口,Ctrl a + p為在打開的]窗口中切換!可以開很多個!足夠用! 1. Use vi to open the three file directly for example vi a b c 2.Then vi will open the file by the order you enter in the command line. But current is a. If you want to change to b, you must first save a, then press "2" ,then press "Ctl+Shift+^", for c, you must first save b, then press "3", then press "Ctrl+Shift+^". vi a b c :n跳至下一個文件,:e#回到剛才編輯的文件。 比如當前編輯文件為a,:n跳至b,再:n跳至c,:e#回到b,想回到a的話用:ea 我覺得用split 開窗口的好處,可以直接用yy在兩個窗口之間復制 兩個窗口可以同時是一個文件 其實可以在一個窗口下,打開3個文件的。 先 打開一個,vi 文件名 然後在vi的命令輸入狀態下輸入 :sp 另外一個文件的路徑及文件名 如此就可以在一個窗口打開3個文件了。 可以使用 ctrl + 兩次按 w 在3個文件中切換




Copyright © Linux教程網 All Rights Reserved