a 已经用谷歌搜索了这个问题,但什么也没找到 - 也许我不知道在这种情况下如何正确定义搜索关键字。
当我开发 Ruby on Rails 应用程序时,我喜欢在 vim 中使用折叠。我的 Foldcolumn 设置为 4。但是它对 ruby 方法的开始和结束的可视化并不是那么简单和明显(“-” - “def”,“|” - “end”):
-def foo
bar = 1
|end
问题是 - 是有任何 vim 插件,它将在每个“def”和“end”附近显示标记(箭头或 stmh),就像在 TextMate 中所做的那样(1)?
v def foo
bar = 1
^ end
另外,由于我在 vim/ruby 方面没有太多经验,也许还有另一种更优雅的方法来检查所有防御端对是否在特定文件中关闭? (matchit.vim 不太适合这种需求)
我希望有比在控制台中读取“语法错误”更方便的方法来捕捉丢失的“结束”:)
a have googled the question, but found nothing - maybe I do not know how to define the search keywords properly in this case.
I like to use folding in vim when I'm developing Ruby on Rails applications. And my foldcolumn is set to 4. But its visualizing of the start and the end of the ruby method is not so simple and obvious ("-" - "def", "|" - "end"):
-def foo
bar = 1
|end
The question is - is there any plugin for vim, that will show markers (arrows or stmh) near every "def" and "end" like it is done in TextMate (1)?
v def foo
bar = 1
^ end
Also, as I do not have much experience in vim/ruby, maybe there is another, more elegant way to check that all def-end pairs are closed in a particular file? (matchit.vim is not very comfortable for this need)
I hope there is more convenient way to catch lost "ends" than to read "Syntax error" in the console :)
发布评论
评论(1)
我不确定这是否正是您所需要的,但是您尝试过“foldcolumn”选项吗?例如,使用:
您将得到如下内容:
有关详细信息,请参阅
:help 'foldcolumn'
。请注意,如果您的 Vim 启用了鼠标,则可以单击-
符号来关闭折叠。编辑
如果你不喜欢折叠方法,你可以使用符号(假设你的 Vim 启用了符号)。尝试这样的事情:
它可能并不完美(我不知道 ruby),但它可能会给你一些入门的东西。
I'm not sure whether it's quite what you need, but have you tried the 'foldcolumn' option? For example, with:
You'll get something like this:
See
:help 'foldcolumn'
for more information. Note that you can click on the-
signs to close the folds if your Vim is mouse-enabled.Edit
If you don't like the fold method, you could use signs (assuming your Vim is signs enabled). Try something like this:
It's probably not perfect (I don't know ruby), but it might give you something to get started.