From 52e793545b43ad189835c89778615acae48fd12b Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 18 Feb 2012 23:53:53 +0100 Subject: [PATCH] vimrc: Move all autocmds in the vimrc augroup. --- vimrc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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 * -- 2.45.2