2009-04-20 7 views
16

특정 vim 세션에서 : 명령 기록이 저장되는 위치를 알고 싶습니다. 나는 우리가 스크롤하고 역사를 통해 검색 할 수 있습니다. 내 목표는 시행 착오를 사용하여 실행 한 명령의 일부를 가져와 vim 소스 파일을 만드는 것입니다.: 명령 내역은 어디에 저장되어 있습니까?

답변

15

은이 정력 help 명령에서 $ HOME/.viminfo

에 저장됩니다

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

내가 찾던 바로 그 덕분에 ... 나는 설치 디렉토리에서 그것을 찾고 있었다. – xshyamx

1

그것은 .viminfo 파일에 (또는 당신이 윈도우에있는 경우 _viminfo). 그것은 귀하의 홈 디렉토리를 통과하는 모든 것이어야합니다.

2

histget(), histadd()histdel()을 찾고 있습니다.

EDIT : viminfo 파일에는 질문을 공식화 한 방식에 따라 이미 알고있는 여러 세션의 기록 데이터가 포함됩니다. 당신은 또한 q: 또는 :<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|. 

당신은이 창을 이동하고,처럼 복사 할 수 있습니다를 사용하여 미니 버퍼에 최근 명령 기록을 열 수 있습니다

1
:h viminfo-file-name 

HTH 통상의 버퍼 명령을 통해 <Enter>을 치면 실행됩니다.

관련 문제