diff --git a/.vimrc b/.vimrc index f80b684..f56083e 100644 --- a/.vimrc +++ b/.vimrc @@ -15,7 +15,7 @@ call plug#begin() Plug 'Shougo/deoplete.nvim' Plug 'roxma/nvim-yarp' Plug 'roxma/vim-hug-neovim-rpc' - Plug 'tbodt/deoplete-tabnine', { 'do': './install.sh' } + "Plug 'tbodt/deoplete-tabnine', { 'do': './install.sh' } Plug 'jpalardy/vim-slime' Plug 'autozimu/LanguageClient-neovim', { \ 'branch': 'next', @@ -33,12 +33,46 @@ let g:LanguageClient_serverCommands = { let g:deoplete#enable_at_startup = 1 set tags+=./.tags - + + +" Session management + +set switchbuf=useopen,usetab + + +fu! SaveSess() + execute 'mksession! ' . getcwd() . '/.session.vim' +endfunction + +fu! RestoreSess() +if filereadable(getcwd() . '/.session.vim') + let initial_args = argv() + execute 'so ' . getcwd() . '/.session.vim' + for file in initial_args + if bufloaded(file) != 1 + execute 'tabnew ' . getcwd() . '/' . file + else + execute 'sb ' . file + endif + endfor +endif +endfunction + +" Save session on quitting Vim +autocmd VimLeave * NERDTreeTabsClose +autocmd VimLeave * call SaveSess() + +" Restore session on starting Vim +autocmd VimEnter * nested call RestoreSess() + "---------------------- " move between tabs - nnoremap :tabprevious - nnoremap :tabnext +nnoremap :tabprevious +nnoremap :tabnext + + + map :NERDTreeMirrorToggle " prevent mouse vanishing set nomousehide