Feed

ursm's watching list

.vimrc

if filereadable($VIMRUNTIME . '/vimrc_example.vim')
source $VIMRUNTIME/vimrc_example.vim
endif

set ambiwidth=double
set autoread
set background=dark
set expandtab
set hidden
set ignorecase
set laststatus=2
set nobackup
set number
set shiftwidth=2
set showmatch
set smartcase
set softtabstop=0
set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).':'.&ff.']'}%=%l,%c%v%8p
set tabstop=2
set ttymouse=xterm2
set wildmode=longest:list

set encoding=utf-8
set fileencodings=utf-8,cp932,eucjp,iso2022jp
set fileformats=unix,dos,mac

nnoremap j gj
nnoremap k gk

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

nmap ,fb :FuzzyFinderBuffer<CR>
nmap ,ff :FuzzyFinderFile<CR>
nmap ,fm :FuzzyFinderMruFile<CR>
nmap ,fc :FuzzyFinderMruCmd<CR>
nmap ,fv :FuzzyFinderFavFile<CR>
nmap ,fd :FuzzyFinderDir<CR>
nmap ,ft :FuzzyFinderTag<CR>
nmap ,fg :FuzzyFinderTaggedFile<CR>

" C-x でカレントディレクトリを展開
cmap <C-x> <C-r>=expand('%:p:h')<CR>/

" 全角空白と行末の空白の色を変える
highlight WideSpace ctermbg=blue guibg=blue
highlight EOLSpace ctermbg=red guibg=red

function! HighlightSpace()
match WideSpace " "
match EOLSpace /\s\+$/
endf

call HighlightSpace()
autocmd WinEnter * call HighlightSpace()

" 挿入モード時、ステータスラインの色を変える
autocmd InsertEnter * highlight StatusLine ctermfg=red guifg=red
autocmd InsertLeave * highlight StatusLine ctermfg=white guifg=white

" 自動的に QuickFix リストを表示する
autocmd QuickfixCmdPost make,grep,grepadd,vimgrep,vimgrepadd cwin
autocmd QuickfixCmdPost lmake,lgrep,lgrepadd,lvimgrep,lvimgrepadd lwin

autocmd FileType ruby compiler ruby

let g:yankring_persist = 0
let skk_auto_save_jisyo = -1

if has('mac')
let skk_large_jisyo = '~/Library/AquaSKK/SKK-JISYO.L'
else
let skk_large_jisyo = "/usr/share/skk/SKK-JISYO.L"

let g:firefox = {
\ 'host': '192.168.0.1',
\ 'mappings': [
\ ['^'.$HOME.'(?:/|$)', 'file://///'.hostname().'/'.$USER.'/']
\ ]
\}
endif

let g:surround_{char2nr('%')} = "%(\r)"
let g:surround_{char2nr('w')} = "%w(\r)"
let g:surround_{char2nr('#')} = "#{\r}"
let g:surround_{char2nr('g')} = "begin \r end"
let g:surround_{char2nr('i')} = "if \1if\1 \r end"
let g:surround_{char2nr('u')} = "unless \1unless\1 \r end"
let g:surround_{char2nr('c')} = "class \1class\1 \r end"
let g:surround_{char2nr('m')} = "module \1module\1 \r end"
let g:surround_{char2nr('d')} = "def \1def\1\2args\r..*\r(&)\2 \r end"
let g:surround_{char2nr('p')} = "\1method\1 do \2args\r..*\r|&| \2\r end"
let g:surround_{char2nr('P')} = "\1method\1 {\2args\r..*\r|&|\2 \r }"