Vim Tips Wiki
(Remove html character entities)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 4: Line 4:
 
|previous=1486
 
|previous=1486
 
|next=1491
 
|next=1491
|created=January 25, 2007
+
|created=2007
 
|complexity=basic
 
|complexity=basic
 
|author=Mosh
 
|author=Mosh
Line 12: Line 12:
 
|category2=
 
|category2=
 
}}
 
}}
I read lots of files each day, and use file <tt>~/.vims</tt> to remember the important ones.
+
I read lots of files each day, and use file <code>~/.vims</code> to remember the important ones.
   
 
<pre>
 
<pre>
Line 34: Line 34:
 
Explain when to use above function and what idea is.
 
Explain when to use above function and what idea is.
   
To use the bookmark file, open it in Vim: <tt>vim ~/.vims</tt>
+
To use the bookmark file, open it in Vim: <code>vim ~/.vims</code>
   
 
Press gF when cursor is on a filename.
 
Press gF when cursor is on a filename.

Latest revision as of 06:26, 13 July 2012

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.

Comments[]

 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.