alexgolec
alexgolec

Reputation: 28222

Can I get vim to show the current function/namespace/etc. in the bottom bar?

I love the sorts of features that applications like textedit and sublime edit have, where you can see the current namespace in a little bar in the UI. Is there any way to make vim do that?

Upvotes: 2

Views: 920

Answers (3)

David Lam
David Lam

Reputation: 4948

here's a one-liner you can put in your .vimrc (need to have taglist.vim installed though):

set statusline=%<%f\ [%{Tlist_Get_Tagname_By_Line()}]\ %h%m%r%=%-14.(%l,%c%V%)\ %P

...that'll show the current function your cursor is in as you move around.

I forget the specifics but sometimes you'll want to manually refresh it, in which case this mapping is useful:

map <F4> :TlistUpdate<CR>:TlistHighlightTag<CR>

^ that'll refresh the function name in your statusline when you press F4

Upvotes: 0

Ercan Erden
Ercan Erden

Reputation: 1926

The Powerline plugin shows the current function.

Upvotes: 2

romainl
romainl

Reputation: 196466

Would TagBar or TagList help? Both provide a small function to add to your statusline to that effect. Or maybe this other plugin?

I'm not fan of that kind of feature. I prefer to use <C-w>} when I need.

Upvotes: 0

Related Questions