Vim Tips Wiki

Bookmark files

Revision as of 06:26, July 13, 2012 by JohnBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
1,616pages on
this wiki
Tip 1490 Printable Monobook Previous Next

created 2007 · complexity basic · author Mosh · version n/a

I read lots of files each day, and use file ~/.vims to remember the important ones.

function! MoshBookmark()
  redir >> ~/.vims
  echo strftime("%Y-%b-%d %a %H:%M")
  echo "cd ". $PWD
  echo "vim ". expand("%:p").':'.line('.')
  echo ' word='.expand("<cword>")
  echo ' cline='.getline('.')
  redir END
:command! MoshBookmark :call MoshBookmark()

Vim's builtin viminfo loses bookmarks during multiple sessions of Vim, hence this solution is required.


Explain when to use above function and what idea is.

To use the bookmark file, open it in Vim: vim ~/.vims

Press gF when cursor is on a filename.

Around Wikia's network

Random Wiki