diff options
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | modules/init-python.el | 36 |
2 files changed, 30 insertions, 20 deletions
@@ -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 diff --git a/modules/init-python.el b/modules/init-python.el index cbce258..e5601b2 100644 --- a/modules/init-python.el +++ b/modules/init-python.el @@ -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) |