Vim Tips Wiki

Completion using a syntax file

Revision as of 23:04, January 7, 2011 by Trcollinson (Talk | contribs)

1,619pages 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 Also


Around Wikia's network

Random Wiki