Good afternoon,
I usually work on relatively small (less than 20,000 lines of code) projects, which are all inside the same directory, have their own Makefile, and it's pretty easy to work with.
VIM is my preferred editor, and when I open a project, I usually build the ctags list by matching with the F10 key:
map <F10> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
This allows me to move on to the definition of the / struct / etc variable by moving the cursor over the text and pressing CTRL + ] , as well as using code completion with a drop-down list through OmniCppComplete.
However, now I am working on a slightly larger project that uses LOTS structures. In addition, many of these structures have arrays of other user structures as members, so code completion is a very useful and important tool for me right now.
I have two paths that include many .C and .h files, and they can change from machine to machine. However, on each machine, we have an environment variable in our .bashrc that points to them as follows:
SDK_SRC_PLUS_HEADERS=/public/sdk THIRD_PARTY_SDK=/private/sdk
I want VIM to automatically refer to the contents of these additional paths when I try to execute code completion (via the OmniCppComplete VIM built-in function) or go to files in these places when I use CTRL + ] in VIM to go on to define the structure, function , variable, etc.
So, for both of the above paths, I cd in them and generate tags via ctags -R . Then I changed my ~/.vimrc file to include additional tag paths, for example:
tags=./tags tags+=$SDK_SRC_PLUS_HEADERS/tags tags+=$THIRD_PARTY_SDK/tags
Then I cd into my project in /home/user1/projects/test , launched VIM and hit F10 in VIM to index it. However, this does not work at all. In fact, this breaks my ability to even use tags only for the project itself (that is: CTRL + ] now does nothing).
Does anyone have any suggestions on how I can have source code completion tags and transitions between definitions using multiple source directories via environment variables?
Thank you all for your time and help!