From: Simon Ruderich Date: Tue, 29 Apr 2014 13:35:20 +0000 (+0200) Subject: vimrc: fix syntax when reloading vimrc X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=85752ff8c965dd916dfc4588d15cf9c7ba37e292;p=config%2Fdotfiles.git vimrc: fix syntax when reloading vimrc --- diff --git a/vimrc b/vimrc index 26c4f5f..4860c7f 100644 --- a/vimrc +++ b/vimrc @@ -763,7 +763,11 @@ inoreabbrev completly completely " Activate syntax coloring. if has('syntax') - syntax enable + " But only if it wasn't already active. Prevents breaking the syntax + " coloring when reloading the vimrc. Thanks to johnLate for the idea. + if !exists('g:syntax_on') + syntax enable + endif " Don't highlight more than 500 columns as I normally don't have that long " lines and they slow down syntax coloring. Thanks to Derek Wyatt