Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep NERDTree from resizing project window in (g)vim?

Tags:

vim

project

I've been forcing myself to use gvim for Windows for much of my text editing needs. I'm gradually growing more comfortable with it, but one problem has been annoying me greatly.

I use the project plugin to keep a window up on the left side of my gVim screen, listing my projects. It's handy and keeps me from going into IDE withdraw. Here's an idea of what it looks like:

SO gvim/nerdtree/project ss 1

I then invoke NERDTree on the right side with <Leader>][:

SO gvim/nerdtree/project ss 2

I then navigate through NERDTree to find whatever I was looking for, and dismiss NERDTree with <Leader>][. This makes the NERDTree window go away, but rather than put the main window back to the size it was, it grows the project window instead:

SO gvim/nerdtree/project ss 3

Right now I manually resize the project window, but that really interrupts the flow I'm trying to achieve with vim.

I'm using gvim 7.2, NERDTree 3.1.1, and project 1.4.1. Anyone have any ideas how to fix this?

UPDATE: Based on Steve K's answer I've figured out the solution. When you run the :Project command and it creates the project window, the project window is the active one. So I just added set winfixwidth to my .vimrc after :Project, and that solved the problem. Now I can show and hide NERDtree to my heart's content with no annoying window resizing.

like image 321
anelson Avatar asked Sep 03 '09 04:09

anelson


1 Answers

With the cursor inside the left most project window, do

:set winfixwidth

I think that will do it for you.

like image 96
Steve K Avatar answered Nov 12 '22 14:11

Steve K