configuration - How to auto save vim session on quit and auto reload on start including split window state? -


i split vim screen in 3. 1 :vsplit , 1 :split. want these windows , files worked on saved when close vim. want these windows automatically load when start vim.

i tried install gsessions (just added file plugin folder), nothing happend. new vim don't know how configuration works.

you can per directory sessions vimrc:

fu! savesess()     execute 'call mkdir(%:p:h/.vim)'     execute 'mksession! %:p:h/.vim/session.vim' endfunction  fu! restoresess() execute 'so %:p:h/.vim/session.vim' if bufexists(1)     l in range(1, bufnr('$'))         if bufwinnr(l) == -1             exec 'sbuffer ' . l         endif     endfor endif endfunction  autocmd vimleave * call savesess() autocmd vimenter * call restoresess() 

that litter directories .vim s, can modify that. also, change sbuffer badd if don't want new windows each file , add ssop-=buffers vimrc.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -