I have a multi-file navigation system in a huge code base, and I want to improve / fix the flaw that it currently has:
My shell is preconfigured to open at the root of my code base - allows you to call it Dev /. During synchronization / code creation, I have a script that automatically saves the relative path for all .h and .c files in a single file that cscope will use (lets call it cscope.files).
As soon as I synchronize, this file is updated - and then I can open any file I want in vim using the following command from Dev /:
vif "part of file name",
Where
vif: aliased to vi `grep !:1 cscope.files`
If I give part of the file name long enough to uniquely identify it, I will immediately open it in vim.
Now the disadvantage of this approach is that when I have already opened one file and moved to another file without exiting vim, the only way to do this is
:!vif *file2*
This spawns a new shell and then opens the file in vim running there. As a result, I cannot switch between the two files (using Ctrl- ^). I can not find a solution that:
a) Allows me to open any file from Dev / instantly
b) Allows me to open any other file inside vim (as soon as I opened an existing file) in the same shell so that 2 vim sessions know about each other (I can jump between 2 using Ctrl- ^)
I know this is a long question (as one from Google it :)), but I'm sure the solution is simple and obvious for someone more experienced in vim !!
Let me know if any part of the question is fuzzy, and I will clarify it ...
UPDATE: I eventually went to the cscope path after setting up with a shortcut (since using gf on cscope.files still prevented me from switching between the two source files). See VIM 7 and cscope: Using "cscope find f" inside the keyboard display to switch between files for the shortcut.