VIM is now an IDE

This commit is contained in:
Daan Vanoverloop 2019-10-17 11:44:48 +02:00
parent a8916b3694
commit 016e54ff34
1 changed files with 38 additions and 4 deletions

36
.vimrc
View File

@ -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',
@ -34,12 +34,46 @@ 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 <A-Left> :tabprevious<CR>
nnoremap <A-Right> :tabnext<CR>
map <C-n> :NERDTreeMirrorToggle<CR>
" prevent mouse vanishing
set nomousehide