Search code examples
vimnerdtree

How to stop gvim window from resizing when using NERDTreeToggle?


When using gVim snapped to one of the corners of my Windows 8.1 desktop (Windows Key + Left / Right key), if I invoke NERDTreeToggle command, the gVim window unsnaps from the corner and redraws itself near the centre of the screen.

I am having to snap gVim window back into it's corner every time I use NERDTreeToggle command.

How to stop gVim from detaching from the corner of the screen when using NERDTree plugin?


Solution

  • The NERDTree side pane opens a vertical split, and by default, Vim will then display a second vertical scrollbar on the left side. This additional scrollbar increases Vim's window width, and that prompts Windows to shuffle around your window layout. You can avoid this via

    :set guioptions-=L
    

    See :help go-L.