tags:

views:

156

answers:

4

Hi there,

I used VIM whole my life but recently I am a bit tired of it because I am lost in buffers, windows, and tabs when working simultaneously with 20 files or so in a big project (with 500k LOC, and hundreds files).

Whenever i do :make, :grep etc new buffers are jumping out in the current window. The same happens for the tags. At some point this starts to be very confusing because I really have to focus where things are in a VIM.

What are a proven and easy ways to control this behavior?

A: 

As a longtime vim user, it pains me to say it, but--it might be time for you to graduate to a full-fledged IDE. You can still use vim as your editor in most cases, but the IDE will handle file management and navigation for you, and probably will simplify your make and grep workflows (e.g., structural search beats the pants off of grep). What language are you working on?

Alex Feinman
The project includes several languages, C++/C, (90%), VHDL, TCL as well as some DSL.I work remotely and vim is a great for that (but I also use nomachine). Few years ago i tried Eclipse, CodeBlocks, and recently XCode but soon afterwards I jumped back to vim.
name
+1  A: 

Run multiple vims. I use "konsole" on my Linux machine. It allows me to open many tabbed linux terminal sessions in one window. I can double click the tabs to name them, e.g. "models", "views", "controllers", etc. In each of these tabbed linux terminals, I'll have a vim process running that has usually 2 or 3 files open at a time. Another option is to find and IDE that has Vim mode, so you can still use most of your key commands.

Tim
+1  A: 

I tested out Eclim http://eclim.org/ a while ago for a friend. Basically, it lets you run Eclipse in a headless mode while using vim for editing and so on. With the extension, it allows Vim to draw on all the strengths of both worlds, adding for instance Eclipse's project tree to your favourite editor!

Installation was a bit daunting back then, but once I had it up and running, it was really smooth and quite a brilliant solution. Try it out, I'm pretty sure you won't be disappointed. And the installation is probably easier now. :)

Oh, I should also mention that there are several Eclim-setups. You can have headless Eclipse with vim as your primary interface (as I first mentioned), you can have a headed Eclipse and Vim, so that you can easily switch back and forth (in the same project no less), or you can have Vim integrated into Eclipse itself.

Sarah
this looks really interesting and I definitively should give a try. thanks.
name
+2  A: 
  • Use :hide to get rid of all windows unless you really need them open.

  • I'm not sure why tags are creating a new window for you, CTRL+] should re-use the current window.

  • nnoremap + 4<C-W>+ and nnoremap - 4<C-W>- make it much easier to resize windows, along with the standard <C-W>_ and <C-W>|.

  • Get a 22" monitor (minimum) and use :vsplit to show files side by side. I find this is even more important than having two smaller monitors.

  • Use <C-W>L, <C-W>H etc to move windows around. Don't forget :tab sp to open the current file (or a new one) in a new tab.

  • :map <LEFT> <C-W>h and :map <RIGHT> <C-W>l, etc make it much easier to move between windows. :map <C-LEFT> :tabprev<CR> and :map <C-RIGHT> :tabnext<CR> make it much easier to move between tabs.

And finally, if you need to have 20 files open regularly, this could be a sign that your code is poorly organized. If possible, features should be contained within a single file, then you just need to focus work on one feature at a time.

too much php
Unfortunately there is nothing new in here that I wouldn't know. I guess the problem is that my project is really huge one and just working with so many files and things at the same time makes it a problem itself and it's not a vim problem.
name