2014-12-22 1 views
0

나는 how to use marks in Vim를 배우려고 노력하고, 실수로 숫자 대신 역음을 타격 후 편지를 맞았다. 결과적으로 며칠 전에 편집 한 파일이 현재 버퍼에서 열립니다. 다른 자릿수를 치면 최근에 편집 된 다른 파일이 열렸지 만 특정 순서는 아닙니다. 또한 Vim을 닫았다가 다시 열면 순서가 재편됩니다. 아무도 그것이 무엇을 하고이 기능을 사용하는 방법을 설명 할 수 있습니까?빔은 : 숫자로 할 다음에 아포스트로피 (') 또는 역 따옴표를 (`) 무엇을

+0

Vim에서 도움말을 참조 했습니까? – ChiefTwoPencils

+0

나는 그랬다. 예,하지만 나는 그 행동을 촉발시키는 핵심 순서 만 아는 도움을 어떻게 참조 할 수 있는지 잘 모르겠습니다. – AtomHeartFather

답변

3

번호 표시가 .viminfo 파일에 설정 한, 당신은 직접 설정할 수 없습니다. Vim의 도움말 문서는 어떻게 작동하는지 설명하고있다 :

Numbered marks '0 to '9 are quite different. They can not be set directly. 
They are only present when using a viminfo file |viminfo-file|. Basically '0 
is the location of the cursor when you last exited Vim, '1 the last but one 
time, etc. Use the "r" flag in 'viminfo' to specify files for which no 
Numbered mark should be stored. See |viminfo-file-marks 

과 :

Uppercase marks ('A to 'Z) are stored when writing the viminfo file. The 
numbered marks ('0 to '9) are a bit special. When the viminfo file is written 
(when exiting or with the ":wviminfo" command), '0 is set to the current cursor 
position and file. The old '0 is moved to '1, '1 to '2, etc. This 
resembles what happens with the "1 to "9 delete registers. If the current 
cursor position is already present in '0 to '9, it is moved to '0, to avoid 
having the same position twice. The result is that with "'0", you can jump 
back to the file and line where you exited Vim. 
2

그건 모든 도움말에서. :help marks부터 관련 명령 후, 목록이 무엇인지 마크에 대한 섹션있다 :

'0 -'파일

더 많은 정보를 더 아래있다 .viminfo에서 설정 9 번호 표시는 :

번호가 표시 '0'9는 상당히 다르다. 직접 설정할 수는 없습니다. viminfo 파일 | viminfo-file |을 사용할 때만 나타납니다. 기본적으로 더 번호가 표시가 저장되지되어야하는 파일을 지정하는 'viminfo'에서 "R"플래그를 사용, 등 마지막으로 한 시간 1 0 당신이 마지막으로, 빔을 종료 할 때 커서의 위치입니다 '. | viminfo-file-marks를 참조하십시오 |.

관련 문제