2011-11-30 10 views

Respuesta

40

siguiente archivo: :n

archivo Anterior: :p, :N o :prev dependiendo de la aplicación que esté utilizando vi.

Aquí hay una hoja de trucos típica que tiene una sección "Archivos" sobre este tema.

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

+0

Gracias :) tialaramex – Dinesh

+6

es algún editor vi,: p no funciona. Use: prev en su lugar – kingsmasher1

-1

:e# donde # es el número de expediente

+1

er que crea un archivo llamado '#' (cualquier número que ponga ahí) – Catskul

+1

Quiere ': b #'. –

3

Para Linux Red-Hat VI versión 7.2.411 uso: n: n para cambiar siguiente y anterior.

+0

También funciona en Mac OS X (que es BSD). No estoy seguro acerca de "real" BSD vi. –

+0

CentOS también! – Poli

0

El vi de AIX tiene sus propios comandos; Me tomó un tiempo encontrar esta información porque las respuestas en esta pregunta no la tenían ya, así que agregaré esta respuesta.

Ni :p, :N, ni :prev trabajo para ir al archivo anterior, es necesario utilizar una de las variantes del comando :n ---.

El :n para pasar al siguiente archivo es el mismo

Uso :n file_name para pasar a un determinado archivo (se puede abrir nuevos archivos de esta manera también) (para ir al archivo anterior, acaba de hacer esto con el anterior el nombre del archivo

uso :n list of file names para definir una nueva lista de archivos para editar (en este caso, los archivos list, of, file y names se abriría en serie usando :n después de ejecutar :n list of file names

Otros resultados útiles de las páginas del manual

: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. 
Cuestiones relacionadas