[英]vimscript using another file instead of .viminfo
I installed a vimscript written by expert in this question. 我安装了由专家在这个问题上写的vimscript。
But there is one problem in the script. 但是脚本中存在一个问题。 When I restart the computer, the bookmarks saved by the script will disappear. 当我重新启动计算机时,脚本保存的书签将消失。
Is it possible to store the bookmarks to another file (eg mybookmarks.txt ) instead of .viminfo
file? 是否可以将书签存储到另一个文件 (例如mybookmarks.txt )而不是.viminfo
文件? Bookmarks stored in .viminfo
disappear unpredictably. .viminfo
存储的书签会.viminfo
消失。
Yes. 是。 Use the 'viminfo n'
option. 使用'viminfo n'
选项。
From :he 'viminfo'
: 来自:he 'viminfo'
:
Name of the viminfo file. viminfo文件的名称。 The name must immediately follow the 'n'. 名称必须紧跟在“ n”之后。 Must be the last one! 必须是最后一个! If the "-i" argument was given when starting Vim, that file name overrides the one given here with 'viminfo'. 如果在启动Vim时给出了“ -i”参数,则该文件名将以'viminfo'覆盖此处给出的文件名。 Environment variables are expanded when opening the file, not when setting the option. 打开文件时将扩展环境变量,而不是在设置选项时将其扩展。
Since it seems like a good tool in general, I extracted it to a plugin: http://www.vim.org/scripts/script.php?script_id=3826 . 由于总体上看似不错,因此我将其提取到插件中: http : //www.vim.org/scripts/script.php ?script_id= 3826 。 This would store bookmarks only, regardless of viminfo settings, in ~/.vim_bookmarks
. 无论viminfo设置如何,这只会在~/.vim_bookmarks
存储书签。 The filename is configurable by changing g:simple_bookmarks_filename
. 可通过更改g:simple_bookmarks_filename
来配置文件名。
Since it's a full blown plugin now, you can send bug reports on the issue tracker , so if it's not working quite right, let me know. 由于它现在是功能完备的插件,因此您可以在问题跟踪器上发送错误报告,因此,如果它不能正常工作,请告诉我。
Cheers. 干杯。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.