Last active
January 14, 2016 01:30
-
-
Save hkuno9000/e71a7c49e8dadba2d2ff to your computer and use it in GitHub Desktop.
vimrc: 日本語文字化け回避と、ステータス行へ fenc 表示を追加する.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set enc=utf-8 | |
set fencs=ucs-bom,iso-2022-jp,euc-jp,sjis,utf-8 | |
set fileformats=unix,dos,mac | |
set laststatus=2 | |
set statusline=%<%F%h%m%r\ [%Y][%{&ff}][%{&fenc!=''?&fenc:&enc}:0x\%02.6B]%=%l,%c%V\ %P | |
" FROM <http://www.kawaz.jp/pukiwiki/?vim> | |
" if fenc is iso-2022-jp and buffer is ascii only then change fenc as enc | |
" if this failed, do :e ++enc=utf-8 | |
if has('autocmd') | |
function! AU_ReCheck_FENC() | |
if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0 | |
let &fileencoding=&encoding | |
endif | |
endfunction | |
autocmd BufReadPost * call AU_ReCheck_FENC() | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
構文ハイライトやカーソル形状を追加設定する.