3 ms·
Upvote for cscope mention. I prefer cscope -Rqk. I run cscope on the zeroth window of a tmux/screen session with a $CSCOPE_EDITOR program that's a script that
by cryptonector 9y ago
Upvote for cscope mention.
I prefer cscope -Rqk. I run cscope on the zeroth window of a tmux/screen session with a $CSCOPE_EDITOR program that's a script that starts the real $EDITOR in a new window in the same session (with an appropriate window name) and in the background so that cscope gets control back immediately. This allows me to use cscope to drive large code investigations very easily.
- mmjaa 9y agoSounds cool. I use it in vim as a 'grok this C/C++/Lua/Textfiles' utility, pretty much every day. grep too of course, and there are times when you just wanna ack, but for full grok, cscope is cool however you do it.
- cryptonector 9y agoI have a shell function that generates shell functions that do find | xargs ... patterns. Thus I have 'fsg' == find source grep -- that is, find with -name arguments matching source | xargs grep ..., and fseg (find source egrep) and fmg (find make stuff grep). These functions take all non-option looking arguments and use them as directory arguments for find, then all remaining arguments are passed to grep, so I get to write: $ fsg foo bar -w foo which translates into something like: find foo bar \( -name '*.[chylm]' -o -name ... \) -print0 | xargs -0 grep "$@" Still, cscope is fantastic, and the first tool I reach for.