Emacs: Name Completion
Programing Language Name Completion
Best is to install
company-mode from MELPA.
Emacs Builtin Completion Commands
The following builtin commands do completion.
is for completing the current name.
This works best in
(you should install
hippie-expand is for expanding any string that occurs in existing buffers. You need to give it a key.
Press once to expand. Press again to switch to next choice. Can be used anywhere, including in minibuffer.
Here's hippie expand setup:
(setq hippie-expand-try-functions-list '( try-expand-dabbrev try-expand-dabbrev-all-buffers ;; try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol try-complete-file-name-partially try-complete-file-name ;; try-expand-all-abbrevs ;; try-expand-list ;; try-expand-line ))
abbrev-mode is for expanding any sequence of few characters to full words or template.
You define the abbrevs yourself.
Abbrev can be used for English word such as [int → international], your company name, or copyright template, or programing language function templates, or special characters such as [alpha → α].
Expansion is done when pressing Space, or Enter, or any punctuation character.
Completion for Minibuffer Prompts
ido-mode→ does auto completion in minibuffer, for switching buffer and opening file.
icomplete-mode→ For all minibuffer prompt completion.
[see Emacs: Ido Mode]
[see Emacs: Icomplete Mode]
2012-11-29 thanks to Ba Manzi (杨贵龙) for a tip.