More than 5 years have passed since last update.

kaoriya gvim

"バックアップdir設定

set backupdir=$VIM/bak

"swpファイル生成dir指定
let &directory = &backupdir

"undoファイル出力先
set undodir=$VIM/undo

let $mydoc='$HOME/My Documents'
let $desktop='$HOME/デスクトップ'

"初期カレントディレクトリの設定
:cd $desktop

function! GetB()
let c = matchstr(getline('.'), '.', col('.') - 1)
let c = iconv(c, &enc, &fenc)
return String2Hex(c)
endfunction
" :help eval-examples
" The function Nr2Hex() returns the Hex string of a number.
func! Nr2Hex(nr)
let n = a:nr
let r = ""
while n
let r = '0123456789ABCDEF'[n % 16] . r
let n = n / 16
endwhile
return r
endfunc
" The function String2Hex() converts each character in a string to a two
" character Hex string.
func! String2Hex(str)
let out = ''
let ix = 0
while ix < strlen(a:str)
let out = out . Nr2Hex(char2nr(a:str[ix]))
let ix = ix + 1
endwhile
return out
endfunc
"ステータスラインに文字コードと改行文字を表示する
if winwidth(0) >= 120
set statusline=[%n]%1*%m%*%r%h%w%{'['.(&fenc!=''?&fenc:&enc).':'.&ff.']'}%y\ %F%=[%<%{fnamemodify(getcwd(),':~')}]%-8([%{GetB()}]%)\ %-11(%l,%c%V%)\ %4P
else
set statusline=[%n]%1*%m%*%r%h%w%{'['.(&fenc!=''?&fenc:&enc).':'.&ff.']'}%y\ %f%=[%<%{fnamemodify(getcwd(),':~')}]%-8([%{GetB()}]%)\ %-11(%l,%c%V%)\ %4P
endif

set number
set noautoindent
set cindent
set expandtab
set tabstop=4
set shiftwidth=4
set ruler
set list
set nowrap
set guifont=ゆたぽん(コーディング)Backsl:h12:cSHIFTJIS

set fileencoding=utf-8
set fileformat=dos