reddit / emacs

How do I change the autocomplete results I see?

SteveTheGreate · 2022-12-17 17:41
I'm using lsp-mode in python, and I get autocompletion with corfu. The completion is good, though I was wondering if it is possible to change certain ones. For example, if I'm doing a def \_\_init\_\_() in python, I would like to have "self, " automatically be put inside the parentheses. ​ Also, is there a way to enable dictionary completions in python? If I have a text document open, and I start typing a word similar to one already in the document, I get the suggestion, but this is not the case when working in a python file. ​ Any and all help would be greatly appreciated.
andyjda · 2022-12-18 02:01
For the first question, I would look into a template system like [Yasnippet](https://github.com/joaotavora/yasnippet) or [tempo](https://www.gnu.org/software/emacs/manual/html_node/autotype/Tempo.html). I think that’s the best approach for it, and I’m not sure if you can do it with completion methods like corfu