2011-11-30 34 views

回答

40

下一个文件::n

以前的文件::p:N:prev这取决于VI执行你使用。

下面是一个典型的备忘单,其中有关于此主题的“文件”部分。

http://www.lagmonster.org/docs/vi2.html

+0

感谢tialaramex :) – Dinesh

+6

是一些vi编辑器,:P不工作。使用:prev改为 – kingsmasher1

-1

:e#其中#是文件号

+1

呃创建一个名为'#'的文件(无论你放在哪里) – Catskul

+1

你想要':b#'。 –

3

对于Linux红帽VI版本7.2.411使用:n和:N到下一个切换和以前。

+0

也适用于Mac OS X(这是BSD)。不确定“真正的”BSD vi。 –

+0

CentOS也是如此! – Poli

0

AIX的vi有它自己的命令;我花了一段时间才找到这些信息,因为这个问题的答案已经没有了,所以我会添加这个答案。

无论是:p:N,也不:prev工作要到前一个文件,你需要使用:n ---命令的变化之一。

:n移动到下一个文件是一样的

使用:n file_name移动到一个特定的文件(可以打开新的文件,这种方式太)(要转到以前的文件,只是这样做与前文件的名称

使用:n list of file names定义文件的一个新的列表编辑(在这种情况下,文件listoffile,并且names将使用:n系列运行:n list of file names

0123后打开从该名男子页个

其他有用的结果

:e File 
     Edits the specified file. If you are using this subcommand 
     from the ex editor, you do not need to type the : (colon). 
    :e! 
     Re-edits the current file and discards all changes. 
    :e + File 
     Edits the specified file starting at the end. 
    :e + Number File 
     Edits the specified file starting at the specified line number. 
    :e # 
     Edits the alternate file. The alternate file is usually the 
     previous file name before accessing another file with a 
     :e command. However, if changes are pending on the current 
     file when a new file is called, the new file becomes the 
     alternate file. This subcommand is the same as the Ctrl-A 
     subcommand. 
    Ctrl-G 
     Shows the current file name, current line number, number of 
     lines in the file, and percentage of the way through the 
     file where the cursor is located. 
相关问题