Jul 152010
 

I finally got tired of lack specifiers in “git grep” and the cscope ncurses interface. I spent a few minutes and setup the vim cscope plugin using this mighty fine tutorial:

http://cscope.sourceforge.net/cscope_vim_tutorial.html

The one gotcha I ran into was having to disable my vim setting that automatically changed the working directory to that of the open file – it broke the cscope plugin relative filenames.

" automatically switch the cwd to that of the file in the buffer
" This breaks cscope plugin
" autocmd BufEnter * :cd %:p:h

Very, VERY VEERRRYYY nice. Now if only I could get a full call graph out of it…

  2 Responses to “From the Why-didn’t-I-do-this-before department (vim+cscope)”

  1. I went to google to find information on how git and cscope might play together and there on my google homepage in the reader box was this article. Nice timing.

    It is nice that it is all tied in with vim, but it still feels a little clunky. I like the cscope interface better, but I get the feeling that in order to embed that kind of crap in your editor, you have to use emacs. :)

  2. @Bryan: I used emacs for a while in college, but eventually decided vim was more my style. I like one tool everywhere, and with as much remote system work I do, it’s rare that I won’t have vim installed.

    @Vernon: you don’t like “:cs f g” ? Seems perfectly intuitive to me, maybe you should use Emacs ;-)

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>