Code Completion is an incredible tool to have at your disposal when
done nicely. When done nicely, I should be able to hit
<TAB> to get a dropdown under my cursor
with a list of options. Those options are popuplated by programming
language tooling or by matching against a list of entries. Completion
should be ubiquitous and useful, and should provide as much context as
possible. In particular, programming language auto-completion should
provide as much data about the completion target, what module it is, or
what its type signature is, or the inline documentation if it's short
enough. Given a language with a strong enough type system like Rust, it
should be possible to intuit even templated types.
My current completion system is far from this, and so I am going back
to the first-party recommended configuration for much of this, designed
to integrate with Evil Mode and the Company completion framework.
By default, company supports auto-completion for Emacs Lisp,
Clang, etc, and it can also be extended by languages, and the Emacs
Modes themselves using Completion
at Point Functions.
But what I care about is this:
- Ruby [Ruby and Rails in Emacs]
- Dabbreviations -
These require no work so I include them by default.
- Completion at Point Functions
- Keyword Matching
- Emacs Lisp
These four combined give me basic completion in all buffers, based on words in those buffers (and the dictionary in text-mode), as well as Emacs Lisp. Everything else is defined in those files linked above.
use-package company ( :diminish :configsetq company-backends '(company-capf company-files company-ispell company-elisp company-keywords)) (nil) (setq-default completion-at-point-functions (global-company-mode)"<tab>" . company-complete)) :bind (:map prog-mode-map ("C-<tab>" . company-complete)) :bind (use-package company-prescient :init (company-prescient-mode +1))(