From f40cb1bc702cfdb7f76d6a34fd7a679179ab9dd0 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 20 Oct 2020 20:53:19 +0200 Subject: init.vim rework --- .config/nvim/sidebars.vim | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .config/nvim/sidebars.vim (limited to '.config/nvim/sidebars.vim') diff --git a/.config/nvim/sidebars.vim b/.config/nvim/sidebars.vim new file mode 100644 index 0000000..f21cf8c --- /dev/null +++ b/.config/nvim/sidebars.vim @@ -0,0 +1,38 @@ +let g:NERDTreeWinPos = 'left' +let g:NERDTreeWinSize = 30 +let g:NERDTreeQuitOnOpen = 0 +let g:tagbar_left = 1 +let g:tagbar_width = 30 +let g:tagbar_autoclose = 0 +let g:tagbar_autofocus = 1 +let g:tagbar_sort = 0 +let g:undotree_SetFocusWhenToggle = 1 +let g:undotree_SplitWidth = 30 + +let g:sidebars = { + \ 'nerdtree': { + \ 'position': 'left', + \ 'check_win': {nr -> getwinvar(nr, '&filetype') ==# 'nerdtree'}, + \ 'open': 'NERDTree', + \ 'close': 'NERDTreeClose' + \ }, + \ 'tagbar': { + \ 'position': 'left', + \ 'check_win': {nr -> bufname(winbufnr(nr)) =~ '__Tagbar__'}, + \ 'open': 'TagbarOpen', + \ 'close': 'TagbarClose' + \ }, + \ 'undotree': { + \ 'position': 'left', + \ 'check_win': {nr -> getwinvar(nr, '&filetype') ==# 'undotree'}, + \ 'open': 'UndotreeShow', + \ 'close': 'UndotreeHide' + \ } + \ } + +noremap :spj:term:resize -10i +noremap :call sidebar#toggle('nerdtree') +noremap :make-j5 +noremap :call sidebar#toggle('tagbar') +noremap :call sidebar#toggle('undotree') +let g:startify_session_before_save = ['call sidebar#close_all()'] -- cgit v1.2.3