While working in various source files, (C, Ruby, etc.) I find that I'm often hunting around for functions. Is there a way to have an auto-generated HUD that lists the structure of the current file? It would be fantastic if it linked to different parts of the file, similar to how NERDTree links to different files. Or, similar to the side-navs in the screenshots here: https://stackoverflow.com/questions/16895610/gen-file-missing-incomplete-in-eclipse

Assuming that this doesn't exist as a plugin or something, how do people usually navigate around files like this?


You could try either TagList or TagBar but such a list could be generated as needed (no third party tool or configuration needed) with a simple:


See :help :global.

If you don't mind a little bit of per-filetype configuration, the :dlist command could be used to list every function in the current file and included files:

:dlist /

See :help definition-search, :help 'include', :help 'define', :help 'suffixesadd'.

| improve this answer | |
  • not a very smart approach though. Would rather have the screen splitted and read the fucntion list in a draft – milaniez Sep 4 '19 at 20:36
  • 1
    Learned about dlist today, thanks – D. Ben Knoble Sep 5 '19 at 0:52

Instead of writing a regex as @romainl seem to be suggesting, You can have taglists installed and add the following to .vimrc:

nnoremap <C-l> :TlistToggle<CR>

Now by pressing Ctrl + l you'll show/hide the list of functions, structures and more.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.