summaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-07-26 22:02:16 +0200
committerGravatar Tom Willemse2015-07-26 22:02:16 +0200
commit4130e90044248295603a939aa163229841b75c78 (patch)
tree82fe01039f0b314eba820e369b18a442f34b5ac2 /emacs
parentc9cacdf23c4f2012d13ab0aaa1d426bb457f98c0 (diff)
downloaddotfiles-4130e90044248295603a939aa163229841b75c78.tar.gz
dotfiles-4130e90044248295603a939aa163229841b75c78.zip
Automatically turn-on the correct ruby
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el
index bd7fc0e..80c1002 100644
--- a/emacs/.emacs.d/init.el
+++ b/emacs/.emacs.d/init.el
@@ -34,6 +34,7 @@
(autoload 'tagedit-mode "tagedit" nil t)
(autoload 'tern-mode "tern" nil t)
(autoload 'xmodmap-mode "xmodmap-mode" nil t)
+(autoload 'rvm-activate-ruby-for "rvm")
;;;; Macros
@@ -791,6 +792,11 @@ If no direction is given, don't split."
(cl-loop for i from 1 to upto do (insert (format "%5d: %d\n" i (* number i)))))
(pop-to-buffer buffer)))
+(defun oni:select-corresponding-ruby ()
+ (when (and (not (projectile-rails--ignore-buffer-p))
+ (projectile-rails-root))
+ (rvm-activate-ruby-for (projectile-rails-root))))
+
;;;; Tests
(stante-after ert
@@ -1250,6 +1256,7 @@ from myaethon2.core.decorators import (
(add-hook 'yas-global-mode-hook 'oni:yas-minor-mode-func)
(add-hook 'ert-results-mode-hook (lambda () (setq truncate-lines nil)))
(add-hook 'ruby-mode-hook (lambda () (setq-local fci-rule-column 80)))
+(add-hook 'projectile-switch-project-hook #'oni:select-corresponding-ruby)
(oni:add-function-to-hooks #'oni:make-readable
'Info-mode-hook 'gnus-article-mode-hook 'gnus-group-mode-hook