0

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
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
ben
  • 29,229
  • 42
  • 124
  • 179

2 Answers2

1

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?'.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
usha
  • 28,973
  • 5
  • 72
  • 93
1

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

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
seph
  • 6,066
  • 3
  • 21
  • 19