Fix robe keybinds, extends projectile-rails, & minor refactors

Closes #2719
This commit is contained in:
Henrik Lissner 2020-03-13 12:08:25 -04:00
parent 2c2df9df8c
commit 4b20c7206e
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395
2 changed files with 11 additions and 12 deletions

View File

@ -39,13 +39,13 @@ This module add Ruby and optional Ruby on Rails support to Emacs.
+ [[https://github.com/dgutov/robe][robe]]
+ [[https://github.com/endofunky/bundler.el/tree/43efb6be4ed118b06d787ce7fbcffd68a31732a7][bundler]]
+ [[https://github.com/asok/rake][rake]]
+ [[https://github.com/senny/rbenv.el][rbenv]]
+ [[https://github.com/senny/rvm.el][rvm]]
+ [[https://github.com/senny/rbenv.el][rbenv]] (=+rbenv=)
+ [[https://github.com/senny/rvm.el][rvm]] (=+rvm=)
+ [[https://github.com/pezra/rspec-mode][rspec-mode]]
+ [[https://github.com/arthurnn/minitest-emacs][minitest]]
+ [[https://github.com/asok/projectile-rails][projectile-rails]]
+ [[https://github.com/asok/projectile-rails][projectile-rails]] (=+rails=)
+ [[https://github.com/eschulte/jump.el/tree/e4f1372cf22e811faca52fc86bdd5d817498a4d8][inflections]]
+ [[https://github.com/plexus/chruby.el][chruby]]
+ [[https://github.com/plexus/chruby.el][chruby]] (=+chruby=)
* Prerequisites
Many of this modules plugins require ruby with some version manager (RVM or

View File

@ -11,7 +11,7 @@
;; Other extensions are already registered in `auto-mode-alist' by `ruby-mode'
:mode "\\.\\(?:a?rb\\|aslsx\\)\\'"
:mode "/\\(?:Brew\\|Fast\\)file\\'"
:interpreter "j?ruby\\([0-9.]+\\)"
:interpreter "j?ruby\\(?:[0-9.]+\\)"
:config
(setq ruby-insert-encoding-magic-comment nil)
@ -21,9 +21,6 @@
(when (featurep! +lsp)
(add-hook 'ruby-mode-local-vars-hook #'lsp!))
(after! company-dabbrev-code
(pushnew 'company-dabbrev-code-modes 'ruby-mode))
(after! inf-ruby
;; switch to inf-ruby from compile if we detect a breakpoint has been hit
(add-hook 'compilation-filter-hook #'inf-ruby-auto-enter))
@ -43,15 +40,17 @@
(add-hook! 'ruby-mode-hook
(defun +ruby-init-robe-mode-maybe-h ()
"Start `robe-mode' if `lsp-mode' isn't active."
(unless (or (bound-and-true-p lsp-mode)
(bound-and-true-p lsp--buffer-deferred))
(robe-mode +1))))
(or (bound-and-true-p lsp-mode)
(bound-and-true-p lsp--buffer-deferred)
(robe-mode +1))))
:config
(set-repl-handler! 'ruby-mode #'robe-start)
(set-company-backend! 'ruby-mode 'company-robe 'company-dabbrev-code)
(set-lookup-handlers! 'ruby-mode
:definition #'robe-jump
:documentation #'robe-doc)
(when (featurep! :editor evil)
(add-hook 'robe-mode-hook #'evil-normalize-keymaps))
(map! :localleader
:map robe-mode-map
"'" #'robe-start
@ -173,7 +172,7 @@
(use-package! projectile-rails
:when (featurep! +rails)
:hook (ruby-mode . projectile-rails-mode)
:hook ((ruby-mode inf-ruby-mode projectile-rails-server-mode) . projectile-rails-mode)
:init
(setq inf-ruby-console-environment "development")
(when (featurep! :lang web)