可靠的 C 上下文窗口
我最近开始使用 ctx
Vim 插件。该插件提供了一个“上下文”窗口,显示范围层——函数定义、for 循环、if 语句等——一直到当前行。实在是太棒了! ..理论上。在实践中,我发现它并不那么可靠。我可能只是运气不好;到目前为止,我实际上只尝试在一个文件上使用它。
例如,在 vim 的 ExpandFromContext 函数中src/ex_getln.c
,不显示函数签名,只显示左大括号。
这个插件相当老了(最后一次更新是2002年),作者似乎已经转向了绝对非C的东西(看起来主要是 Clojure 开发)。因此,提交错误报告似乎没有多大意义。
这个插件或另一个插件是否有一个分支可以提供更可靠的解析?
I've recently started using the ctx
Vim addon. This addon provides a "context" window that displays the layers of scope — function definitions, for loops, if statements, etc. — down to the current line. It's really great! ..in theory. In practice, I'm finding that it's not all that reliable. I may just have bad luck; I've really only tried to use it on one file so far.
For example, within the ExpandFromContext function in vim's src/ex_getln.c
, the function signature is not displayed, just the opening brace.
This addon is pretty old (last update 2002) and the author seems to have moved on to decidedly non-C things (looks like mostly clojure development). So as such, there doesn't seem to be much point in filing a bug report.
Is there a fork of this addon or another one which provides more reliable parsing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
虽然这个功能很基础,但对我来说还是很有帮助的。从一个朋友那里得到的,他是从网站上得到的,所以没有声称任何作者身份。将其添加到您的 vimrc 中以获取您当前所在的函数。我只在 C/C++ 中使用过它:
Although basic this function has been very helpful to me. Got it from a friend who got it from a website so not claiming any authorship. Add it to your vimrc for getting the current function you're in. I've only used it in C/C++:
可能该插件也已过时,因为同时至少还有一些其他很好的 Vim 功能
- 折叠,6种方法(:帮助折叠),
- 使用文本对象(:帮助文本对象)。
May be the plug-in is also obsolete because there are some good other Vim features in the meanwhile, at least
- folding, 6 methods (:help folding),
- working with text objects (:help text-objects).
也许 SrcExpl 适合您。
Maybe SrcExpl is suitable for you.