From 2b2cc57a1351e773ec48b7d4cb154b7041d0bd58 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 4 Oct 2013 13:16:43 +0100 Subject: [PATCH] Fixes for console mode vim on Windows. Console vim running on windows supports UTF-8. The vim which ships with GNU On Windows doesn't have the necessary support files for syntax highlighting to work. Wrap "syn enable" in a try..catch block so parsing .vimrc doesn't fail when run by GOW vim. --- .vimrc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 18e34fa..a76c6a0 100644 --- a/.vimrc +++ b/.vimrc @@ -796,7 +796,7 @@ endif "}}}1 if version >= "600" "{{{1 version 6.0 -if has("gui_win32") +if has("win32") || has("win64") se encoding=utf-8 endif @@ -810,7 +810,14 @@ filetype indent on " Less intrusive syntax highlighting. if has("syntax") - syn enable + " The :syntax enable command tries to source the syntax.vim runtime script. + " Parsing this .vimrc will fail if for some reason the runtime doesn't + " exist, as could be the case if the binary was installed with no support + " files. GNU On Windows is one example of an incomplete installation. + try + syn enable + catch + endtry endif " Set colours. -- 2.20.1