简体   繁体   English

如何在vim-airline中显示函数名称?

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

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. 我正在使用ctags vim插件在状态行中显示当前C函数的名称(=光标所在的位置)。

Today I installed the vim-airline plugin. 今天,我安装了vim-airline插件。 Fancy, but the C function name is no longer displayed in the status line. 花哨的,但是C函数名称不再显示在状态行中。 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? 有没有办法使ctags.vimairline共存,或者有其他方法可以像ctags一样在状态行中显示函数名称?

I searched the :help airline for function but that did not answer my question. 我在:help airline搜索了function但没有回答我的问题。

I don't know about ctags.vim but vim-airline has support for tagbar which is great. 我不了解ctags.vim但是vim-airline支持tagbar ,这很棒。 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: 您只需要安装它( majutsushi / tagbar ),然后在.vimrc启用它,以便航空公司可以向您显示您所使用的功能:

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

Of course, in addition to that, you get all the cool functionality of tagbar . 当然,除此之外,您还可以获得tagbar所有tagbar功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM