Skip to content

Instantly share code, notes, and snippets.

@fum1h1ro
Last active January 31, 2020 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fum1h1ro/186f215e26b85e50f8c3406b177fa093 to your computer and use it in GitHub Desktop.
Save fum1h1ro/186f215e26b85e50f8c3406b177fa093 to your computer and use it in GitHub Desktop.
auto session
let g:autosession_file = getcwd().'/.vimsession'
function! AutoSession_Create()
if getftype(g:autosession_file) == ''
exec "mks!" g:autosession_file
endif
endfunction
function! AutoSession_Restore()
if getftype(g:autosession_file) != ''
exec "so" g:autosession_file
endif
endfunction
function! AutoSession_Save()
if getftype(g:autosession_file) != ''
exec "mks!" g:autosession_file
endif
endfunction
call AutoSession_Restore()
augroup session-autosave
au!
"autocmd VimEnter * call g:AutoSession_Restore()
autocmd VimLeavePre * call g:AutoSession_Save()
augroup END
command! AutoSessionCreate call g:AutoSession_Create()
@fum1h1ro
Copy link
Author

よくわからんけど、autocmdで読み込むと、シンタックスハイライトが消える

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment