Start with NERDTreeFind; Better resize

This commit is contained in:
Xamora 2024-01-19 18:14:45 +01:00
parent 0675055e49
commit 42f35e60ec

View file

@ -20,7 +20,6 @@ Plug 'https://github.com/vim-scripts/gmlua.vim'
" Utility
Plug 'https://github.com/vim-airline/vim-airline'
Plug 'https://github.com/preservim/nerdtree'
Plug 'https://github.com/baopham/vim-nerdtree-unfocus' "Add Unfocus command
Plug 'https://github.com/jistr/vim-nerdtree-tabs' "Other plugin for NerdTree
Plug 'http://github.com/tpope/vim-surround'
Plug 'https://github.com/tpope/vim-commentary'
@ -61,7 +60,7 @@ call plug#end()
let g:NERDTreeDefaultSize = 20
let g:NERDTreeWinSize=g:NERDTreeDefaultSize
" Start NERDTree and put the cursor back in the other window.
autocmd VimEnter * NERDTree | wincmd p
autocmd VimEnter * NERDTreeFind | wincmd p
function! IsNerdTreeEnabled()
return exists('t:NERDTreeBufName') && bufwinnr(t:NERDTreeBufName) != -1
@ -75,10 +74,11 @@ call plug#end()
" Set
function! SetNERDTreeSize(value)
if exists("g:NERDTree") && g:NERDTree.IsOpen()
execute 'let g:NERDTreeWinSize = ' . (a:value)
execute 'NERDTree'
let g:NERDTreeWinSize = a:value
NERDTree
wincmd p
NERDTreeFind
wincmd p
execute 'NERDTreeFind'
endif
endfunction