Wikia

Vim Tips Wiki

Completion using a syntax file

Talk0
1,613pages on
this wiki
Tip 498 Printable Monobook Previous Next

created 2003 · complexity intermediate · author Daniel Molina · version 6.0


To use the Vim completion a user can use a dictionary like so:

:set complete=k

With a dictionary the user can use a syntax file (which are commonly stored in the /syntax/ directory), so that the user can complete reserved words for a particular language. If the user would like to automatically load a syntax file from the /syntax/ directory for the particular filetype they are working on, the following line can be inserted into the .vimrc file:

au FileType * exe('setl dict+='.$VIMRUNTIME.'/syntax/'.&filetype.'.vim')

See AlsoEdit

CommentsEdit

Around Wikia's network

Random Wiki