[Emacs] Remove unused python packages

This commit is contained in:
Kat Huang 2023-07-29 00:24:25 +00:00
parent 32ab2b8ac4
commit 106a72c4da

View File

@ -2268,20 +2268,6 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
:commands python-mode :commands python-mode
:mode ("\\.py\\'" . python-mode) :mode ("\\.py\\'" . python-mode)
:preface :preface
(progn
(defun imalison:jedi-setup ()
;; TODO: This was likely fixed and can probably be removed
;; Somehow this is sometimes set to jedi:ac-setup which we
;; don't want. This binding avoids starting auto-complete mode.
(let ((jedi:setup-function nil))
(jedi:setup))
;; XXX: This has become pretty annoying
;; (add-hook 'before-save-hook 'pyimport-remove-unused t t)
;; Only use company-jedi for completion
(set (make-local-variable 'company-backends) '(company-jedi)))
(defun imalison:python-mode () (defun imalison:python-mode ()
(setq show-trailing-whitespace t) (setq show-trailing-whitespace t)
;; Remove default python completion, as we are going to rely on ;; Remove default python completion, as we are going to rely on
@ -2289,8 +2275,7 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
;; (remove-hook 'completion-at-point-functions ;; (remove-hook 'completion-at-point-functions
;; 'python-completion-complete-at-point 'local) ;; 'python-completion-complete-at-point 'local)
(if imalison:use-lsp-python (if imalison:use-lsp-python
(lsp-deferred) (lsp-deferred)))
(imalison:jedi-setup))))
:config :config
(progn (progn
(use-package lsp-mode (use-package lsp-mode
@ -2302,36 +2287,6 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
(unbind-key "C-j" python-mode-map) (unbind-key "C-j" python-mode-map)
(add-hook 'python-mode-hook #'imalison:python-mode))) (add-hook 'python-mode-hook #'imalison:python-mode)))
#+END_SRC #+END_SRC
**** pippel
pippel lets one manage pip packages
#+BEGIN_SRC emacs-lisp
(use-package pippel
:defer t)
#+END_SRC
**** pyimport
Pyimport is disabled because it may be causing a performance problem.
#+BEGIN_SRC emacs-lisp
(use-package pyimport
:disabled t
:bind (:map python-mode-map
("C-c C-i" . pyimport-insert-missing))
:commands pyimport-remove-unused)
#+END_SRC
**** jedi
The accepted way to use jedi if you prefer company to auto-complete is
simply to require the company jedi package, which is why we make no
reference to the jedi-core package.
#+BEGIN_SRC emacs-lisp
(use-package company-jedi
:commands (jedi:goto-definition jedi-mode company-jedi)
:bind (:map python-mode-map
("M-." . jedi:goto-definition)
("M-," . jedi:goto-definition-pop-marker))
:config
(progn
(setq jedi:complete-on-dot t)
(setq jedi:imenu-create-index-function 'jedi:create-flat-imenu-index)))
#+END_SRC
*** go *** go
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package go-mode (use-package go-mode