-
-
Save anildigital/1213051 to your computer and use it in GitHub Desktop.
Enable Electric Ruby Mode in Emacs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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