aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-18 20:29:01 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-18 20:29:01 +1200
commit5d2f419f6572250b6c7b2ad495c69bb6ad1e6171 (patch)
treeb9ae533eeb676199b206d53aacdca67ae67064f7 /vim/vimrc
parentMerge branch 'release/v6.28.0' into develop (diff)
downloaddotfiles-5d2f419f6572250b6c7b2ad495c69bb6ad1e6171.tar.gz
dotfiles-5d2f419f6572250b6c7b2ad495c69bb6ad1e6171.zip
Extend default 'encoding' check in vimrc
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc5
1 files changed, 3 insertions, 2 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 68d30b59..bca31093 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -41,9 +41,10 @@
" to a multibyte (UTF-8) locale. This informs Vim's choice of internal
" character encoding, but the default for the 'encoding' option in LANG's
" absence is "latin1". Nowadays, this is never what I want, so we'll manually
-" choose "utf-8" as an encoding instead if LANG is not defined.
+" choose "utf-8" as an encoding instead if the encoding is the default
+" 'latin1', and LANG is not defined.
"
-if !exists('$LANG')
+if &encoding ==# 'latin1' && !exists('$LANG')
set encoding=utf-8
endif
scriptencoding utf-8