vim - programatically change NERDTreeWinSize -
i change vim-plugin nerdtreewinsize variable programmatically.
i added following function vimrc
nothing happening when call function. hints?
fun! nerdtreewinsize( arg ) let g:nerdtreewinsize=a:arg endfunction command! -nargs=* ntws call nerdtreewinsize( '<args>' )
i can call function via :ntws 200
, wish nerdtreewinsize
changes 200
then.
i realized nothing happening when run let g:nerdtreewinsize=100
in vim command line.
but when add line let g:nerdtreewinsize=100
vimrc
vim adapts nerdtreewinsize
.
your code correct, , (at least version of nerdtree) re-evaluates g:nerdtreewinsize
variable when building ui. however, change not affect open nerdtree windows, new ones. so, need re-open nerdtree changes take effect, maybe via
command! -nargs=* ntws call nerdtreewinsize( '<args>' ) | nerdtree
Comments
Post a Comment