Created
February 13, 2015 15:31
-
-
Save jordonbiondo/622eef7d6bdf07137a81 to your computer and use it in GitHub Desktop.
automatically swith rubies when changing buffer to a ruby buffer outside the current project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; automatically swith rubies when changing buffer to a ruby buffer outside the current project. | |
| ;; requires rvm.el and projectile | |
| (defvar jorbi/-last-active-ruby-project nil) | |
| (defun jorbi/maybe-activate-new-ruby () | |
| (when (and (equal major-mode 'ruby-mode) | |
| (not (equal jorbi/-last-active-ruby-project | |
| (setq jorbi/-last-active-ruby-project | |
| (projectile-project-name))))) | |
| (rvm-activate-corresponding-ruby))) | |
| (add-hook 'buffer-list-update-hook 'jorbi/maybe-activate-new-ruby)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment