You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
862 B
VimL
31 lines
862 B
VimL
Plug 'preservim/nerdtree', { 'tag': '6.10.16' }
|
|
|
|
let g:NERDTreeDirArrowExpandable = '▸'
|
|
let g:NERDTreeDirArrowCollapsible = '▾'
|
|
|
|
let NERDTreeDirArrows=1
|
|
|
|
map <leader>nt :NERDTreeToggle<CR>
|
|
|
|
" Close nerdtree if it's the last buffer
|
|
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree()
|
|
\ | quit
|
|
\ | endif
|
|
|
|
" Mirror nerdtree in each tab
|
|
autocmd BufWinEnter * silent NERDTreeMirror
|
|
|
|
" check if reading from stdin
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
|
|
" open nerdtree if no args in passed to vim
|
|
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | wincmd p | endif
|
|
|
|
" open nerdtree if vim opens to a directory
|
|
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in')
|
|
\ | execute 'NERDTree' argv()[0]
|
|
\ | wincmd p
|
|
\ | enew
|
|
\ | execute 'cd '.argv()[0]
|
|
\ | endif
|