vim:PHP(またはその他の言語)エディタとして使う場合の設定メモ
※Windows上で使う場合ツ黴
※ツ黴php.dic(PHP関数辞書)をD:\vim\php.dic’置いた場合
まず、autocomplpop.vimをruntime/plugin に置く
以下をvimrcに記述ツ黴
“タブをスペースに変換
set expandtab
“行番号表示
set number
“<TAB>で補完
” {{{ Autocompletion using the TAB key
” This function determines, wether we are on the start of the line text (then tab indents) or
” if we want to try autocompletion
function! InsertTabWrapper()
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 let col = col(’.') - 1
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 if !col || getline(’.')[col - 1] !~ ‘\k’
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 return “\<TAB>”
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 else
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 if pumvisible()
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 return “\<C-N>”
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 else
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 return “\<C-N>\<C-P>”
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 end
ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴ツ黴 endif
endfunction
” Remap the tab key to select action with InsertTabWrapper
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
” }}} Autocompletion using the TAB key
“Vimで括弧/クォートを自動補完
inoremap { {}<LEFT>
inoremap [ []<LEFT>
inoremap ( ()<LEFT>
inoremap ” “”<LEFT>
inoremap ‘ ”<LEFT>
vnoremap { “zdi^V{<C-R>z}<ESC>
vnoremap [ “zdi^V[<C-R>z]<ESC>
vnoremap ( “zdi^V(<C-R>z)<ESC>
vnoremap ” “zdi^V”<C-R>z^V”<ESC>
vnoremap ‘ “zdi’<C-R>z’<ESC>
“自動補完
autocmd FileType * let g:AutoComplPop_CompleteOption = ‘.,w,b,u,t,i’
autocmd FileType php let g:AutoComplPop_CompleteOption = ‘.,w,b,u,t,i,kD:\vim\php.dic’
let g:AutoComplPop_IgnoreCaseOption = 1
トラックバック URL :
コメント (0)