Treetop 的 Vim 缩进文件(Ruby 解析器)
有人见过 Ruby 解析器/生成器 treetop 的 vim 缩进文件吗?我找到了一个 vim 语法高亮文件,但还没有看到缩进。
Has anyone seen a vim indent file for treetop, the Ruby parser/generator? I've found a vim syntax highlighting file, but haven't seen one for indentation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
看起来这相当简单 - 我只需创建一个文件
并制作其唯一内容
,然后它似乎就支持我需要的所有内容。我认为它只是没有加载 Ruby 的缩进文件!
It seems like it's fairly easy - I just create a file
and make its sole contents
and it seems to then support all I need. I think it just wasn't loading Ruby's indentation file!
我从这个人那里复制了一个: http://code.google.com/p/dot-files/source/browse/trunk/.vim/syntax/treetop.vim?spec=svn149&r=149
工作精美。
I copied the one from this guy: http://code.google.com/p/dot-files/source/browse/trunk/.vim/syntax/treetop.vim?spec=svn149&r=149
Works beautifully.
我不久前在 Vim 或 Emacs 上搜索过这个,但找不到任何东西,所以我开始写我的
Emacs 自己的模式。自从我几乎停止使用 TT 以来,它从来没有得到任何结果,但如果我的记忆
不会失败,你只需要解析类似的内容:
阅读后可能不会太难
这个。
PS:请记住,这个语法与 RSpec 使用的语法非常相似,RSpec 是自然的 Ruby,所以也许您可以通过阅读它获得一些帮助。
I searched for this a while ago for Vim or Emacs and couldn't find anything so I started writing my
own mode for Emacs. It never got to anything since I pretty much stopped using TT but if my memory
doesn't fail you only have to parse something like:
Which might not be too hard after reading
this.
PS: Keep in mind that this grammar is really similar to the one used by RSpec which is natural Ruby so maybe you could get some help by reading that.
我不确定是否有直接的 ruby 实现,但是 vim Rails 插件< /a> 很好地处理缩进。
You could always just edit this so that it supports ruby files that aren't within a rails project. Check it out.
I'm not sure if there's a straight ruby implementation, but the vim rails plugin handles indentation quite well.
You could always just edit this so that it supports ruby files that aren't within a rails project. Check it out.