本文介绍了如何在Sublime文字2中设置/使用Rails片段上的ruby和自动完成功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人可以将我定向到显示该操作方法的网站,我将不胜感激。
似乎无法通过Google找到足够不错的东西。

I would appreciate if someone could direct me to a website that shows how to do this..Can't seem to find anything decent enough via google.

这是我第一次使用文本编辑器来做这种事情。.到了这样的阶段,键入<%=%>之类的东西变得陈旧且缓慢。

This will be the first time I'm doing this kind of thing with a text editor.. It has got to the stage where typing out things like <%= %> is getting old and slow.

我已经安装了rails片段包和ryan-on-rails包。只是对如何开始使用它们感到困惑。

I've got a rails snippet package and also ryan-on-rails package installed. Just confused with how to start using them.

我在max osx-雪豹上

I'm on max osx - snow leopard

亲切的问候

更新

这帮助了我。 ,但是我仍然需要一些练习。

This helped me out. http://webtempest.com/sublime-text-2-how-to-create-snippets/ but I still need a little practice.


  1. 我有一个包 rails我不记得我从哪里得到的,但是片段的触发正在起作用。我只想找到一个不错的命令列表,而不必去每个代码片段并自己寻找。我可以通过单击摘要来找到,但是没有办法为它创建快捷方式吗?

  1. I have a package "rails" can't remember where I got it but the triggering of snippets is working. I'd just like to find a nice list of the commands rather than have to go to each snippet and look for myself. I can find the by clicking on snippets but isn't there a way I can create a shortcut for that?

还希望自动缩进..和


推荐答案

由于您是Sublime Text的新手,所以我强烈建议您检出:。如果其中包含大量入门信息以及有关扩展性和插件开发的大量信息。

Since you're new to Sublime Text, I highly recommend you check out: ST2's Unofficial Documentation. If includes a ton of getting started info plus tons of info for extendibility and plugin development.

可以找到另一本很棒的入门指南。

Another great "Getting Started" guide can be found here on Nettuts+.

如果要查找代码片段及其相关快捷方式的列表,请从菜单中转到工具>代码片段...。

If you're looking a list of your snippets and their associated shortcuts, go to "Tools > Snippets..." from your menu.

<%扩展为<%| %> (其中|是光标),将以下用户添加到您的User-keybindings(首选项> Keybindings-User):

To expand <% into <%| %> (where | is the cursor), add the following you to your User-keybindings (Preferences > Keybindings - User):

 {
   "args": {
     "contents": "% $0 %>"
   },
   "command": "insert_snippet",
   "context": [
     {
       "key": "selector",
       "match_all": true,
       "operand": "source.ruby",
       "operator": "equal"
     },
     { "key": "preceding_text", "operator": "regex_match", "operand": ".*<", "match_all": true }
   ],
   "keys": [
     "%"
     ]
   }

最新的Beta版包含改进的自动缩进功能,因此如果您没有安装,尝试一下。
至于自动完成功能,默认情况下,Sublime Text 2提供了当前文档中单词的自动完成功能(以及包中的所有代码片段/完成内容)。但是,如果您正在寻找类似IDE的自动补全功能,则可以使用SublimeCodeIntel插件。我不愿意提及它,因为它已经几个月没有更新,并且错误报告不断涌入。

The latest beta includes improved auto-indentation, so if you don't have that installed, try that out.As for autocompletion, Sublime Text 2 by default offers autocompletion of words in the current document (plus all of your snippets/completions from packages). However, if you're looking for IDE-like autocompletion, there is the SublimeCodeIntel plugin. I am reluctant to mention it because it has not been updated in months and the bug reports keep flowing in.

希望有帮助。

这篇关于如何在Sublime文字2中设置/使用Rails片段上的ruby和自动完成功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 17:19