diff --git a/.vimrc b/.vimrc index 6c171b2..ffd9e00 100644 --- a/.vimrc +++ b/.vimrc @@ -37,9 +37,10 @@ inoremap > strpart(getline('.'), col('.')-1, 1) == ">" ? "\" : ">" " Tab navigation " new tab and move to previous window (NERDTree if open) -nmap :tabnew :wincmd p +nmap :tabnew :wincmd h nmap :tabprev nmap :tabnext +nmap :tabclose " Resize windows with arrow keys nmap :res -1 @@ -63,6 +64,9 @@ if empty(glob(data_dir . '/autoload/plug.vim')) autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif +" Open the existing NERDTree on each new tab +autocmd BufWinEnter * if &buftype != 'quickfix' && getcmdwintype() == '' | silent NERDTreeMirror | endif + " Shortcut for JSON formatting via jq if executable('jq') command JQ %!jq . @@ -77,9 +81,6 @@ Plug 'pearofducks/ansible-vim' " NERDtree Plug 'preservim/nerdtree' -" One NERDtree for all tabs -Plug 'jistr/vim-nerdtree-tabs' - " Git plugin for NERDtree Plug 'Xuyuanp/nerdtree-git-plugin' @@ -138,7 +139,7 @@ call plug#end() " Set alias command for toggeling nerd tree -command NT NERDTreeTabsToggle +command NT NERDTree " special configuration: