Fandom

Vim Tips Wiki

Bookmark files

Redirected from VimTip1490

1,624pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

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
  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
endfunction
:command! MoshBookmark :call MoshBookmark()

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

CommentsEdit

 TO DO 
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.


Also on Fandom

Random Wiki