2007年04月08日
■ [vim] vimrcの設定
windowsとmacとcolinuxとfreebsdで全部ばらばらに設定してある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
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
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
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
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
- 7 http://d.hatena.ne.jp/keyworddiary/Ruby
- 5 http://d.hatena.ne.jp/keyword/minori
- 4 http://d.hatena.ne.jp/keyword/涼宮ハルヒ
- 3 http://d.hatena.ne.jp/keyword/涼宮ハルヒの憂鬱
- 3 http://d.hatena.ne.jp/keyword/Ruby
- 3 http://d.hatena.ne.jp/keyworddiary/Python
- 3 http://localhost/freshreader/feedshow.php?h=526d88588b38&c=c99436b
- 3 http://vim.g.hatena.ne.jp/
- 2 http://d.hatena.ne.jp/keyword/ニコニコ動画
- 2 http://d.hatena.ne.jp/keyword/PeerCast
