-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add chruby support to Ruby layer #2321
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,14 @@ | |
:config (add-hook 'enh-ruby-mode-hook | ||
(lambda () (rbenv-use-corresponding))))) | ||
|
||
(defun ruby/init-chruby () | ||
"Initialize chruby mode" | ||
(use-package chruby | ||
:defer t | ||
:init (chruby) | ||
:config (add-hook 'enh-ruby-mode-hook | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have to replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I literally copied this from the rbenv example right above it. Can you help me understand what makes it different in this case? |
||
(lambda () (chruby-use-corresponding))))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need the lambda expression here you can replace it by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup I can change that, I was trying to be consistent with the |
||
|
||
(defun ruby/init-rvm () | ||
"Initialize RVM mode" | ||
(use-package rvm | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to call chruby here.
defer t
enable deferred loading sochruby
will be loading when the first ruby file is opened.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you can delete this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally didn't have this line and it was not working. I am new to emacs and elisp so am probably missing something in my mental model, but it didn't work without this line...