From beb3997ddb707a6e5371ea6864410675be3115d8 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 28 Oct 2017 20:53:21 +1300 Subject: Move .vimrc 'encoding' to beneath scriptencoding The Vim :help for "scriptencoding" specifies: > If you set the 'encoding' option in your .vimrc, > :scriptencoding must be placed after that. E.g.: > set encoding=utf-8 > scriptencoding utf-8 Also move it into the +multi_byte feature check, though this isn't too important as the :help specifies that the command is ignored if that feature is not available. --- vim/vimrc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 87cf7868..b64e4290 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,9 +1,12 @@ -" This file is UTF-8, of course -scriptencoding utf-8 - " Don't make any effort to be compatible with vi, use more sensible settings set nocompatible +" Use UTF-8 by default wherever possible, including in this file +if has('multi_byte') + set encoding=utf-8 + scriptencoding utf-8 +endif + " If our version isn't ancient and Pathogen is available, call it to load all " the plugins in .vim/bundle; these are saved as submodules if v:version >= 701 @@ -92,11 +95,6 @@ endif " happened to me but who knows, it might one day set fileformats+=mac -" Use UTF-8 by default wherever possible -if has('multi_byte') - set encoding=utf-8 -endif - " Adopt the indent of the last line on new lines; interestingly, plugins that " do clever things with indenting will often assume this is set set autoindent -- cgit v1.2.3