Skip to content

Instantly share code, notes, and snippets.

@mag
Created November 22, 2008 15:07
Show Gist options
  • Save mag/27843 to your computer and use it in GitHub Desktop.
Save mag/27843 to your computer and use it in GitHub Desktop.
installing ruby-mode.el on mac osx leopard
; ruby
;; based on http://www.rubygarden.org/Ruby/page/show/InstallingEmacsExtensions
;;
(add-to-list 'load-path "~/.emacs.d/site-lisp/ruby")
(autoload 'ruby-mode "ruby-mode"
"Mode for editing ruby source files")
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
(autoload 'run-ruby "inf-ruby"
"Run an inferior Ruby process")
(autoload 'inf-ruby-keys "inf-ruby"
"Set local key defs for inf-ruby in ruby-mode")
(add-hook 'ruby-mode-hook
'(lambda ()
(inf-ruby-keys)))
;; If you have Emacs 19.2x or older, use rubydb2x
(autoload 'rubydb "rubydb3x" "Ruby debugger" t)
;; uncomment the next line if you want syntax highlighting
(add-hook 'ruby-mode-hook 'turn-on-font-lock)
this is based partly on http://blog.modp.com/2007/09/ruby-mode-for-emacs.html
first, download the ruby mode goodness:
cd ~/.emacs.d
mkdir site-lisp # if not already there. not sure if this is the conventional place to put elisp on mac osx...
svn co http://svn.ruby-lang.org/repos/ruby/trunk/misc ruby
cd ruby
emacs -batch -f batch-byte-compile *.el # do not forget the -f
then just use the .emacs below
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment