Skip to content

Instantly share code, notes, and snippets.

@anildigital
Forked from stuartsierra/gist:1212314
Created September 13, 2011 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anildigital/1213051 to your computer and use it in GitHub Desktop.
Save anildigital/1213051 to your computer and use it in GitHub Desktop.
Enable Electric Ruby Mode in Emacs
;; Add this to ~/.emacs
;; Missing from ruby-mode.el, see https://groups.google.com/group/emacs-on-rails/msg/565fba8263233c28
(defun ruby-insert-end ()
"Insert \"end\" at point and reindent current line."
(interactive)
(insert "end")
(ruby-indent-line t)
(end-of-line))
(add-hook 'ruby-mode-hook
(lambda ()
(require 'ruby-electric)
(ruby-electric-mode t)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment