2009-04-20 21 views
16

Voglio sapere dove si trova la cronologia dei comandi per una particolare sessione di vim. So che possiamo scorrere e cercare nella storia. Il mio obiettivo è prendere una parte dei comandi che ho eseguito usando tentativi ed errori e creare un file sorgente Vim.dov'è memorizzata la cronologia dei comandi?

risposta

15

si è conservato a $ HOME/.viminfo

Dal comando vim aiuto:

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

grazie che era esattamente quello che stavo cercando ... lo stavo cercando nella directory di installazione di vim – xshyamx

1

E 'nel file .viminfo (o _viminfo se siete su Windows). Dovrebbe essere in qualunque passaggio per la tua home directory.

2

Cerchi le funzioni histget(), histadd() e histdel().

MODIFICA: il file viminfo conterrà i dati cronologici di diverse sessioni, che presumo, ne era già a conoscenza, in base al modo in cui è stata formulata la domanda.

1
:h viminfo-file-name 

HTH :-)

5

È inoltre possibile aprire la storia recente di comando in un minibuffer utilizzando i q: o :<CTRL-F> comandi

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|. 

È possibile scorrere la finestra, e copiare proprio come un buffer normale. L'esecuzione di <Enter> tramite un comando lo eseguirà.

Problemi correlati