2009-04-20 16 views
16

Quiero saber dónde está almacenado el historial de comandos: para una sesión vim en particular. Sé que podemos desplazarnos y buscar a través de la historia. Mi objetivo es tomar una porción de los comandos que ejecuté usando prueba y error y crear un archivo fuente vim.donde se almacena el historial de comandos?

Respuesta

15

se almacena en $ HOME/.viminfo

Desde el comando vim ayuda:

The viminfo file is used to store: 
- The command line history. 
- The search string history. 
- The input-line history. 
- Contents of registers. 
- Marks for several files. 
- File marks, pointing to locations in files. 
- Last search/substitute pattern (for 'n' and '&'). 
- The buffer list. 
- Global variables. 
+0

gracias eso era exactamente lo que estaba buscando ... Estaba buscándolo en el directorio de instalación de vim – xshyamx

1

Está en el archivo .viminfo (o _viminfo si está en Windows). Debe estar en lo que pase para su directorio de inicio.

2

Está buscando las funciones histget(), histadd() y histdel().

EDITAR: el archivo viminfo contendrá los datos del historial de varias sesiones, que supongo que ya conocía, de acuerdo con la forma en que formuló su pregunta.

1
:h viminfo-file-name 

HTH :-)

5

También puede abrir el historial de comandos en un reciente minibuffer utilizando los comandos q: o :<CTRL-F>

OPEN 

There are two ways to open the command-line window: 
1. From Command-line mode, use the key specified with the 'cedit' option. 
    The default is CTRL-F when 'compatible' is not set. 
2. From Normal mode, use the "q:", "q/" or "q?" command. *q:* *q/* *q?* 
    This starts editing an Ex command-line ("q:") or search string ("q/" or 
    "q?"). Note that this is not possible while recording is in progress (the 
    "q" stops recording then). 

When the window opens it is filled with the command-line history. The last 
line contains the command as typed so far. The left column will show a 
character that indicates the type of command-line being edited, see 
|cmdwin-char|. 

Puedes moverte por esta ventana, y al igual que copiar un buffer normal. Al presionar <Enter> sobre un comando se ejecutará.

Cuestiones relacionadas