October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 119 | Autocomplete with Context Awareness |
Omni-completion is Vim’s answer to intellisense. It provides a list of suggestions that’s tailored for the context of the cursor position. In this tip, we’ll look at how it works in the context of a CSS file.
Omni-completion is triggered with the <C-x><C-o> command (see compl-omniⓘ). The functionality is implemented as a file-type plugin, so to activate it we have to source these lines of configuration:
| | set nocompatible |
| | filetype plugin on |
We also have to install a plugin that implements omni-completion for the language that we’re working with. Vim ships with support for about a dozen languages, including HTML, CSS, JavaScript, PHP, and SQL. You can find the full list by looking ...