2007-03-31

vimrc

結局iTerm上でvimを使う方が多い訳ですが、0.9.5.0315での問題点は「●」や「→」が何故か表示幅が半角扱い。でもvim上は全角なので表示がずれる。 あとインライン変換のフォントサイズがウィンドウ内と異なるので変換後にインラインウィンドウのかけらが残る。

.vimrc ぱくりまくり。
set nocompatible

set enc=utf-8
set fenc=utf-8
set fencs=iso-2022-jp,euc-jp,cp932
set ambiwidth=double

set ignorecase
set smartcase
set wrapscan
set incsearch
set hlsearch

set autoindent
set cindent
set tabstop=4
set shiftwidth=4
set noexpandtab

set nonumber
set noruler
set nolist
set showmatch
set wrap
set title
set showcmd
set cmdheight=2
set laststatus=2
set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}
set wildmenu

set backspace=2
set scrolloff=5
set formatoptions+=mM
let format_join_spaces = 4
let format_allow_over_tw = 1
set nobackup
set history=1000
"set mouse=a

if has('autochdir')
set autochdir
endif
if has('migemo')
set migemo
endif
if has('kaoriya')
set iminsert=0
set imsearch=0
endif

filetype plugin indent on
syntax on

hi Search ctermbg=DarkBlue ctermfg=White
hi Pmenu ctermbg=Magenta
hi PmenuSel ctermbg=DarkGrey
hi PmenuSbar ctermbg=Grey
hi PmenuThumb cterm=reverse

autocmd FileType ruby set tabstop=2 tw=0 sw=2 expandtab
autocmd FileType eruby set tabstop=2 tw=0 sw=2 expandtab
autocmd BufNewFile,BufRead app/*/*.rhtml set ft=mason fenc=utf-8
autocmd BufNewFile,BufRead app/**/*.rb set ft=ruby fenc=utf-8
autocmd BufNewFile,BufRead app/**/*.yml set ft=ruby fenc=utf-8
autocmd FileType c hi Comment ctermfg=darkcyan
autocmd FileType cpp hi Comment ctermfg=darkcyan

" rails.vim
"let g:rails_level=4
"let g:rails_default_file="app/controllers/application.rb"
"let g:rails_default_database="sqlite3"

" rubycomplete.vim
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1

" search
nmap n nzz
nmap N Nzz
nmap * *zz
nmap # #zz
nmap g* g*zz
nmap g# g#zz

" edit binary file
augroup BinaryXXD
autocmd!
autocmd BufReadPre *.bin let &binary =1
autocmd BufReadPost * if &binary | silent %!xxd -g 1
autocmd BufReadPost * set ft=xxd | endif
autocmd BufWritePre * if &binary | %!xxd -r | endif
autocmd BufWritePost * if &binary | silent %!xxd -g 1
autocmd BufWritePost * set nomod | endif
augroup END


.gvimrc
colorscheme evening

set columns=80
set lines=40

set gfn=Osaka-Mono:h14
set gfw=Osaka-Mono:h14
set macatsui
set noantialias

highlight CursorIM guibg=Purple guifg=NONE
highlight Search guibg=DarkBlue guifg=NONE

map <D-w> :q<CR>gT
map <D-t> :tabnew<CR>
map <D-n> :new<CR>
map <D-S-t> :browse tabe<CR>
map <D-S-n> :browse split<CR>
map <D-]> :tabn<CR>
map <D-[> :tabp<CR>
map <D-M-Right> :tabn<CR>
map <D-M-Left> :tabp<CR>
imap <D-M-Right> <C-o>:tabn<CR>
imap <D-M-Left> <C-o>:tabp<CR>


プラグインも棚卸ししよう。