|
|
@ -186,8 +186,16 @@ There are two things you can do about this warning: |
|
|
|
|
|
|
|
|
|
|
|
;; For Python enable Elpy. |
|
|
|
;; For Python enable Elpy. |
|
|
|
(use-package elpy |
|
|
|
(use-package elpy |
|
|
|
:ensure t |
|
|
|
:ensure t |
|
|
|
:init (elpy-enable)) |
|
|
|
:init (elpy-enable)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Enable pyenv integration. |
|
|
|
|
|
|
|
(use-package pyenv-mode |
|
|
|
|
|
|
|
:config |
|
|
|
|
|
|
|
(pyenv-mode)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Disable elpy default virtualenv (use the pyenv one) |
|
|
|
|
|
|
|
(setq elpy-rpc-virtualenv-path 'current) |
|
|
|
|
|
|
|
|
|
|
|
;;-------------------------------------------------------------------------------------- |
|
|
|
;;-------------------------------------------------------------------------------------- |
|
|
|
;; Save hooks |
|
|
|
;; Save hooks |
|
|
@ -195,6 +203,17 @@ There are two things you can do about this warning: |
|
|
|
|
|
|
|
|
|
|
|
(add-hook 'before-save-hook 'delete-trailing-whitespace) |
|
|
|
(add-hook 'before-save-hook 'delete-trailing-whitespace) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Automagically enable the right pyenv if a .python-version exists |
|
|
|
|
|
|
|
(defun ssbb-pyenv-hook () |
|
|
|
|
|
|
|
"Automatically activates pyenv version if .python-version file exists." |
|
|
|
|
|
|
|
(f-traverse-upwards |
|
|
|
|
|
|
|
(lambda (path) |
|
|
|
|
|
|
|
(let ((pyenv-version-path (f-expand ".python-version" path))) |
|
|
|
|
|
|
|
(if (f-exists? pyenv-version-path) |
|
|
|
|
|
|
|
(pyenv-mode-set (s-trim (f-read-text pyenv-version-path 'utf-8)))))))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;-------------------------------------------------------------------------------------- |
|
|
|
;;-------------------------------------------------------------------------------------- |
|
|
|
;; Keybinds |
|
|
|
;; Keybinds |
|
|
|
;;-------------------------------------------------------------------------------------- |
|
|
|
;;-------------------------------------------------------------------------------------- |
|
|
|