Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vim Autocompletion (v2)

Vim Autocompletion (v2)

Sometimes people miss the IDE-like behavior of getting auto-completion for their code when they switch to Vim, but it doesn't have to be that way: Auto-Completion ("insert expand" mode) opens the door back up to this IDE power tool.

This talk was initially prepared and presented at the June 17, 2015 Baltimore Vim meetup.
The version in this set of slides was revised and presented again at the November 13, 2017 Baltimore Vim meetup.

Stephen Belcher

November 13, 2017
Tweet

More Decks by Stephen Belcher

Other Decks in Technology

Transcript

  1. General Definition • The editor provides, based on context: •

    Suggestions for what to type next • Automatic completion of words/phrases • Documentation or other hints
  2. But Why? • Slow typists have an easier time •

    Lower incidence of typos • You don’t have to remember full APIs in your brain • “Ohh… ahh…” factor
  3. Autocompletion in Vim • Called "Insert Expand" mode • Starts

    in INSERT mode • Initialized with Ctrl-X • Is its own "sub" mode • Has 12 different options for completion method
  4. Autocompletion Modes • Line completion (Ctrl-L) • File Words (Ctrl-N/Ctrl-P)

    • Dictionary Words (Ctrl-K) • Thesaurus Words (Ctrl-T) • Included Words (Ctrl-I) • Tags (Ctrl-]) • Filenames (Ctrl-F) • Definitions/Macros (Ctrl-D) • Vim command-line (Ctrl-V) • User-defined func (Ctrl-U) • Omni Completion (Ctrl-O) • Spelling Suggestions (s)
  5. Additional Information • SuperTab - Plugin for mapping to tabs

    • Can “chain” two autocompletion methods together • :help ins-completion • In-depth documentation on the various completion modes