From 3248b2813bd30509bf042fe5ee86c77ca571ab4a Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Wed, 26 Aug 2020 11:39:35 -0700 Subject: [PATCH 1/3] Some ruby emacs stufF --- dotfiles/emacs.d/init.el | 17 +++++++++++++++++ dotfiles/emacs.d/package.el | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index 1c871ff..f6ddbe3 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -272,6 +272,23 @@ There are two things you can do about this warning: ;; Python testing helpers (use-package python-pytest) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RUBY ;;;;;;;;;;;;;;;;;; +;; +;; +;; + +(require 'rvm) + +(add-hook 'ruby-mode-hook 'robe-mode) + +(eval-after-load 'company + '(push 'company-robe company-backends)) + +(add-hook 'robe-mode-hook 'ac-robe-setup) + +(advice-add 'inf-ruby-console-auto :before #'rvm-activate-corresponding-ruby) + ;;-------------------------------------------------------------------------------------- ;; Save hooks ;;-------------------------------------------------------------------------------------- diff --git a/dotfiles/emacs.d/package.el b/dotfiles/emacs.d/package.el index 44ea251..c6f0999 100644 --- a/dotfiles/emacs.d/package.el +++ b/dotfiles/emacs.d/package.el @@ -45,6 +45,15 @@ elpy yaml-mode slime + + ;; Rails + rinari + + ;; Ruby autocomplete + robe + + ;; RVM support + rvm ;;;;;;;;;;;;;;;;;;;; ;; Test helpers From 87a502954356be64ca3508bfc4b80939a70018aa Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Wed, 26 Aug 2020 13:18:48 -0700 Subject: [PATCH 2/3] try and fail to get lsp to work with python --- dotfiles/emacs.d/init.el | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index f6ddbe3..b3ad9b1 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -199,8 +199,22 @@ There are two things you can do about this warning: (add-hook 'after-init-hook #'global-flycheck-mode) ;; LSP +(use-package lsp-mode + :ensure t + :config + (setq lsp-print-io nil) + + (use-package lsp-ui + :ensure t + :config + (setq lsp-ui-sideline-ignore-duplicate t) + (add-hook 'lsp-mode-hook 'lsp-ui-mode)) + + (use-package company-lsp + :ensure t + :config + (push 'company-lsp company-backends))) -(require 'lsp-mode) ;;;;; PYTHON ;;;;;;;;;;;;;;;;;; ;; @@ -260,7 +274,9 @@ There are two things you can do about this warning: (add-hook 'python-mode-hook (lambda () (add-to-list 'company-backends 'company-jedi))) + ;; Use microsoft's python language server +(add-hook 'python-mode-hook (lambda () (lsp-python-enable))) (require 'lsp-python-ms) (use-package lsp-python-ms :ensure t @@ -333,6 +349,8 @@ There are two things you can do about this warning: (define-key counsel-gtags-mode-map (kbd "M-s") 'counsel-gtags-find-symbol) (define-key counsel-gtags-mode-map (kbd "M-,") 'counsel-gtags-go-backward)) + + ;;-------------------------------------------------------------------------------------- ;; Install and load Packages ;;-------------------------------------------------------------------------------------- @@ -348,7 +366,7 @@ There are two things you can do about this warning: '(lisp-indent-function (quote common-lisp-indent-function)) '(package-selected-packages (quote - (projectile smex grizzl flycheck-pos-tip flycheck material-theme expand-region wrap-region rainbow-delimiters powerline linum-relative golden-ratio fill-column-indicator autopair exec-path-from-shell ws-butler yaml-mode python-mode protobuf-mode paredit nasm-mode meson-mode markdown-mode magit gradle-mode gitignore-mode feature-mode counsel company-jedi jedi-core company-emacs-eclim company-irony company ag)))) + (company-lsp projectile smex grizzl flycheck-pos-tip flycheck material-theme expand-region wrap-region rainbow-delimiters powerline linum-relative golden-ratio fill-column-indicator autopair exec-path-from-shell ws-butler yaml-mode python-mode protobuf-mode paredit nasm-mode meson-mode markdown-mode magit gradle-mode gitignore-mode feature-mode counsel company-jedi jedi-core company-emacs-eclim company-irony company ag)))) (custom-set-faces ;; custom-set-faces was added by Custom. From 3d4d3fb68c98e3835b0cc9acfdb420f89d00a322 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Fri, 28 Aug 2020 00:22:57 -0700 Subject: [PATCH 3/3] Get lsp-mode to finally work with python files --- dotfiles/emacs.d/init.el | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index b3ad9b1..0d72dfa 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -28,6 +28,13 @@ There are two things you can do about this warning: (when (not package-archive-contents) (package-refresh-contents)) +;; Bootstrap use-package if it doesn't exist +(when (not (package-installed-p 'use-package)) + (package-refresh-contents) + (package-install 'use-package)) + +(require 'use-package) + ;; Load the package.el file (load-file "~/.emacs.d/package.el") @@ -200,20 +207,14 @@ There are two things you can do about this warning: ;; LSP (use-package lsp-mode - :ensure t - :config - (setq lsp-print-io nil) - - (use-package lsp-ui - :ensure t - :config - (setq lsp-ui-sideline-ignore-duplicate t) - (add-hook 'lsp-mode-hook 'lsp-ui-mode)) - - (use-package company-lsp - :ensure t - :config - (push 'company-lsp company-backends))) + :ensure t + :hook (python-mode . lsp-deferred) + :commands (lsp lsp-deferred)) + + +(use-package lsp-ui + :ensure t + :hook (lsp-mode . lsp-ui-mode)) ;;;;; PYTHON ;;;;;;;;;;;;;;;;;;