Thread: gvim open question

  1. #1
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937

    gvim open question

    I have so far been unable to find an answer to this problem in documentation or this board.

    In gvim, I like to have foo.h split vertically with foo.cpp . I can imagine a shell script (or even a small c program) doing this for me, with every matching pair in a directory split vertically, in their own tab. However, I don't know how to do it. It seems -O opens vertically split, and -p opens in separate tabs, but I can't see how to group them.

    Any ideas?

    Thanks.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by CodeMonkey View Post
    In gvim, I like to have foo.h split vertically with foo.cpp .
    I do that a lot too, but I prefer a horizontal split.

    I can imagine a shell script (or even a small c program) doing this for me, with every matching pair in a directory split vertically, in their own tab.
    You want to source a vim script. I sometimes put these in build directories so it's included when I tarball or git the project. Eg:

    :e /home/C++/project/main.cpp
    :split /home/C++/project/main.h
    :tabnew /home/C++/project/someclass.cpp
    :split /home/C++/project/someclass.h
    Save that as "/home/C++/project/VIM" or something. Then we you want to work on it, use this in command mode:

    :source /home/C++/project/VIM
    Last edited by MK27; 09-21-2011 at 07:08 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937
    Thanks, that's the trick.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help set gvim bash
    By glo in forum Tech Board
    Replies: 3
    Last Post: 04-04-2008, 07:44 AM
  2. Gvim stopped auto indenting
    By ICool in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 09-26-2007, 12:19 PM
  3. BorlandC++ 5.5 + gvim
    By milkolate in forum C++ Programming
    Replies: 7
    Last Post: 06-23-2005, 06:43 PM
  4. Open GL Question
    By lrusso in forum C++ Programming
    Replies: 2
    Last Post: 08-01-2004, 11:49 PM
  5. gVim 6.2 Backup Files
    By Padawan in forum Tech Board
    Replies: 2
    Last Post: 04-06-2004, 06:05 PM