ruby-mode for Emacs

If you are an Emacs user, ruby-mode will help you a lot. It supports auto indent, colorizing program text, etc. To use ruby-mode, put ruby-mode.el into the directory included in your load-path variable, then put the following code in your .emacs file.

(autoload 'ruby-mode "ruby-mode")
(setq auto-mode-alist (append (list (cons \\.rb$ 'ruby-mode) 
       auto-mode-alist))
(setq interpreter-mode-alist (append '(("ruby".ruby-mode)) 
       interpreter-mode-alist))

Get Ruby in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.