How can I display the function name in vim-airline?

天大地大妈咪最大 提交于 2020-01-03 13:33:10

问题


I'm using the ctags vim plugin to have the name of the current C function (=where the cursor is) displayed in the status line.

Today I installed the vim-airline plugin. Fancy, but the C function name is no longer displayed in the status line. There is lots of room for more text. Is there a way to make ctags.vim and airline coexist or some other technique to show the function name somewhere in the status line like ctags does?

I searched the :help airline for function but that did not answer my question.


回答1:


I don't know about ctags.vim but vim-airline has support for tagbar which is great. You only need to install it (majutsushi/tagbar) and then enable it in your .vimrc so airline can show you in which function you are on:

let g:airline#extensions#tagbar#enabled = 1

Of course, in addition to that, you get all the cool functionality of tagbar.



来源:https://stackoverflow.com/questions/26789467/how-can-i-display-the-function-name-in-vim-airline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!