I use GNU Global for navigating my Java source code. It's brilliant. Global is blistering fast, having indexes with 1000s of Java files is no problem. It doesn't require any external process (unlike how e.g. malabar mode does it) and it's very easy to set up:
$ cd ~/src/my-project
$ gtags
(autoload 'gtags-mode "gtags" "" t)
(add-hook 'c-mode-common-hook
'(lambda ()
(gtags-mode 1)))
When Global is active (it'll say "Gtags" in the buffer status
bar), you can use standard tags shortcuts to jump to the
decleration of something:M-.
To go back were you were, you can press
M-*. This will "pop" the navigation stack, so if
you've navigated from:
public class CarFactory {
car.getName(); ->
class Car {
public String getName() {
super.getModel(); ->
class Vehicle {
public String getModel() {
<cursor>
M-* will take you to the previous place were you
pressedM-.. The M-. also lets you search for any method or
class you like. Try it out, it's brilliant!
To navigate BASH source code, I use the standard etags. Here, you need to do the following to set it up:
$ cd ~/src/my-bash-lib
$ find | etags -
(require 'etags) (setq tags-table-list '("/home/use/src/my-bash-lib"))
That's it. You can now use the same shortcuts as described above to fly through your BASH source code.
etags has support for many languages, not only BASH, see the
output frometags --help for a list of languages
it provides special parsing for. Others work too, so just try
creating the TAGS file as above, hitM-. in your
source code and see what hapepns :-)