Changeset 14976 for dotfiles

Show
Ignore:
Timestamp:
07/01/08 12:03:09 (5 years ago)
Author:
from_kyushu
Message:

エンコーディング関連を追加。表示周りを修正。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dotfiles/vim/from_kyushu/.vimrc

    r14877 r14976  
    1313set number 
    1414set ruler 
     15set ambiwidth=double 
     16set laststatus=2 
    1517 
     18set incsearch 
    1619set nocompatible 
    1720 
     
    5457set wildmenu 
    5558 
     59"横分割時は下へ、縦分割時は右へ新しいウィンドウが開くようにする 
    5660set splitbelow 
     61set splitright 
    5762 
     63"<C-x> <C-a>で増減させるもの 
    5864set nrformats="hex" 
    5965 
    6066let git_diff_spawn_mode=1 
    6167autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=git 
     68 
     69"エンコーディング via kana/dot.vimrc 
     70if !exists('did_encoding_settings') && has('iconv') 
     71  let s:enc_euc = 'euc-jp' 
     72  let s:enc_jis = 'iso-2022-jp' 
     73 
     74  " Does iconv support JIS X 0213 ? 
     75  if iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb" 
     76    let s:enc_euc = 'euc-jisx0213,euc-jp' 
     77    let s:enc_jis = 'iso-2022-jp-3' 
     78  endif 
     79 
     80  " Make fileencodings 
     81  let &fileencodings = 'ucs-bom' 
     82  if &encoding !=# 'utf-8' 
     83    let &fileencodings = &fileencodings . ',' . 'ucs-2le' 
     84    let &fileencodings = &fileencodings . ',' . 'ucs-2' 
     85  endif 
     86  let &fileencodings = &fileencodings . ',' . s:enc_jis 
     87 
     88  if &encoding ==# 'utf-8' 
     89    let &fileencodings = &fileencodings . ',' . s:enc_euc 
     90    let &fileencodings = &fileencodings . ',' . 'cp932' 
     91  elseif &encoding =~# '^euc-\%(jp\|jisx0213\)$' 
     92    let &encoding = s:enc_euc 
     93    let &fileencodings = &fileencodings . ',' . 'utf-8' 
     94    let &fileencodings = &fileencodings . ',' . 'cp932' 
     95  else  " cp932 
     96    let &fileencodings = &fileencodings . ',' . 'utf-8' 
     97    let &fileencodings = &fileencodings . ',' . s:enc_euc 
     98  endif 
     99  let &fileencodings = &fileencodings . ',' . &encoding 
     100 
     101  unlet s:enc_euc 
     102  unlet s:enc_jis 
     103 
     104  let did_encoding_settings = 1 
     105endif