Question: After generating a tags file with `exuberant-ctags` I can jump from a function call to its declaration with `<C-]>` which is pretty convenient.

My question is how to do it in the other way? When my cursor is on the definition of a function, how can I go to the lines where the function is called?

When I look to the file generated by ctags I only see informations related to the location of the definition and not of the calls, does it means that I can't do that, that Vim as a clever workaround or that I need to use something else than `exuberant-ctags`?

Answer: 
You could use Vim's **grep** command to search all the files in your project:

```
:grep! "\<<cword>\>" . -r
:copen

```

Let's put that in a keybind:

```
nnoremap <F4> :grep! "\<<cword>\>" . -r<CR>:copen<CR>

```

I find this one-key project-wide search invaluable when I am exploring a large unfamiliar codebase.

`\<` and `\>` are regexp sequences which indicate the start and end of a word, so you won't get partial matches. (The `-w` option to grep might be another way to achieve this.)

However, this is an **unintelligent search**, so it can produce false-positives if the same word appears in unrelated contexts.

---

Truthfully, I use my own [modified version of the grep.vim plugin](https://github.com/joeytwiddle/grep.vim) instead. This is slightly friendlier to use:

* It lets you edit the search pattern, and also the grep commandline (so you can target specific folders like `src/ lib/` instead of `.`) and remembers the changes.
* I added support for Google's [**csearch**](https://github.com/google/codesearch). This can be much faster than grep (on HDDs) because it builds an index of words rather than scanning each file every time. Notably, csearch uses a slightly different regexp standard, so `\b` must be used instead of `\<` and `\>`.

I configure it and exclude some standard files [like this](https://github.com/joeytwiddle/rc_files/blob/5e67249194407360d12f38e7f5b2f085937fd286/.vimrc#L147-L170).

For fast access, I create [two keybinds](https://github.com/joeytwiddle/rc_files/blob/5e67249194407360d12f38e7f5b2f085937fd286/.vim/plugin/joeykeymap.vim#L557-L592). `F3` lets me edit the commandline, `F4` uses the previously configured commandline without any extra keystrokes. The mechanism is pretty ugly, and could use some cleanup, but it has served me well.
I always use two tools together: Exuberant Ctags, same as you, plus [GNU ID Utils](https://www.gnu.org/software/idutils/). This project provides the `mkid` utility to build an `ID` database for fast querying with `lid`.

The Vim-side setup is this line in `.vimrc`:

```
:set grepprg=lid\ --word\ --result=grep\ '$*'\ \\\|\ sort\ -n\ -t\ :\ -k\ 2

```

The sorting step is in there because `lid` has a way of putting out matches in a funny order that jumps around in a file rather than being ordered by line number.

I make two more definitions in connections with this:

```
:nmap K "_y:execute count ? ( ":!man " . count . " " . expand("<cword>") ) : ( ":grep \\<" . expand("<cword>") . "\\>")^M
:vmap K "zy:execute ":grep " . getreg("z")^M

```

This gives me a `K` shortcut for searching for occurrences of identifiers using `:grep`.

The `:nmap K` provides dispatch for searching for the identifier under the cursor. Because `K` is an existing command for invoking `man` (with an optional numeric prefix to specify the `man` section number), I partially preserve the behavior: if a numeric prefix is given, `K` still does the `man` lookup. Without a prefix it does `:grep`.

The `:vmap K` is for searching for text that has been visually selected.