replace Jedi for pyvenv

https://github.com/jorgenschaefer/pyvenv
This commit is contained in:
Jesús 2019-05-17 10:19:38 -05:00
parent 3dd0dae028
commit ca22ba0f65
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766
2 changed files with 30 additions and 20 deletions

View File

@ -51,8 +51,16 @@ Neotree comes by default in combination with all-the-icons.
So pressing `[f8]` will display (you must give "yes") a one-time screen to install all-the-icons fonts.
### Mode Python
- Require installed virtualenv, example:
- Require installed virtualenv:
`pacman -S python-virtualenv`
pacman -S python-virtualenv
`M-x jedi:install-server [RET]`
- Enable or disable pyvenv-mode: <kdb>M-x</kdb> pyvenv-mode
- To create virtualenv from emacs:
pyvenv-create
- To activate virtualenv from emacs:
pyvenv-activate

View File

@ -12,28 +12,30 @@
(setq python-indent-guess-indent-offset nil)
(setq python-indent-offset 4)))
;;----------------------------------------------------------------------------
;; Jedi - Python auto-completion for Emacs
;;----------------------------------------------------------------------------
(use-package jedi)
(use-package python
:mode ("\\.py" . python-mode)
:config
(use-package elpy
:init
(add-to-list 'auto-mode-alist '("\\.py$" . python-mode))
:config
(setq elpy-rpc-backend "jedi")
:bind (:map elpy-mode-map
("M-." . elpy-goto-definition)
("M-," . pop-tag-mark)))
(elpy-enable))
(setq auto-mode-alist
(append '(("SConstruct\\'" . python-mode)
("SConscript\\'" . python-mode))
auto-mode-alist))
(use-package pip-requirements)
(defun my/python-mode-stuff ()
"Jedi make everything a lot easier for everybody!.
It's helps prepare jedi in Emacs."
(jedi:setup)
(define-key python-mode-map (kbd "C-]") 'jedi:goto-definition) ;goto define
(local-set-key (kbd "<f1>") 'jedi:show-doc)
(setq jedi:complete-on-dot t) ; optional
)
;; Added Jedi-mode to python-mode
(add-hook 'python-mode-hook 'my/python-mode-stuff)
;; M-x jedi:install-server
(use-package pip-requirements
:config
(add-hook 'pip-requirements-mode-hook #'pip-requirements-auto-complete-setup))
(use-package py-autopep8)
(use-package pyvenv)
(provide 'init-python)