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

查看:199
本文介绍了在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.

请参阅:

  • :he 21.3
  • :he E20

...有关详细信息。

...for more information.

您还可以找到 :mksession 有用,如果你想保存会话状态。

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

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

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