Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>So it turns out that marks are not stored in the <a href="http://vimdoc.sourceforge.net/htmldoc/usr_21.html#21.4" rel="nofollow noreferrer">session</a>, but are stored in the viminfo file! So I used the code from your vimrc as a basis and the code found at the bottom of the section on sessions in the <a href="http://vimdoc.sourceforge.net/htmldoc/usr_21.html#21.4" rel="nofollow noreferrer">vim help files</a> to create a function that will allow me to save save the session and viminfo file. Creating basic project management that works great for me!</p> <p>Here is the code I ended up with.</p> <pre><code>if version &gt;= 700 " localoptions has to be here: " for some reason, new session loading code fails to set filetype of files in session set sessionoptions=blank,tabpages,folds,localoptions,curdir,resize,winsize,winpos endif command! -nargs=1 Project :call LoadProject('&lt;args&gt;') command! -nargs=+ SaveProject :call SaveProject('&lt;args&gt;') let s:projectloaded = 0 let s:loadingproject = 0 let s:projectname = '' function! LoadProject(name) let s:projectloaded = 1 let s:projectname = a:name exe "source ~/vimfiles/projects/".a:name.".vim" exe "rviminfo! ~/vimfiles/projects/".a:name.".viminfo" endfunction function! SaveProject(name) if a:name ==# '' if s:projectloaded == 1 let pname = s:projectname endif else let pname = a:name endif if pname !=# '' let s:projectloaded = 0 let s:projectname = '' exe "mksession! ~\\vimfiles\\projects\\".pname.".vim" exe "wviminfo! ~\\vimfiles\\projects\\".pname.".viminfo" endif endfunction autocmd VimLeave * call SaveProject() </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload