Is there a Sublime Text plugin for Ruby that, after I type class/def something + Enter, will automatically insert end and place the curser in the class/method?

For example, typing def initialize(args) + Enter would result in:

def initialize(args)
  #cursor here
end
有帮助吗?

解决方案

In Textmate if you type def + Tab, it sets things up for you like that. I believe Sublime does the same.

其他提示

I haven't used sublime, but here is what i found.

  1. you could create snippets using Ruby on Rails Snippet package

  2. You could use the solution given in 'How to automatically add "end" to code blocks?'.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top