Sunday, May 13, 2007

.vimrc

今の.vimrcはこんな感じ

set background=dark
set sw=4
set ts=4
set hlsearch
set incsearch
set nrformats-=octal
set nocompatible
set encoding=utf-8
filetype on
filetype indent on
filetype plugin on
syntax on

"omni key mapping(tabキーでomni補完)
function InsertTabWrapper()
if pumvisible()
return "\"
endif
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k\|<\|/'
return "\"
elseif exists('&omnifunc') && &omnifunc == ''
return "\"
else
return "\\"
endif
endfunction
inoremap =InsertTabWrapper()

"breath comp(括弧を入力したら、閉じ括弧を自動補完)
inoremap { {}
inoremap [ []
inoremap ( ()
inoremap " ""
inoremap ' ''
vnoremap { "zdi^V{z}
vnoremap [ "zdi^V[z]
vnoremap ( "zdi^V(z)
vnoremap " "zdi^V"z^V"
vnoremap ' "zdi'z'

"baffer over yank(バッファ間のヤンクを有効にする)
map sy :call YanktmpYank()
map sp :call YanktmpPaste_p()
map sP :call YanktmpPaste_P()

"(補完メニューの配色。背景=青、選択=水色)
hi Pmenu ctermbg=4
hi PmenuSel ctermbg=6