ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'll be learning Java in a college class next semester, and I'm going to try to use Vim instead of one of the big IDEs, just because it makes it so much easier to move around.
I'm going through some steps found online to set things up to make working with Java easier, and I have a quick question about ctags.
A site suggested recursively generating tags for your source and the Java source (in the installation src directory) with "ctags -f ~/.tags -R ~/src $JAVA_HOME/src". Two problems with this... first, is there a way to automatically add tags as you code aside from making a cron job to run every so often? Second, ctags seems to regenerate the entire list every time it's run, so is there a way to make it ignore a directory that it already has complete tags for (i.e. keep generating for ~/src but only do the Java tags once)?
All I've been able to find while reading through the entire man page (and the reason why I'm posting here) is the exclusion of directories, which would eliminate it altogether instead of just not updating it more than once. My first question still stands as well: what is the common/recommended way to update tags as you code?
first, is there a way to automatically add tags as you code aside from making a cron job to run every so often?
Second, ctags seems to regenerate the entire list every time it's run, so is there a way to make it ignore a directory that it already has complete tags for (i.e. keep generating for ~/src but only do the Java tags once)?
Thanks.
1. Of course, you can run it whenever you like. I usually set up a vi keymap.
2. Well if you don't regenerate, then the java tags won't exist; as ctags creates a new file each time.
I would suggest going at it from another angle. First can VI use multiple tag files?
If so no probs. Do a static tag file and a dynamic.
If not maybe you can do as above and cat the two together into a new tag file.
some versions of gvim have a menu "tools->build tags"
It seems to call ctags. Maybe you can override the command
or if not make an alias or shell wrapper to override.
In the vim help it mentions other tag progs.
exuberant C tags and jtags, both for java.
map is quite easy. I usually map ctrl-P to do stuff.
something like
:map ^P ! ctags blah blah<return>
you need to do a ctrl-V to insert literal keys like a control-P or return
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.