In windows, replace the _ vimrc file in the installation directory with the following code: set nocompatiblesource $ VIMRUNTIME/vimrc_example.vimsource $ VIMRUNTIME/mswin. vimbehave mswin www.2cto.com set diffexpr = MyDiff () function MyDiff () let opt = '-a -- binary' if & diffopt = ~ 'Icase' | let opt = opt. '-I' | endif if & diffopt = ~ 'Iwhite' | let opt = opt. '-B' | endif let arg1 = v: fname_in if arg1 = ~ ''| Let arg1 = '"'. arg1. '"' | endif let arg2 = v: fname_new if arg2 = ~ ''| Let arg2 = '"'. arg2. '"' | endif let arg3 = v: fname_out if arg3 = ~ ''| Let arg3 = '"'. arg3. '"' | endif let eq =''
If $ VIMRUNTIME = ~ ''If & sh = ~ '\ <Cmd' let cmd = '""'. $ VIMRUNTIME. '\ diff "'Let eq ='" 'else let cmd = substitute ($ VIMRUNTIME ,'','"',''). '\ diff "' endif else let cmd = $ VIMRUNTIME. '\ diff 'endif silent execute '! '. Cmd. ''. opt. arg1. ''. arg2. '> '. arg3. eqendfunction www.2cto.com "solves Chinese garbled characters in windows" "set encoding = UTF-8" set termencoding = utf-8set fileencodings = ucs -bom, UTF-8, chinese, latin-1if has ("win32") set fileencoding = chineseelseset fileencoding = utf-8endif "solve chinese menu garbled set langmenu = zh_CN.utf-8source $ VIMRUNTIME/delmenu. vimsource $ VIMRUNTIME/menu. vim "addresses console output garbled language messages zh_cn.utf-8