5 ms·
Ooh, grep is definitely useful, no question .. but cscope, in the right hands, can be far, far more productive .. try it and see!
by mmjaa 9y ago
Ooh, grep is definitely useful, no question .. but cscope, in the right hands, can be far, far more productive .. try it and see!
- cryptonector 9y agocscope is a sine qua non of C (and even C++ and Java) development. Of course, with OOP languages a dumb lexical indexer is not that useful (this applies to OpenGrok and many others too) -- if you're looking for calls to the getName() method of a particular class (and sub-classes) in a huge codebase then you'll be in for a lot of pain. But for C cscope is absolutely fantastic and much much better than etags/ctags.
- bch 9y agoI use cscope in conjunction w ctags. cscope (which will launch an editor, appropriately ) for a top-level overview/dive, and ctags (from w/i my vi instance, whether vi was launched from cscope or not) when I’m zeroing-in on a problem and can chase down thoughts and maintain my way back out because navigation is pushing/popping on a stack. No need for either/or; use them both.
- mmjaa 9y agoI find that cscope integration in vim supersedes any need for ctags. For why is ctags not just a subset?
- bch 9y agoI'm a BSD nvi user, so no vim for me. I do apparently have access to cscope database from w/i nvi, but my finger muscle memory wrt (ex)ctags support gets me a long way (perhaps I could do better w/ cscope? Something to look into.) I'm not sure how to parse your last question -- rephrase ?
- cryptonector 9y agoYou would do better with cscope. Just try it. If you want I'll post the $CSCOPE_EDITOR wrapper script I use.
- bch 9y agoI did work out the (ex) usage for in-editor cscope in nvi (for the curious, in nvi(1) after building the cscope db: :cscope add ./cscope.out :cscope find g myfunc :cscope find e [Ss]ome.expres*ion Anyway, otherwise - yes, interested to see your $EDITOR script.
- cryptonector 9y agohttps://github.com/cryptonector/cscope_editor https://github.com/cryptonector/cscope_editor
- mmjaa 9y agoLast question: ctags is a sub-set of cscope, in that cscope does all that ctags does, and more. Anyway, I concur with your reasoning: bsd vi and muscle memory. Works for me!
- cryptonector 9y agoI find it easier to cut-n-paste (with tmux) the symbol I want to chase down, pasting it into cscope. The reason this is better is that ctags doesn't do what I want. I may want to see functions called by some symbol (ctags no help), functions calling that symbol (two ctags operations required), or assignments to a variable (ctags no help) or even just a full-text search (again, ctags no help). I don't need $EDITOR cscope integration because I have an easier time tracking appropriately-titled tmux windows than I do tracking $EDITOR buffers (not least because tmux windows are more general!), so I really want a new tmux window with a new $EDITOR instance. Thus the cut-n-paste approach, while it requires a few more keystrokes than I might like, works best. I could always do my own integration that uses tmux to programmatically write the symbol I want to the cscope window, but I don't feel the need.