Ruby Highlighting in Emacs
Monday, October 30th, 2006If you want to turn on syntax highlighting for Ruby in emacs, first download ruby-elisp, then add the following to your .emacs file.
(autoload 'ruby-mode "ruby-mode" "Load ruby-mode")
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
;; uncomment the next line if you want syntax highlighting
(add-hook 'ruby-mode-hook 'turn-on-font-lock)
I like a darker color, with the possible to escape if the colors don’t work out
(autoload 'ruby-mode "ruby-mode" "Load ruby-mode")
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
;; uncomment the next line if you want syntax highlighting
(add-hook 'ruby-mode-hook '(lambda ()
(set-background-color "slate grey")
(set-foreground-color "almond")
turn-on-font-lock))
(add-hook 'text-mode-hook '(lambda ()
(set-background-color "white")
(set-foreground-color "black")))
when ruby-mode is loaded the background is slate grey, to get a white back ground just start using text-mode