From: Simon Ruderich Date: Sat, 18 Feb 2012 22:53:53 +0000 (+0100) Subject: vimrc: Move all autocmds in the vimrc augroup. X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=commitdiff_plain;h=52e793545b43ad189835c89778615acae48fd12b vimrc: Move all autocmds in the vimrc augroup. --- diff --git a/vimrc b/vimrc index 15660a4..95a5631 100644 --- a/vimrc +++ b/vimrc @@ -79,6 +79,14 @@ if exists('+cryptmethod') set cryptmethod=blowfish endif +" Clear all vimrc-related autocmds. Has to be done here as the vimrc augroup +" is used multiple times. +if has('autocmd') + augroup vimrc + autocmd! + augroup END +endif + " EDIT SETTINGS @@ -422,10 +430,12 @@ if has('syntax') " 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 + augroup vimrc + autocmd FileType * + \ if &omnifunc == '' | + \ setlocal omnifunc=syntaxcomplete#Complete | + \ endif + augroup END endif " Highlight lines longer than 78 characters. Thanks to Tony Mechelynck @@ -507,8 +517,6 @@ endif " twice. if has('autocmd') augroup vimrc -" Remove all autocmds from the current group. - autocmd! " Go to last position of opened files. Taken from :help last-position-jump. autocmd BufReadPost *