简体   繁体   中英

vimscript using another file instead of .viminfo

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM