gpt4 book ai didi

Vim:撇号 (') or backtick (` ) 后跟一个数字做什么

转载 作者:行者123 更新时间:2023-12-04 19:40:23 26 4
gpt4 key购买 nike

我正在努力学习 how to use marks in Vim ,并且在击中反引号后不小心击中了数字而不是字母。结果,我几天前编辑的文件在当前缓冲区中打开。点击其他数字会打开其他最近编辑的文件,但不是以任何特定顺序。此外,关闭和重新打开 Vim 会进一步重新调整顺序。谁能解释一下它的作用以及如何使用此功能?

最佳答案

编号标记是在 .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.

关于Vim:撇号 (') or backtick (` ) 后跟一个数字做什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27600851/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com