On Jun 25, 2:50 pm, Derk <[email protected]> wrote:
>
> 2) What tips do you have from own experience when working with
> multiple files? Perhaps some comments on work approach?
>

I started using Vim with a very early version of Vim 7.1, very soon
after tabs were introduced (in 7.0). I therefore never had to figure
out how to use Vim without tabs, so I usually work with 1 tab per
file, with a file open in multiple tabs only on a transient basis. An
example of my workflow may look something like this:

* Open file1 in Vim
* Work on file1 for a while
* I need to see something in file 2, but don't need to work on file 2.
I open file2 in a split window, and close it when done.
* I need to work on file 3, I open file 3 in a new tab.
* I need to see something in file 1. I split a window to see file 1,
then close it when done.
* I need to compare a portion file 3 to its header file. I do :tab
split to open file 3 in a second tab, then :vsplit file4 to view file4
side-by-side with file 3. I make changes directly to either file as
needed in this tab.
* I notice something that affects file 1, so I switch back to the
file1 tab and make the change, then go back to what I was doing.
* I need to copy something from file 2 into file 3, so I go to my file
3 tab and split the window with file 2, do the copy, then close the
split window (eventually anyway...I may leave it open out of
laziness).
* etc.

At any given moment, I may have one file (really, one buffer) open in
several tabs at once, but most of my work is done in a single tab for
a file. In each tab, I often have 2 or 3 windows open, but rarely more
(copying back and forth between files is especially easy with split
windows rather than tabs).

I don't usually worry about whether I already have a file open in a
tab or not (there isn't any harm having it open in more than one) but
if I don't want to clutter up the tab bar I use :drop instead of :edit
(or :tab drop instead of :tabedit) and it will jump to the file if it
is already open.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to