Skip to content
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

[ruby-layer] Adding ruby-refactor package and associated keybindings #6307

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions layers/+lang/ruby/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
rspec-mode
rubocop
(ruby-mode :location built-in :toggle (not ruby-enable-enh-ruby-mode))
ruby-refactor
ruby-test-mode
ruby-tools
rvm
Expand Down Expand Up @@ -177,6 +178,21 @@
"'" 'ruby-toggle-string-quotes
"{" 'ruby-toggle-block)))

(defun ruby/init-ruby-refactor ()
(use-package ruby-refactor
:defer t
:init (dolist (hook '(ruby-mode-hook enh-ruby-mode-hook))
(add-hook hook 'ruby-refactor-mode-launch))
:config
(progn
(dolist (mode '(ruby-mode enh-ruby-mode))
(spacemacs/declare-prefix-for-mode mode "mrR" "ruby/refactor")
(spacemacs/set-leader-keys-for-major-mode mode
"rRm" 'ruby-refactor-extract-to-method
"rRv" 'ruby-refactor-extract-local-variable
"rRc" 'ruby-refactor-extract-constant
"rRl" 'ruby-refactor-extract-to-let)))))

(defun ruby/init-ruby-tools ()
(use-package ruby-tools
:defer t
Expand Down