aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-21 02:03:34 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-21 02:03:34 +1200
commite04fe64dcffd570eedbba46e17b03b85afbcb63f (patch)
treec0335ac2c05e08e3d3cf4929e8635424b86736d3 /vim/vimrc
parentRemove unneeded UNIX test (diff)
downloaddotfiles-e04fe64dcffd570eedbba46e17b03b85afbcb63f.tar.gz
dotfiles-e04fe64dcffd570eedbba46e17b03b85afbcb63f.zip
Correct logic on 'encoding' selection
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc7
1 files changed, 3 insertions, 4 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 1f71e4ea..9b3017e2 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -67,10 +67,9 @@ if has('win32') || has('win64')
set directory^=~/vimfiles/cache/swap//
endif
-" Default to UTF-8 unless $LANG can convince us otherwise
-silent! set encoding=utf-8
-if &encoding ==# 'utf-8' && exists('$LANG')
- set encoding&
+" Use UTF-8 if we can and env LANG didn't tell us not to
+if has('multi_byte') && !exists('$LANG') && &encoding ==# 'latin1'
+ set encoding=utf-8
endif
" Don't wait for a key after Escape in insert mode