New and sharper tools are always a question for me. Is it worth the time to learn a new tool, or should I just get busy with the tools I already use every day and am familiar with. Sometimes there is no way to predict. You just have to try new things. And sometimes new things don't seem better right away, it takes some time to get familiar with them and learn to use them effectively.
So, I want to add Cscope to my "bag of tricks". Just for the record, there are two other tools you might consider:
What I wish for (and what I ended up with if you persevere to the end of what is now this 3 part series) is that I can type Ctrl-\ and get the inverse lookup via Cscope. Cscope is capable of more, but adding just this one thing to Vim satisfies my desires.
What I am missing is the reverse. I cannot sit on a function definition and ask the question - "where is this called from". Cscope offers to give me that.
Just for the record, I am using the current edition of Fedora linux (Fedora 41). To generate the ctags "database" I just type "ctags -r ." at the root of a project and I am ready to go. There are at least 3 different versions of ctags and I have no idea why there are 3 and what the differences are. I once typed "ctags --version" and it told me it was "Exuberant ctags", but today I typed that and got:
Universal Ctags 6.0.0, Copyright (C) 2015-2022 Universal Ctags Team Universal Ctags is derived from Exuberant Ctags.So, Fedora moved from exuberant to universal. I never knew, and clearly it works just the same (from my point of view), so I don't care or mind.
dnf install cscopeI just try to run it. I starts, but it is not clear how to exit the program. It has remapped Ctrl-C to toggle what it calls "caseless mode". I would like it to use my vim habits (j and k to move up and down), but it wants me to use arrow keys. Perhaps this can be configured? It offers to "change strings", which worries me. I want this to be a read only tool with no ability for me to make mistakes and change anything.
You type Ctrl-D to exit.
The description of what codequery does seems rather "exuberant". They have a long list of languages they hope to support, which worries me. Perhaps it shouldn't, but they seem to be taking a big bite. Someday I will have to try it. If I wait long enough, maybe it will make it into the Fedora packages.
There is yet another project "SourceTrail". It was developed at Google (under the name Coati) starting in 2016 and made open source in 2019. The project was abandoned around 2021.
All of that is easy to understand. We see this all the time on Youtube channels, where people burn out, often because they commit themselves to doing too much. I tell people that if I am not having fun, somebody needs to be paying me -- and even then the best answer is often: "no!".
Tom's Computer Info / tom@mmto.org