Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(require 'ruby-mode)
(add-to-list 'auto-mode-alist
'("\\.\\(?:cap\\|gemspec\\|irbrc\\|gemrc\\|rake\\|rb\\|ru\\|thor\\)\\'" . ruby-mode))
;; Ruby mode
(add-hook 'ruby-mode-hook 'robe-mode)
(add-hook 'ruby-mode-hook 'company-mode)
(add-hook 'ruby-mode-hook 'electric-pair-mode)
(setq ruby-insert-encoding-magic-comment nil)
(require 'rspec-mode)
(eval-after-load 'rspec-mode '(rspec-install-snippets))
;; Bundler
(define-key ruby-mode-map (kbd "C-c TAB") 'bundle-install)
(define-key ruby-mode-map (kbd "C-c C-e") 'bundle-exec)
(define-key ruby-mode-map (kbd "C-c C-u") 'bundle-console)
;; Guard
(define-key ruby-mode-map (kbd "C-c C-g") 'ruby-guard)
(setq inf-ruby-default-implementation "pry")
(add-hook 'after-init-hook 'inf-ruby-switch-setup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment