reddit / emacs

Company-mode in Python shell buffer

tty-tourist ยท 2022-05-16 13:44
I use `elpy`, and with that `company-mode` works like a charm in my Python buffers. I would like `company-mode` to work in the buffer running Python shell as well. How do I do that? Below is my attempt so far. As `dabbrev-expand` (M-/) works to expand variables and keywords at point in the Python shell, I would expect `company-mode` to be able to complete with `company-dabbrev` as a backend but it doesn't work. My `company-mode` config (using use-package): (use-package company :ensure t :bind (:map company-active-map ("C-n" . company-select-next) ("C-p" . company-select-previous)) :config (setq company-minimum-prefix-length 3) (setq company-idle-delay 0.0) (setq company-quickhelp-delay 0.0) ;; set default `company-backends' (setq company-backends '((company-files ; files & directory company-keywords ; keywords company-capf) ; completion-at-point-functions (company-abbrev company-dabbrev) )) (global-company-mode t)) **EDIT**: Got it working with these backends (found in [this post](https://www.reddit.com/r/emacs/comments/c63mzr/comment/es6rnro/?utm_source=share&utm_medium=web2x&context=3), so thanks u/UpInHarms/): (setq company-backends '((company-files company-keywords company-capf company-dabbrev-code company-etags company-dabbrev)))