NERDTree plugin side bar width

1,983 views
Skip to first unread message

jailed

unread,
Mar 15, 2011, 9:49:04 PM3/15/11
to v...@vim.org
Hi all,

I'm using the nerdtree plugin. I would like to know if we can change the
width of the sidebar which shows the contents of the root directory (the
NerdTree), either make it more wider or less wider. If so please let me know
how this can be accomplished.

Thank you.

--
View this message in context: http://vim.1045645.n5.nabble.com/NERDTree-plugin-side-bar-width-tp3747483p3747483.html
Sent from the Vim - General mailing list archive at Nabble.com.

Jürgen Krämer

unread,
Mar 16, 2011, 3:09:15 AM3/16/11
to vim...@googlegroups.com

Hi,

jailed wrote:
>
> I figured it out. There is a line (:91) in the NERD_tree.vim file
> call s:initVariable("g:NERDTreeWinSize", 31)
> I changed this according to the value I needed. Not sure if this is a good
> way but worked for me.

you should better not modify the script, because your changes will get
lost when you get an update.

The function s:initVariable() is used by NERDTree to initialize a global
variable if it does not already exist. So the better way to set a new
width is to put something like

let g:NERDTreeWinSize = 40

in your ~/.vimrc.

Regards,
J�rgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

jailed

unread,
Mar 15, 2011, 10:19:18 PM3/15/11
to v...@vim.org
Hi
I figured it out. There is a line (:91) in the NERD_tree.vim file
call s:initVariable("g:NERDTreeWinSize", 31)
I changed this according to the value I needed. Not sure if this is a good
way but worked for me.

Thank you.

--
View this message in context: http://vim.1045645.n5.nabble.com/NERDTree-plugin-side-bar-width-tp3747483p3749358.html

Vladislav Rovda

unread,
Mar 16, 2011, 4:09:01 AM3/16/11
to vim...@googlegroups.com
Also you can use shift + A to zoom (maximize - minimize) NERD tree
window

jailed

unread,
Mar 17, 2011, 12:10:39 PM3/17/11
to v...@vim.org

Jürgen Krämer-4 wrote:
>
> let g:NERDTreeWinSize = 40
>

I think this is a better way of doing. I could not figure it out earlier.
Thanks for letting me know.


Vladislav Rovda wrote:
>
> Also you can use shift + A to zoom (maximize - minimize) NERD tree window
>

Thats one way to do it, I tried with Ctrl-W < to reduce the width, but using
the shortcut every time, I'm too lazy for that.


--
View this message in context: http://vim.1045645.n5.nabble.com/NERDTree-plugin-side-bar-width-tp3747483p3885928.html

Reply all
Reply to author
Forward
0 new messages