Hi,

I started using vim a couple of weeks ago, and although I find it an
amazing editor, I'm still struggling with things that seem to be "common
practice" in the vim world but are not so obvious for people like me who
have always worked with IDEs.

Therefore my questions:

a) I'm working on a project where the C source files are in ./src and
the headers in ./inc. I have created a tags file under every one of the
two folders. I normally work in ./src, and my tags entry in .vimrc is
set to ./tags ../inc/tags. However, when I open a *.h file for editing
in ./inc and I :cd to the ./inc folder, whenever I try to jump to a tag
in the *.h file, vim does not recognise the tag. What would be the best
way to solve this? I know I can create a tags file at the top directory,
but then I cannot use the "Build tags in the current directory tree"
menu entry, since it only works for the current directory (which is
normally ./src in my case)

What I really mean is, what is the standard way of working with tags,
where are the tag files normally placed?

b) Is there a way I can tell vimgrep to always look for the given
pattern at some standard location? I usually invoke vimgrep as
'vimgrep /pattern/ *.c ../inc/*.h', and I'd like to know if there is a
way to specify '*.c ../inc/*.h' to be the default files in which to look
for the pattern, so I only have to type 'vimgrep /pattern/'.

Many thanks in advance.


Reply via email to