开发者

Does Textmate have a shortcut for hash? i.e. => it's such a pain to type!

  1. Does textmate have a shortcut for hash? i.e. => it's su开发者_Python百科ch a pain to type!

  2. What about smart snippets where you can create a code block with replacement variables, and it cycles through the replacement variables to quickly modify the code template?

Any good links on using textmate with rails to code faster? tips/tricks etc.


We have an alternative hash syntax in Ruby 1.9:

  # old way that still works in Ruby 1.9
  my_hash = { :a => 'apple', :b => 'banana' }

  # new way
  my_hash = { a: 'apple', b: 'banana' }

Since this is being voted up, I'm adding Josiah Kiehl's comment

Note that you can't do anything but symbol keys with this method. ie: {someobject => 'value', 'string' => 'value', 123 => 'value'}


1) Use crtl + L

2) Look under the Bundles > Ruby or Bundles > Ruby on Rails menus. There's all sorts of stuff there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜