Hatena::ブログ(Diary)

goinger的日記

2007年04月08日

[vim] vimrcの設定

windowsmaccolinuxfreebsdで全部ばらばらに設定してあるw 同期とかしてないとわけがわからなくなるのでテスト用にwinのを貼っとく。 根がいい加減なので適当な状態のままなのでこれから改造していく.

set nocompatible

source $VIMRUNTIME/vimrc_example.vim

source $VIMRUNTIME/mswin.vim

behave mswin

set diffexpr=MyDiff()

function MyDiff()

let opt = '-a --binary '

if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif

if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif

let arg1 = v:fname_in

if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif

let arg2 = v:fname_new

if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif

let arg3 = v:fname_out

if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif

let eq = ''

if $VIMRUNTIME =~ ' '

if &sh =~ '\<cmd'

let cmd = '""' . $VIMRUNTIME . '\diff"'

let eq = '"'

else

let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'

endif

else

let cmd = $VIMRUNTIME . '\diff'

endif

silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq

endfunction

set ts=4 sw=4 sts=0

set number

set columns=100

set lines=50

set guioptions-=T

sy on

gui

set vb t_vb=

set guifont=Osaka−等幅:h12

set hidden

set wildmode=list:full

set history=100

"日本語化設定

set encoding=japan

"ファイルの漢字コード自動判別のため必要(用iconv)

if has('iconv')

set fileencodings+=iso-2022-jp

set fileencodings+=utf-8,ucs-2le,ucs-2

if &encoding ==# 'euc-jp'

set fileencodings+=cp932

else

set fileencodings+=euc-jp

endif

endif

gui

colorscheme darkblue

highlight LineNr ctermfg=darkyellow

highlight Comment ctermfg=DarkRed

"検索時の区別なし

set ignorecase

"大文字のときは区別あり

set smartcase

set incsearch

" コマンドモード

cnoremap <C-F> <Right>

cnoremap <C-B> <Left>

" dictionary setting

autocmd FileType php :set dictionary=$HOME/PHP.dict

autocmd FileType rb :set dictionary=$HOME/Ruby.dict

autocmd FileType pl :set dictionary=$HOME/Perl.dict

autocmd FileType html, htm :set dictionary=$HOME/html.dict

autocmd FileType py :set dictionary=$HOME/Python.dict

autocmd FileType c :set dictionary=$HOME/c.dict

autocmd FileType cc :set dictionary=$HOME/c++.dict

" search setting

"omnifunction

autocmd FileType python set omnifunc=pythoncomplete#Complete

autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS

autocmd FileType html set omnifunc=htmlcomplete#CompleteTags

autocmd FileType css set omnifunc=csscomplete#CompleteCSS

autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags

autocmd FileType php set omnifunc=phpcomplete#CompletePHP

autocmd FileType c set omnifunc=ccomplete#Complete

"plugin settings

set nocompatible

source $VIMRUNTIME/vimrc_example.vim

source $VIMRUNTIME/mswin.vim

behave mswin

set diffexpr=MyDiff()

function MyDiff()

let opt = '-a --binary '

if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif

if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif

let arg1 = v:fname_in

if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif

let arg2 = v:fname_new

if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif

let arg3 = v:fname_out

if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif

let eq = ''

if $VIMRUNTIME =~ ' '

if &sh =~ '\<cmd'

let cmd = '""' . $VIMRUNTIME . '\diff"'

let eq = '"'

else

let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'

endif

else

let cmd = $VIMRUNTIME . '\diff'

endif

silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq

endfunction

set ts=4 sw=4 sts=0

set number

set columns=100

set lines=50

set guioptions-=T

sy on

gui

set vb t_vb=

set guifont=Osaka−等幅:h12

set hidden

set wildmode=list:full

set history=100

"日本語化設定

set encoding=japan

"ファイルの漢字コード自動判別のため必要(用iconv)

if has('iconv')

set fileencodings+=iso-2022-jp

set fileencodings+=utf-8,ucs-2le,ucs-2

if &encoding ==# 'euc-jp'

set fileencodings+=cp932

else

set fileencodings+=euc-jp

endif

endif

gui

colorscheme darkblue

highlight LineNr ctermfg=darkyellow

highlight Comment ctermfg=DarkRed

"検索時の区別なし

set ignorecase

"大文字のときは区別あり

set smartcase

set incsearch

" コマンドモード

cnoremap <C-F> <Right>

cnoremap <C-B> <Left>

" dictionary setting

autocmd FileType php :set dictionary=$HOME/PHP.dict

autocmd FileType rb :set dictionary=$HOME/Ruby.dict

autocmd FileType pl :set dictionary=$HOME/Perl.dict

autocmd FileType html, htm :set dictionary=$HOME/html.dict

autocmd FileType py :set dictionary=$HOME/Python.dict

autocmd FileType c :set dictionary=$HOME/c.dict

autocmd FileType cc :set dictionary=$HOME/c++.dict

" search setting

"omnifunction

autocmd FileType python set omnifunc=pythoncomplete#Complete

autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS

autocmd FileType html set omnifunc=htmlcomplete#CompleteTags

autocmd FileType css set omnifunc=csscomplete#CompleteCSS

autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags

autocmd FileType php set omnifunc=phpcomplete#CompletePHP

autocmd FileType c set omnifunc=ccomplete#Complete

"plugin settings


miguel - Chilemiguel - Chile 2007/11/21 02:27 Great!! gracias XD

スパム対策のためのダミーです。もし見えても何も入力しないでください
ゲスト


画像認証

トラックバック - http://d.hatena.ne.jp/goinger/20070408/1175997423