On large projects, there might be many definitions over many different files and folders for a given symbol. Usually the one you want is the one that is unique to the local area you are working in.
e.g. if there is a
and you are editing a file in
you probably want the definition under
I used to use ctags, and created tags files in nested folders depending on which folders I worked on frequently. I set up the
tags= variable in
.vimrc to try to find a tags file as deep in the directory structure that I was in as possible, and then working its way up to the top of the project if necessary, and this worked really well.
I'm trying to use cscope now, and it's not working as well. I use the standard
cscope_maps.vim with minor changes. So in my large project, I'm getting many many hits for some definitions. I have to look through them all and visually select the one in the folder nearest to me, which is slow. In some cases it's really even more obvious than my example above - I obviously want the one near me in the tree compared to having to go up 6 directory levels and descend again.
Is there any way to tell cscope or Vim to give me the one that is closer to me in the directory tree?