[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,29 +2268,14 @@ 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:python-mode ()
(defun imalison:jedi-setup () (setq show-trailing-whitespace t)
;; TODO: This was likely fixed and can probably be removed ;; Remove default python completion, as we are going to rely on
;; Somehow this is sometimes set to jedi:ac-setup which we ;; company-jedi or company-lsp.
;; don't want. This binding avoids starting auto-complete mode. ;; (remove-hook 'completion-at-point-functions
(let ((jedi:setup-function nil)) ;; 'python-completion-complete-at-point 'local)
(jedi:setup)) (if imalison:use-lsp-python
(lsp-deferred)))
;; 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 ()
(setq show-trailing-whitespace t)
;; Remove default python completion, as we are going to rely on
;; company-jedi or company-lsp.
;; (remove-hook 'completion-at-point-functions
;; 'python-completion-complete-at-point 'local)
(if imalison:use-lsp-python
(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