vimscript using another file instead of .viminfo

一曲冷凌霜 提交于 2019-12-25 02:32:09

问题


I installed a vimscript written by expert in this question.

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 (e.g. mybookmarks.txt) instead of .viminfo file? Bookmarks stored in .viminfo disappear unpredictably.


回答1:


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. This would store bookmarks only, regardless of viminfo settings, in ~/.vim_bookmarks. The filename is configurable by changing 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.




回答2:


Yes. Use the 'viminfo n' option.

From :he 'viminfo':

Name of the viminfo file. The name must immediately follow the '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'. Environment variables are expanded when opening the file, not when setting the option.



来源:https://stackoverflow.com/questions/8211526/vimscript-using-another-file-instead-of-viminfo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!