3

I am using Vim with Vundle and I just changed a plugin specific setting in my .vimrc:

let g:NERDTreeWinSize = 60

How do I reload the plugin to pick up this setting(s) without restarting vim?

7

Most plugins directly use the configuration variables, so it suffices to apply the variable setting to the current Vim session, and then re-trigger the plugin.


For the first, you can either re-source your entire ~/.vimrc (if it's clean, and you avoid re-defining autocmds twice):

:source ~/.vimrc

(You can abbreviate that as :so % if you're currently editing it.) Or you just selectively execute the changed line, e.g. via:

yy:@"

For NERD_tree and this particular config, retriggering can be done via:

  1. closing and reopening NERD_tree
  2. zooming the NERD_tree window in and out
3
  • How does one "zoom" in and out of a window (this is not the same as ctrl+w+w)? Sep 24 '14 at 12:45
  • 1
    See :h NERDTree-A; this expands the sidebar window (for long filenames / deep trees). Sep 24 '14 at 12:53
  • Short form of :source ~/.vimrc is :so ~/.vimrc. If you are currently editing ~/.vimrc you can just run :so %. Sep 11 '19 at 18:36
0

I figured out that a restarting the plugin (in this case :NERDTree) with the basic start command was enough hence this was my solution:

Edit .vimrc

let g:NERDTreeWinSize = 60

Save .vimrc

:w

Reload .vimrc as source

:source %

Run :NERDTree

:NERDTree

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.