# HG changeset patch # User Meredith Howard # Date 1571435811 18000 # Node ID 59b23772424a031f89f55d8e200ffd62b34c9ab4 # Parent 17b16f2ff839c04df425cb7e256d24c917a7cd4b No more unite-session diff --git a/.vim/autoload/vimrc.vim b/.vim/autoload/vimrc.vim --- a/.vim/autoload/vimrc.vim +++ b/.vim/autoload/vimrc.vim @@ -25,9 +25,13 @@ func! vimrc#MkNonExDir(file, buf) abort endif endfunc -func! vimrc#AutoSessionConfig() abort +func! vimrc#AutoSessionCheck() abort if strlen(v:servername) > 0 && match(v:servername, 'VIM') == -1 - exec 'UniteSessionLoad ' . tolower(v:servername) + let sessionfile = g:vimcache . "/session/" . tolower(v:servername) . ".vim" + + if filereadable(sessionfile) + execute "source " . sessionfile + endif endif endfunc diff --git a/.vimrc b/.vimrc --- a/.vimrc +++ b/.vimrc @@ -27,7 +27,6 @@ let s:filename = expand('') Plug 'Shougo/vimproc.vim' Plug 'Shougo/unite.vim' Plug 'Shougo/vimfiler.vim' - Plug 'Shougo/unite-session' Plug 'sjl/gundo.vim', {'on': 'GundoToggle'} Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} @@ -69,7 +68,6 @@ nnoremap :GundoToggle :TagbarToggle nnoremap ub :Unite buffer -nnoremap us :Unite session " let F4, :noh work as-is in insert mode imap @@ -122,10 +120,14 @@ noremap a :call vimrc#A " Commands & Aliases {{{ command! -nargs=+ CAlias call vimrc#CommandAlias() + command! Gcd call vimrc#Gcd() command! Hgcd call vimrc#Hgcd() + command! SyntaxCompleteOn setl omnifunc=syntaxcomplete#Complete +command! Mksession execute v:this_session ? ("mksession! " . v:this_session) : ("echo 'no this_session'") + command! -nargs=+ -complete=file -bar Ag call vimrc#Ag() CAlias Rg Ag @@ -216,7 +218,7 @@ set sessionoptions=buffers,curdir,localo " Enable enhanced % matching in ruby runtime macros/matchit.vim -for subdir in ['backup', 'tmp', 'undo'] +for subdir in ['backup', 'tmp', 'undo', 'session'] if !filewritable(g:vimcache . '/' . subdir) call mkdir(g:vimcache . '/' . subdir, 'p', 0700) endif @@ -258,7 +260,7 @@ augroup vimrc autocmd WinLeave * stopinsert " set and load a session based on servername - autocmd VimEnter * call vimrc#AutoSessionConfig() + autocmd VimEnter * ++nested call vimrc#AutoSessionCheck() " complement to autowriteall autocmd FocusLost * silent! wa