Skip to content

Instantly share code, notes, and snippets.

@yeshunping
Forked from danp/init.el
Created March 4, 2014 19:03
Show Gist options
  • Save yeshunping/9353284 to your computer and use it in GitHub Desktop.
Save yeshunping/9353284 to your computer and use it in GitHub Desktop.
(add-to-list 'load-path (concat user-emacs-directory "vendor/enhanced-ruby-mode"))
(setq enh-ruby-program "/opt/boxen/rbenv/versions/2.1.1/bin/ruby")
(autoload 'enh-ruby-mode "enh-ruby-mode" "Major mode for ruby files" t)
(add-to-list 'auto-mode-alist '("\\.rb$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("\\.gemspec$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile$" . enh-ruby-mode))
(add-to-list 'interpreter-mode-alist '("ruby" . enh-ruby-mode))
(setq enh-ruby-bounce-deep-indent t)
(setq enh-ruby-hanging-brace-indent-level 2)
(defun set-newline-and-indent ()
(define-key enh-ruby-mode-map (kbd "RET") 'reindent-then-newline-and-indent))
(add-hook 'enh-ruby-mode-hook 'set-newline-and-indent)
(custom-set-faces
'(erm-syn-errline ((t (:background "red1" :foreground "White"))))
'(erm-syn-warnline ((t (:background "magenta" :foreground "White")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment