From fbc2642c5be353ebbf5e0bb6f288a952882d10cc Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Fri, 24 Feb 2023 08:53:34 -0800 Subject: [PATCH] Update some python-mode stuff, and make rainbow delimiters work --- elisp/custom.el | 2 +- elisp/modes/default-modes.el | 8 +++++--- elisp/modes/python-mode-settings.el | 5 ++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/elisp/custom.el b/elisp/custom.el index 6d21915..c52f21d 100644 --- a/elisp/custom.el +++ b/elisp/custom.el @@ -4,7 +4,7 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages - '(centaur-tabs lsp-pyright magit doom-modeline flycheck-indicator nord-theme powerline rainbow-delimiters python-pytest json-mode company-jedi jedi hl-defined counsel rainbow-identifiers exwm-config all-the-icons-ibuffer slime ivy zerodark-theme zerodark neotree all-the-icons paredit flycheck aggressive-indent aggressive-indent-mode lsp-python-ms py-autopep8 pyenv-mode elpy lsp-ui use-package))) + '(color-identifiers-mode centaur-tabs lsp-pyright magit doom-modeline flycheck-indicator nord-theme powerline rainbow-delimiters python-pytest json-mode company-jedi jedi hl-defined counsel rainbow-identifiers exwm-config all-the-icons-ibuffer slime ivy zerodark-theme zerodark neotree all-the-icons paredit flycheck aggressive-indent aggressive-indent-mode lsp-python-ms py-autopep8 pyenv-mode elpy lsp-ui use-package))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/elisp/modes/default-modes.el b/elisp/modes/default-modes.el index 734d16a..9cd7035 100644 --- a/elisp/modes/default-modes.el +++ b/elisp/modes/default-modes.el @@ -2,9 +2,11 @@ ;;; Code: ;; Easier to identify identifiers +;; The init add-hook seems to be the only way this works. +;; :hook does not work with rainbow identifiers for some reason. (use-package rainbow-identifiers :ensure t - :hook ((prog-mode-hook . rainbow-identifiers-mode))) + :init (add-hook 'prog-mode-hook 'rainbow-identifiers-mode)) ;; Flycheck is enabled globally. (use-package flycheck @@ -31,8 +33,8 @@ :commands (lsp lsp-deferred)) (use-package lsp-ui - :ensure t - :hook (lsp-mode . lsp-ui-mode)) + :ensure t + :hook (lsp-mode . lsp-ui-mode)) (with-eval-after-load 'magit-mode (add-hook 'after-save-hook 'magit-after-save-refresh-status t)) diff --git a/elisp/modes/python-mode-settings.el b/elisp/modes/python-mode-settings.el index 7475166..92b0a81 100644 --- a/elisp/modes/python-mode-settings.el +++ b/elisp/modes/python-mode-settings.el @@ -22,10 +22,9 @@ ;; For Python enable Elpy. (use-package elpy :ensure t - :requires jedi + :defer t :init - (elpy-enable) - (setq elpy-rpc-backend "jedi")) + (advice-add 'python-mode :before 'elpy-enable)) ;; Enable pyenv integration.