在 vim 中,有没有办法在会话之间保存书签? [英] in vim, is there a way to save bookmarks between sessions?

查看:23
本文介绍了在 vim 中,有没有办法在会话之间保存书签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

退出vim再进入时,所有书签都不见了

when exiting vim and then re-entering, all bookmarks have gone

已经找到了如何记住文件之间的最后一个位置,但没有找到退出后如何记住书签.

have found out how to remember last position between files, but not how to remember bookmarks after having exited.

有没有办法配置 vim 以便记住文件的书签?

is there a way to configure vim so that bookmarks are remembered for a file?

推荐答案

是的.将以下内容添加到您的 .vimrc:

Yes. Add the following to your .vimrc:

:set viminfo='1000,f1

但请注意:

只要文件还在,小写标记 'a 到 'z 就会被记住缓冲区列表.如果从缓冲区列表中删除文件,则其所有标记丢失.如果删除包含标记的行,则该标记已删除.

Lowercase marks 'a to 'z are remembered as long as the file remains in the buffer list. If you remove the file from the buffer list, all its marks are lost. If you delete a line that contains a mark, that mark is erased.

因此您需要使用大写或数字标记.

So you'll need to use uppercase or numeric marks.

见:

...了解更多信息.

如果您想,您可能还会发现 :mksession 很有用保存会话状态.

You may also find :mksession useful if you want to save session state.

这篇关于在 vim 中,有没有办法在会话之间保存书签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆