Completion using a syntax file
Talk0
1,599pages on
this wiki
this wiki
Revision as of 23:04, January 7, 2011 by Trcollinson (Talk | contribs)
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')