在状态行中显示函数名称 [英] Show function name in status line

查看:36
本文介绍了在状态行中显示函数名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编辑了一个很大的 C、C++ 或 Java 文件,比如大约 15000 行,还有很长的函数定义,比如大约 400 行.当光标位于函数定义的中间时,在 Vim 状态行中看到函数名称会很酷.

I edit a large C, C++, or Java file, say, about 15000 lines, with pretty long function definitions, say, about 400 lines. When the cursor is in middle of a function definition, it would be cool to see the function name in Vim status line.

当我们在 Vim 中设置 :set ls=2 时,我们可以获得文件路径(相对于当前目录)、行号等.如果我们能看到函数名也是.任何想法如何获得它?

When we set :set ls=2 in Vim, we can get the file path (relative to the current directory), line number, etc. It would be really cool if we could see the function name too. Any ideas how to get it?

目前我使用 [[ 去开始函数和 Ctrl-O 回到我正在编辑的行.

Currently I use [[ to go to start of the function and Ctrl-O to get back to the line I'm editing.

推荐答案

您可以使用 ctags.vim 为此,它将在标题或状态栏中显示当前函数名称.

You can use ctags.vim for this, it will show the current function name in the title or status bar.

来源:https://superuser.com/questions/279651/how-can-i-make-vim-show-the-current-class-and-method-im-editing

这篇关于在状态行中显示函数名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆