Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

You know how we can get information about the current file with Ctrl+g. I would like to extend that to show the current function name the cursor is currently in. Assume C language.

Any Vim pros out there to help me out?

share|improve this question
You would like it to show the name of the function you're currently "in"? Or? – Rook Oct 14 '11 at 18:48
vim mailing lists & irc is a better place to ask, I would say. – Abhijeet Rastogi Oct 14 '11 at 19:15
@Idigas, yes, the function cursor is in, currently. – slowpoison Oct 14 '11 at 19:24

You must really have large functions.

I see two ways to do that:

  1. by folding with the cursor on a blank line, it will fold the entire current function, letting you see its name. za to fold, look at the name, za to unfold.

  2. by using either TagList or TagBar, invoking either of these plugins will create a split window with an outline of your file and the cursor positioned on the current function's name and the name highlighted. If your cursor is on a member's name it will show the member instead so you may have to move your cursor over a keyword like int or on some whitespace.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .