summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--home/xyz/.config/nvim/init.vim10
1 files changed, 8 insertions, 2 deletions
diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim
index 7bef3b6c..8c1f06f3 100644
--- a/home/xyz/.config/nvim/init.vim
+++ b/home/xyz/.config/nvim/init.vim
@@ -89,8 +89,14 @@ set shiftwidth=4 " number of spaces to use for autoindent
"set expandtab " tabs are space
" https://www.zhihu.com/question/22363620/answer/21199296
-" last line seems is default to neovim but not vim
-set fileencodings=ucs-bom,utf-8,utf-16,gbk,big5,gb18030,latin1
+" euc-cn=gb2312, cp936=gbk
+" it is recommended by `:h fileencodings` to put ucs-bom at first and latin1 at last
+" based on my experience, if put utf-16 in front of euc-cn, euc-cn will have mojibake
+" based on my experience, if put big5 in front of euc-cn and cp936, euc-cn will have mojibake
+" according to zhihu comment, if put gb18030 in front of big5 , big5 will have mojibake
+" according to wikipedia articles, euc-cn is preceded by cp936 which is preceded by gb18030, gb18030 is backward compatible with cp936 which seems is backward compatible with euc-cn
+set fileencodings=ucs-bom,utf-8,euc-cn,cp936,big5,gb18030,utf-16,latin1
+" seems is default to neovim but not vim
set encoding=utf-8
" some file on win10 display as unix but is dos