Skip to content

Instantly share code, notes, and snippets.

@hkuno9000
Last active January 14, 2016 01:30
Show Gist options
  • Save hkuno9000/e71a7c49e8dadba2d2ff to your computer and use it in GitHub Desktop.
Save hkuno9000/e71a7c49e8dadba2d2ff to your computer and use it in GitHub Desktop.
vimrc: 日本語文字化け回避と、ステータス行へ fenc 表示を追加する.
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
@hkuno9000
Copy link
Author

構文ハイライトやカーソル形状を追加設定する.

"=== syntax
syntax on
filetype on
autocmd FileType c,cpp,perl set cindent tabstop=4 shiftwidth=4

"==== color and cursor
set t_Co=256
" FORM <http://qiita.com/usamik26/items/f733add9ca910f6c5784>
let &t_ti.="\e[1 q"
let &t_SI.="\e[5 q"
let &t_EI.="\e[1 q"
let &t_te.="\e[0 q"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment