aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-28 20:53:21 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-28 20:53:21 +1300
commitbeb3997ddb707a6e5371ea6864410675be3115d8 (patch)
treef8eb7efbce056b54918b03ee4750fc76d5e6b8aa
parentMerge branch 'port/bsd/netbsd' (diff)
downloaddotfiles-beb3997ddb707a6e5371ea6864410675be3115d8.tar.gz
dotfiles-beb3997ddb707a6e5371ea6864410675be3115d8.zip
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.
-rw-r--r--vim/vimrc14
1 files 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