lang/python: load anaconda-mode a little sooner
So its hooks take effect in the first buffer.
This commit is contained in:
parent
a6d77e951f
commit
26f9e2cdeb
1 changed files with 7 additions and 5 deletions
|
@ -84,14 +84,10 @@ called.")
|
|||
|
||||
|
||||
(use-package! anaconda-mode
|
||||
:defer t
|
||||
:after python
|
||||
:init
|
||||
(setq anaconda-mode-installation-directory (concat doom-etc-dir "anaconda/")
|
||||
anaconda-mode-eldoc-as-single-line t)
|
||||
(add-hook! 'python-mode-local-vars-hook
|
||||
(defun +python-init-anaconda-mode-maybe-h ()
|
||||
(unless (bound-and-true-p lsp-mode)
|
||||
(anaconda-mode +1))))
|
||||
:config
|
||||
(add-hook 'anaconda-mode-hook #'anaconda-eldoc-mode)
|
||||
(set-company-backend! 'anaconda-mode '(company-anaconda))
|
||||
|
@ -101,6 +97,12 @@ called.")
|
|||
:documentation #'anaconda-mode-show-doc)
|
||||
(set-popup-rule! "^\\*anaconda-mode" :select nil)
|
||||
|
||||
(add-hook! 'python-mode-local-vars-hook
|
||||
(defun +python-init-anaconda-mode-maybe-h ()
|
||||
"Enable `anaconda-mode' if `lsp-mode' isn't."
|
||||
(unless (bound-and-true-p lsp-mode)
|
||||
(anaconda-mode +1))))
|
||||
|
||||
(defun +python-auto-kill-anaconda-processes-h ()
|
||||
"Kill anaconda processes if this buffer is the last python buffer."
|
||||
(when (and (eq major-mode 'python-mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue