|
|
|
@ -19,14 +19,30 @@
|
|
|
|
|
(pyenv-mode-set pyenv-current-version) |
|
|
|
|
(message (concat "Setting virtualenv to " pyenv-current-version)))))))) |
|
|
|
|
|
|
|
|
|
;; Right now this will require M-x jedi:install-server |
|
|
|
|
;; to use it in a project. |
|
|
|
|
;; TODO: Do the server installation automatically. |
|
|
|
|
(use-package jedi |
|
|
|
|
:ensure t |
|
|
|
|
:hook (python-mode . jedi:setup) |
|
|
|
|
:init |
|
|
|
|
(setq jedi:complete-on-dot t)) |
|
|
|
|
|
|
|
|
|
(use-package company-jedi |
|
|
|
|
:ensure t |
|
|
|
|
:requires jedi |
|
|
|
|
:hook (python-mode . company-jedi)) |
|
|
|
|
|
|
|
|
|
;; For Python enable Elpy. |
|
|
|
|
(use-package elpy |
|
|
|
|
:ensure t |
|
|
|
|
:init (elpy-enable)) |
|
|
|
|
(setq elpy-rpc-backend "jedi") |
|
|
|
|
(setq jedi:complete-on-dot t) |
|
|
|
|
;; Enable pyenv integration. |
|
|
|
|
:requires jedi |
|
|
|
|
:init |
|
|
|
|
(elpy-enable) |
|
|
|
|
(setq elpy-rpc-backend "jedi")) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Enable pyenv integration. |
|
|
|
|
(if (executable-find "pyenv") |
|
|
|
|
(use-package pyenv-mode |
|
|
|
|
:ensure t |
|
|
|
@ -49,10 +65,6 @@
|
|
|
|
|
(if (executable-find "pyenv") |
|
|
|
|
(add-hook 'python-mode-hook 'pyenv-activate-current-project)) |
|
|
|
|
|
|
|
|
|
;; Add company-jedi hook to python mode |
|
|
|
|
(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))) |
|
|
|
|
(use-package lsp-python-ms |
|
|
|
|