Improve NERDTree

This commit is contained in:
Augusto Gunsch 2021-08-22 17:22:04 -03:00
parent 1851e1ed91
commit 978862bb97
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 14 additions and 1 deletions

View File

@ -22,7 +22,7 @@ nnoremap _ ddkP
let mapleader = " "
let maplocalleader = ","
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>ev :tabnew $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
nnoremap <C-s> :%s//gc<left><left><left>
nnoremap <C-w>t :tabnew<cr>
@ -60,6 +60,19 @@ Plug 'tpope/vim-fugitive'
call plug#end()
nnoremap <C-n> :NERDTreeToggle<CR>
augroup nerdtree
autocmd FileType c silent if !exists('b:NERDTree') | silent NERDTree | endif
augroup END
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" Open the existing NERDTree on each new tab.
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
let g:airline_theme = "powerlineish"
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1