D Strozzi
D Strozzi

Reputation: 180

Disable auto completion of python code in emacs with elpy

I am new to using elpy, an emacs package for working with Python. I am not a fan of auto-complete in general, and the YAsnippet tool elpy uses in particular. How can I disable it? I found on the web I should do (delete 'elpy-module-yasnippet elpy-modules) before elpy is enabled. But I have a chicken and egg problem that this var is undefined before I load elpy! Here is my init.el, cut down to a minimal set of relevant lines:

(package-initialize)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(require 'use-package)

(custom-set-variables
 '(package-selected-packages (quote (elpy python-mode)))
)

(use-package elpy
  :ensure t
  :defer t
  :init
  (advice-add 'python-mode :before 'elpy-enable)
)

;; disable YAsnippet code completion in elpy
;(delete 'elpy-module-yasnippet elpy-modules)

Upvotes: 0

Views: 168

Answers (1)

shynur
shynur

Reputation: 451

If the crux of your problem is indeed

I have a chicken and egg problem that this var is undefined before I load elpy!

Then the solution is

(with-eval-after-load 'elpy
  (delete 'elpy-module-yasnippet elpy-modules))

Upvotes: 2

Related Questions