From: Simon Ruderich Date: Sat, 14 Jan 2012 20:28:59 +0000 (+0100) Subject: vimrc: Use syntax based omni completion. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=8f6271e82d1eb26df1cb89a34633cc194281cde3;p=config%2Fdotfiles.git vimrc: Use syntax based omni completion. --- diff --git a/vimrc b/vimrc index bb0bfe6..3d75498 100644 --- a/vimrc +++ b/vimrc @@ -404,6 +404,15 @@ if has('syntax') set synmaxcol=500 endif +" Use (limited) syntax based omni completion if no other omni completion is +" available. Taken from :help ft-syntax-omni. + if has('autocmd') && exists('+omnifunc') + autocmd FileType * + \ if &omnifunc == '' | + \ setlocal omnifunc=syntaxcomplete#Complete | + \ endif + endif + " Highlight lines longer than 78 characters. Thanks to Tony Mechelynck " from the Vim mailing list. It can easily be " disabled when necessary with :2match (in Vim >= 700).