论坛首页 编程语言技术论坛

RadRails终于有了比较完整的TextMate snippets

浏览 16833 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2006-11-15  
今天在RadRails官网上看到一则消息http://www.radrails.org/blog/2006/11/13/dr-nic-cures-template-cancer: Dr Nic完成了TextMate snippets完整的radrails模板,马上按其网站上的说明安装到Radrails上:
   1. 下载两个模板XML文件(见附件压缩包中).
   2. 打开RadRails
   3. 依次打开 Windows > Preferences > Ruby > Editor > Templates, 可以看到已存在的模板(template)列表
   4. 点击选择任意一个模板(template),按Ctrl-A选择全部
   5. 点击Remove, 删除全部模板
   6. 点击Import…, 然后选择文件ruby-rr-templates.xml,完成ruby模板的导入
   7. 然后是rhtml,切换到Rails > Editiors > RHTML Editor > RHTML Templates
   8. 删除全部当前使用的模板(templates)
   9. 点击Import…, 选择文件rhtml-rr-templates.xml,完成rhtml模板的导入
  10. 点击确认(OK)按钮,使设置生效

使用方法上和标准的eclipse模板是一样的,比如输入habtm,按Alt+/,就会出现has_and_belongs_to_manybject,完整的清单可看一下textmate-snippets-cheat-sheethttp://pragmaticstudio.com/rails/RailsTextMateCheats.pdf。不过,花20分钟仔细看一下Radrails上的模板清单,会有更感性的认识。
试用了一下,比原来放出的那个2006-09-18.RADRails-TextMate_Templates-v1.xml完整多了,而且,Radrails0.8将内建这个template,看来TextMate的作者要有点压力了,嘿嘿。
   发表时间:2006-11-15  
现在最郁闷的是rhtml editer的自动补全快捷键不知道怎么修改
0 请登录后投票
   发表时间:2006-11-15  
需要修改吗?我这直接用Alt+/就可以调用template呀。
0 请登录后投票
   发表时间:2006-11-15  
crazycode 写道
需要修改吗?我这直接用Alt+/就可以调用template呀。
原来如此!

一直把rhtml Editor的快捷键认为是rb Editor的快捷键!
0 请登录后投票
   发表时间:2006-11-16  
rhtml editer中默认快捷键是ctrl+
0 请登录后投票
   发表时间:2006-11-16  
模板文件解压到哪个文件夹?
0 请登录后投票
   发表时间:2006-11-16  
0.8很值得期待,但是什么时候对象可以点出方法呢?

radrails 写道

Patch contributions and 0.8 news
by matt - 10/25/2006 09:08 AM

A few weeks ago, a guy named Brad Wilson sent a message to the mailing list with a patch that added a few things to the RHTML editor and the DB table editor. Since then, I've been working with Brad and he's contributed some more fixes and features. He's done an incredible job and I want to briefly outline his contributions:

-Refresh button for DB table editor and re-use of editors for same tables
-Context menu for Servers view
-Sortable columns in Servers view
-Toggle comment action for the RHTML editor
-Parser for RHTML editor that builds a syntax tree
-Outline view for the RHTML editor
-Source formatter for the RHTML editor

Brad has contributed the most code we've ever seen, by far. Much thanks to him from the entire team!

I have been building on Brad's work, adding more options to the RHTML source formatter and enhancing the outline. I think the syntax tree will allow for some content assist in the editor, especially providing closing tags. An enhanced RHTML editor is just one of many features awaiting in the next 0.8 release. Recent work from RDT and JRuby will be included, such as Ruby refactoring and _fast_ debugging. So stay tuned, there's a lot coming.


0 请登录后投票
   发表时间:2006-11-16  
song8159 写道
模板文件解压到哪个文件夹?


随便哪个文件夹,只要你能找到。 不过建议放到radrails目录里的某个地方。
0 请登录后投票
   发表时间:2006-11-16  
直接修改D:\EclipseWorkSpace\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.workbench.prefs里的快捷键呢?
\r\n<keyBinding commandId\="org.eclipse.ui.edit.text.contentAssist.proposals" contextId\="org.rubypeople.rdt.ui.rubyEditorScope" keyConfigurationId\="org.radrails.db.ui.scheme.default" keySequence\="ALT+/"/>
\r\n<keyBinding commandId\="org.rubypeople.rdt.ui.edit.text.ruby.content.assist.proposals" contextId\="org.rubypeople.rdt.ui.rubyEditorScope" keyConfigurationId\="org.eclipse.ui.defaultAcceleratorConfiguration" keySequence\="ALT+/"/>
\r\n<keyBinding commandId\="org.eclipse.ui.edit.text.hippieCompletion" contextId\="org.rubypeople.rdt.ui.rubyEditorScope" keyConfigurationId\="org.eclipse.ui.defaultAcceleratorConfiguration" keySequence\="ALT+."/>

不行就再把下面的一起加上
\r\n<keyBinding commandId\="org.eclipse.ui.edit.text.contentAssist.proposals" contextId\="org.eclipse.ui.textEditorScope" keyConfigurationId\="org.eclipse.ui.defaultAcceleratorConfiguration" keySequence\="ALT+/"/>
\r\n<keyBinding commandId\="org.eclipse.ui.edit.text.hippieCompletion" contextId\="org.eclipse.ui.textEditorScope" keyConfigurationId\="org.eclipse.ui.defaultAcceleratorConfiguration" keySequence\="ALT+."/>

我设置的ALT+.是wordComplete,ALT+/是contentAssist...
0 请登录后投票
   发表时间:2006-11-16  
我的rb文件没有反应,rhtml里面能出来,这是怎么回事?
0 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics