Emacs: Name Completion Features ＆ Packages
Here are some nice name completion related features. The following works in minibuffer.
→ (in emacs 22, obsolete in emacs 24.4. Replaced by
icomplete-mode) completion for switching buffers or opening files. I used it since 2008.
ido-mode→ (in emacs 22) superset of iswitchb-mode for files. The interface is a bit unusual, gets some used to. I started to use ido instead of iswitchb in 2012.
icomplete-mode→ (in emacs) 10 years old package, still excellent, complementing the above, especially for
describe-variable, which the above doesn't do. If you really want just basic completion, use this.
Completion for coding:
abbrev-mode(in emacs) → Statically expand pre-defined set of strings. Expansion is automatically on Space or Enter ↵. No fancy interface. Excellent. 〔➤see Emacs: Abbrev Mode Tutorial〕
hippie-expand(in emacs) → Expand any string that occurs in existing buffers. Excellent. You need to give it a key. 〔➤see Emacs: How to Define Keys〕 Press once to expand. Press again to switch to next choice. Can be used anywhere, including in minibuffer.
auto-completemode. → For expanding keywords in programing languages. When you type, suggestions automatically shows as gray text. Press Enter ↵ to complete. The keywords are from a pre-defined set of files. When in elisp, it also pops a contextual menu with inline-documentation. Excellent.
- YASnippet mode. “yas/expand”. → By default, press Tab ↹ to complete. Expansion based on templates, for expanding not just function names but also its parameters or syntactical structure. 〔➤see Emacs: Using Templates with YASnippet〕
I use all of the above. For auto-complete and YASnippet, you need to install them, they are in MELPA repository. 〔➤see Emacs: How to Install Packages Using ELPA, MELPA〕
Here's some other related to completion but i haven't used.
- “emacs helm” (aka “anything”) http://www.emacswiki.org/Anything. Idea originally based on Mac's QuickSilver tool i think.
- “icicles”. One most comprehensive completion system. Fairly complex, requires some learning, but i heard it's the most powerful. 〔➤see Emacs: Power of Icicles〕
thx to Ba Manzi (杨贵龙)