2009-04-20 18 views
16

Chcę wiedzieć, gdzie: historia poleceń jest przechowywana dla konkretnej sesji vim. Wiem, że możemy przewijać i przeszukiwać historię. Moim celem jest wykonanie części poleceń, które wykonałem przy użyciu prób i błędów, i utworzenie pliku źródłowego vim.gdzie jest przechowywana historia poleceń?

Odpowiedz

15

jest ona przechowywana w $ HOME/.viminfo

z polecenia vim pomocy:

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

dziękuję, że dokładnie to, czego szukałem ... Szukałem go w katalogu instalacyjnym vim – xshyamx

1

To w pliku .viminfo (lub _viminfo jeśli jesteś na Windows). Powinno to być w każdym przebiegu dla twojego katalogu domowego.

2

Szukasz funkcji histget(), histadd() i histdel().

EDYCJA: Plik viminfo będzie zawierał dane historyczne z kilku sesji, które, jak sądzę, były już znane, zgodnie ze sposobem sformułowania pytania.

1
:h viminfo-file-name 

HTH :-)

5

Można również otworzyć swoją niedawną historię poleceń w minibuforze używając q: lub :<CTRL-F> polecenia

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

można poruszać się po tym oknie, a następnie skopiować podobnie jak normalny bufor. Pobicie <Enter> nad poleceniem spowoduje jego wykonanie.

Powiązane problemy