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

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:
I then invoke NERDTree on the right side with <Leader>][:
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:
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.

With the cursor inside the left most project window, do
:set winfixwidth
I think that will do it for you.

Related

Disable Quickfix from opening a new pane

When I'm developing in Go, vim-go uses quickfix to alert me to errors. It's great and everything, but occasionally it will pop up a window with the source and the exact line of the error. Many times this squashes all my panes and I almost have to restart vim to fix everything. It's very annoying.
Is there a way I can disable quickfix from doing this? The pane it opens to display the errors it found (which look like compiling/linting errors) is fine, but the opening of the actual source is obnoxious.
Thank you!

Switch between panes in VIM for codepen.io?

When using vim mode in codepen.io, how do you switch between panes as ctrl+w+w doesn't work as it closes the window tab. What other codepen.io specific key bindings are there?
It'd probably be better to ask the project maintainers, but it does not seem like it's possible. There's a whole page on their blog post that hints as to why. It also has a link to the project providing that functionality.

Mouse scrolling in vim scrolls terminal window

I am just getting started using Vim and came across :set mouse=a which I've found really useful for navigating a file, however for some reason when I try and scroll now it scrolls the whole terminal window and not just the vim window.
Then I scroll up and can see the terminal outside Vim
Any ideas on how to fix this? I've tried resetting mouse= and exiting and re entering vim.
The problem was that I had accidentally disabled Allow Mouse Reporting in error.
Checking Menu > View > Allow Mouse Reporting or Cmd + R has fixed it!
I think the cheap answer to your question is that you should be navigating through files in vim using motion commands, Ctrl + d, etc. It might seem slow at first, but it really becomes more natural down the line.
That said, if you are on Mac and using Terminal, you might need to hold the Fn to temporarily disable mouse support. (Check this out for reference: OS X Terminal Mouse Support
Also, you can always try MacVim, which supports mouse scrolling out of the box.
If neither of those solutions work for you, some more information would be helpful for troubleshooting, e.g., your operating system, recent changes to your vimrc, etc.

Prevent opening files inside NERDTree or MiniBuffExplorer windows in Vim

I find myself opening files inside the wrong window in Vim — sometimes the NERDTree or MiniBuffExplorer — and it’s really throwing me off.
I’m sure it’s happening because my cursor is mistakenly focused inside one of these windows, but is there anything I can add to my .vimrc file to prevent this from happening?
I finally found the solution to this annoyance in the MiniBufExplorer source comments. It looks like this feature has been available since version 6.2.8 (release 2004-06-07):
If you use other explorers like TagList you can (As of 6.2.8) put:
let g:miniBufExplModSelTarget = 1
into your .vimrc in order to force MBE to try to place selected
buffers into a window that does not have a nonmodifiable buffer.
The upshot of this should be that if you go into MBE and select
a buffer, the buffer should not show up in a window that is
hosting an explorer.
It's possibly related to the setting of mousefocus. From :help mousefocus
The window that the mouse pointer is
on is automatically activated. When
changing the window layout or window
focus in another way, the mouse
pointer is moved to the window with
keyboard focus. Off is the default
because it makes using the pull down
menus a little goofy, as a pointer
transit may activate a window
unintentionally.

VIM VTreeExplorer plugin (IDE style browsing for VIM)

I've looked at a number of the IDE style file explorer / management plugins for VIM. The most popular one seems to be Project, but I've never got on well with it. Specifically, having to always create a .project file for the files you want to browse, and that changes to that file hierarchy outside of VIM are not picked up.
I stumbled across the VTreeExplorer plugin and I really like the way it works. I'm trying to work out how I can make it work in a more IDE style way, for instance, to always open vertically down the full length of my window, and once I've opened a file from it, it automatically hides the VTreeExplorer buffer again? Also, ideally it wouldn't show up when I use :bn or a buffer explorer to tab through each file buffer.
Any recommendations would be appreciated. Thanks!
What about NERDTree? It is really good, one of the best file tree plugin for vim available.

Resources