Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
510 lines (462 sloc) 17.5 KB
"-------------------------------------------------------------------------------
" プラグインごとの設定 Plugins
"-------------------------------------------------------------------------------
"------------------------------------
" ctrlp.vim
"------------------------------------
let g:ctrlp_working_path_mode = '0'
let g:ctrlp_show_hidden = 1
"------------------------------------
" YankRing.vim
"------------------------------------
" Yankの履歴参照
nmap ,y ;YRShow<CR>
"------------------------------------
" MiniBufExplorer
"------------------------------------
"set minibfexp
let g:miniBufExplMapWindowNavVim=1 "hjklで移動
let g:miniBufExplSplitBelow=0 " Put new window above
let g:miniBufExplMapWindowNavArrows=1
let g:miniBufExplMapCTabSwitchBufs=1
let g:miniBufExplModSelTarget=1
let g:miniBufExplSplitToEdge=1
let g:miniBufExplMaxSize = 10
":MtでMiniBufExplorerの表示トグル
"command! Mt :TMiniBufExplorer
"------------------------------------
" Align
"------------------------------------
" Alignを日本語環境で使用するための設定
let g:Align_xstrlen = 3
"------------------------------------
" VTreeExplorer
"------------------------------------
" 縦に表示する
"let g:treeExplVertical=1
"------------------------------------
" The-NERD-tree
"------------------------------------
let NERDTreeShowHidden=1
"------------------------------------
" NERD_commenter.vim
"------------------------------------
" コメントの間にスペースを空ける
"let NERDSpaceDelims = 1
"<Leader>xでコメントをトグル(NERD_commenter.vim)
"map <Leader>x, c<space>
""未対応ファイルタイプのエラーメッセージを表示しない
"let NERDShutUp=1
" ------------------------------------
" grep.vim
"------------------------------------
" 検索外のディレクトリ、ファイルパターン
let Grep_Skip_Dirs = '.svn .git .hg'
let Grep_Skip_Files = '*.bak *~'
"------------------------------------
" surround.vim
"------------------------------------
" s, ssで選択範囲を指定文字でくくる
"nmap s <Plug>Ysurround
"nmap ss <Plug>Yssurround
"let g:surround_{char2nr('e')} = "begin \r end"
"let g:surround_{char2nr('d')} = "do \r end"
"let g:surround_{char2nr("-")} = ":\r"
"------------------------------------
" smartchr.vim
"------------------------------------
" inoremap <expr> = smartchr#loop('=', '==', '=>')
" inoremap <expr> . smartchr#loop('.', '->', '=>')
"
" " 演算子の間に空白を入れる
" inoremap <buffer><expr> + smartchr#one_of(' + ', ' ++ ', '+')
" inoremap <buffer><expr> += smartchr#one_of(' += ')
" " inoremap <buffer><expr> - smartchr#one_of(' - ', ' -- ', '-')
" inoremap <buffer><expr> -= smartchr#one_of(' -= ')
" " inoremap <buffer><expr> / smartchr#one_of(' / ', ' // ', '/')
" inoremap <buffer><expr> /= smartchr#one_of(' /= ')
" inoremap <buffer><expr> * smartchr#one_of(' * ', ' ** ', '*')
" inoremap <buffer><expr> *= smartchr#one_of(' *= ')
" inoremap <buffer><expr> & smartchr#one_of(' & ', ' && ', '&')
" inoremap <buffer><expr> % smartchr#one_of(' % ', '%')
" inoremap <buffer><expr> => smartchr#one_of(' => ')
" inoremap <buffer><expr> <- smartchr#one_of(' <- ')
" inoremap <buffer><expr> <Bar> smartchr#one_of(' <Bar> ', ' <Bar><Bar> ', '<Bar>')
" inoremap <buffer><expr> , smartchr#one_of(', ', ',')
" " 3項演算子の場合は、後ろのみ空白を入れる
" inoremap <buffer><expr> ? smartchr#one_of('? ', '?')
" " inoremap <buffer><expr> : smartchr#one_of(': ', '::', ':')
" " =の場合、単純な代入や比較演算子として入力する場合は前後にスペースをいれる。
" " 複合演算代入としての入力の場合は、直前のスペースを削除して=を入力
" inoremap <buffer><expr> = search('¥(&¥<bar><bar>¥<bar>+¥<bar>-¥<bar>/¥<bar>>¥<bar><¥) ¥%#', 'bcn')? '<bs>= ' : search('¥(*¥<bar>!¥)¥%#', 'bcn') ? '= ' : smartchr#one_of(' = ', ' == ', '=')
" " 下記の文字は連続して現れることがまれなので、二回続けて入力したら改行する
" inoremap <buffer><expr> } smartchr#one_of('}', '}<cr>')
" inoremap <buffer><expr> ; smartchr#one_of(';', ';<cr>')
" "()は空白入れる
" inoremap <buffer><expr> ( smartchr#one_of('( ')
" inoremap <buffer><expr> ) smartchr#one_of(' )')
" " if文直後の(は自動で間に空白を入れる
" inoremap <buffer><expr> ( search('¥<¥if¥%#', 'bcn')? ' (': '('
"------------------------------------
" Fugitive.vim
"------------------------------------
"nnoremap <Space>gd :<C-u>Gdiff<Enter>
"nnoremap <Space>gs :<C-u>Gstatus<Enter>
"nnoremap <Space>gl :<C-u>Glog<Enter>
"nnoremap <Space>ga :<C-u>Gwrite<Enter>
"nnoremap <Space>gc :<C-u>Gcommit<Enter>
"nnoremap <Space>gC :<C-u>Git commit --amend<Enter>
"nnoremap <Space>gb :<C-u>Gblame<Enter>
"------------------------------------
" BufExplorer
"------------------------------------
"<Leader>l<Space>でBufferList
nnoremap <Leader>l<Space> :BufExplorer<CR>
"------------------------------------
" VTreeExplorer
"------------------------------------
let g:treeExplVertical=1
"<Leader>t<Space>でディレクトリツリー表示
noremap <Leader>t<Space> :VSTreeExplore<CR>
"分割したウィンドウのサイズ
let g:treeExplWinSize=30
"------------------------------------
" DumbBuf.vim
"------------------------------------
"<Leader>b<Space>でBufferList
let dumbbuf_hotkey = '<Leader>b<Space>'
let dumbbuf_mappings = {
\ 'n': {
\'<Esc>': { 'opt': '<silent>', 'mapto': ':<C-u>close<CR>' }
\}
\}
let dumbbuf_single_key = 1
let dumbbuf_updatetime = 1 " &updatetimeの最小値
let dumbbuf_wrap_cursor = 0
let dumbbuf_remove_marked_when_close = 1
"------------------------------------
" vim-indent-guides
"------------------------------------
"nnoremap <silent> <Space>id :<C-u>IndentGuidesToggle<Enter>
"let g:indent_guides_auto_colors = 0
"let g:indent_guides_start_level = 4
"let g:indent_guides_guide_size = 1
"autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3
"autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4
"if 'dark' == &background
" hi IndentGuidesOdd ctermbg=black
" hi IndentGuidesEven ctermbg=darkgrey
"else
" hi IndentGuidesOdd ctermbg=white
" hi IndentGuidesEven ctermbg=lightgrey
"endif
"------------------------------------
" gundo.Vim
"------------------------------------
" nmap U :<C-u>GundoToggle<CR>
"------------------------------------
" taglist.Vim
"------------------------------------
" 関数一覧
set tags=tags
"set tags+=~/.tags
"let Tlist_Ctags_Cmd = '/Applications/MacVim.app/Contents/MacOS/ctags' " ctagsのパス
let Tlist_Show_One_File = 1 " 現在編集中のソースのタグしか表示しない
let Tlist_Exit_OnlyWindow = 1 " taglistのウィンドーが最後のウィンドーならばVimを閉じる
"let Tlist_Use_Right_Window = 1 " 右側でtaglistのウィンドーを表示
let Tlist_Enable_Fold_Column = 1 " 折りたたみ
"let Tlist_Auto_Open = 1 " 自動表示
let Tlist_Auto_Update = 1
let Tlist_WinWidth = 30
map <silent> <leader>tl :Tlist<CR> " taglistを開くショットカットキー
"nmap <F7> :CMiniBufExplorer<CR>:TrinityToggleTagList<CR>:TMiniBufExplorer<CR>
"nmap <Leader>tl :CMiniBufExplorer<CR>:TrinityToggleTagList<CR>:TMiniBufExplorer<CR>
"------------------------------------
" Srcexp
"------------------------------------
" [Srcexpl] tagsを利用したソースコード閲覧・移動補助機能
let g:SrcExpl_UpdateTags = 1 " tagsをsrcexpl起動時に自動で作成(更新)
let g:SrcExpl_RefreshTime = 0 " 自動表示するまでの時間(0:off)
let g:SrcExpl_WinHeight = 9 " プレビューウインドウの高さ
let g:SrcExpl_RefreshMapKey = "<Space>" " 手動表示のMAP
let g:SrcExpl_GoBackMapKey = "<C-b>" " 戻る機能のMAP
" Source Explorerの機能ON/OFF
" nmap <F8> :CMiniBufExplorer<CR>:SrcExplToggle<CR>:TMiniBufExplorer<CR>
"------------------------------------
" open-blowser.vim
"------------------------------------
" カーソル下のURLをブラウザで開く
"nmap <Leader>fu <Plug>(openbrowser-open)
"vmap <Leader>fu <Plug>(openbrowser-open)
" カーソル下のキーワードをググる
"nnoremap <Leader>fs :<C-u>OpenBrowserSearch<Space><C-r><C-w><Enter>
"------------------------------------
" operator-camelize.vim
"------------------------------------
" camel-caseへの変換
map <Leader>u <Plug>(operator-camelize)
map <Leader>U <Plug>(operator-decamelize)
"------------------------------------
" operator-replace.vim
"------------------------------------
" RwなどでYankしてるもので置き換える
"map R <Plug>(operator-replace)
"------------------------------------
" sumartword.vim
"------------------------------------
"noremap ,w w
"noremap ,b b
"noremap ,e e
"noremap ,ge ge
"
"map W <Plug>(smartword-w)
"map B <Plug>(smartword-b)
"map E <Plug>(smartword-e)
"map ge <Plug>(smartword-ge)
"------------------------------------
" camelcasemotion.vim
"------------------------------------
" <Shift-wbe>でCameCaseやsnake_case単位での単語移動
"map <silent> w <Plug>CamelCaseMotion_w
"map <silent> b <Plug>CamelCaseMotion_b
"map <silent> e <Plug>CamelCaseMotion_e
" text-objectで使用できるように
"omap <silent> iw <Plug>CamelCaseMotion_iw
"xmap <silent> iw <Plug>CamelCaseMotion_iw
"omap <silent> ib <Plug>CamelCaseMotion_ib
"xmap <silent> ib <Plug>CamelCaseMotion_ib
"omap <silent> ie <Plug>CamelCaseMotion_ie
"xmap <silent> ie <Plug>CamelCaseMotion_ie
"------------------------------------
" errormarker.vim
"------------------------------------
" disable default shortcut mapping and re-define to <Leader>ec
"let g:errormarker_disablemappings = 1
"nmap <silent> <unique> <Leader>ec :ErrorAtCursor<CR>
"------------------------------------
" vimshell
"------------------------------------
"let g:vimshell_user_prompt = 'fnamemodify(getcwd(), ":~")'
"let g:vimshell_right_prompt = 'vimshell#vcs#info("(%s)-[%b]", "(%s)-[%b|%a]")'
"let g:vimshell_enable_smart_case = 1
"
"if has('win32') || has('win64')
" " Display user name on Windows.
" let g:vimshell_prompt = $USERNAME."% "
"else
" " Display user name on Linux.
" let g:vimshell_prompt = $USER."% "
"
" call vimshell#set_execute_file('bmp,jpg,png,gif', 'gexe eog')
" call vimshell#set_execute_file('mp3,m4a,ogg', 'gexe amarok')
" let g:vimshell_execute_file_list['zip'] = 'zipinfo'
" call vimshell#set_execute_file('tgz,gz', 'gzcat')
" call vimshell#set_execute_file('tbz,bz2', 'bzcat')
"endif
"
"function! g:my_chpwd(args, context)
" call vimshell#execute('echo "chpwd"')
"endfunction
"function! g:my_emptycmd(cmdline, context)
" call vimshell#execute('echo "emptycmd"')
" return a:cmdline
"endfunction
"function! g:my_preprompt(args, context)
" call vimshell#execute('echo "preprompt"')
"endfunction
"function! g:my_preexec(cmdline, context)
" call vimshell#execute('echo "preexec"')
"
" if a:cmdline =~# '^\s*diff\>'
" call vimshell#set_syntax('diff')
" endif
" return a:cmdline
"endfunction
"
"autocmd FileType vimshell
"\ call vimshell#altercmd#define('g', 'git')
"\| call vimshell#altercmd#define('i', 'iexe')
"\| call vimshell#altercmd#define('l', 'll')
"\| call vimshell#altercmd#define('ll', 'ls -l')
"\| call vimshell#hook#set('chpwd', ['g:my_chpwd'])
"\| call vimshell#hook#set('emptycmd', ['g:my_emptycmd'])
"\| call vimshell#hook#set('preprompt', ['g:my_preprompt'])
"\| call vimshell#hook#set('preexec', ['g:my_preexec'])
"
"command! Vs :VimShell
"
"
"------------------------------------
" unite.vim
"------------------------------------
" The prefix key.
"nnoremap [unite] <Nop>
"nmap f [unite]
"
"nnoremap [unite]u :<C-u>Unite -no-split<Space>
"
"" 全部乗せ
"nnoremap <silent> [unite]a :<C-u>UniteWithCurrentDir -no-split -buffer-name=files buffer file_mru bookmark file<CR>
"" ファイル一覧
"nnoremap <silent> [unite]f :<C-u>Unite -no-split -buffer-name=files file<CR>
"" バッファ一覧
"nnoremap <silent> [unite]b :<C-u>Unite -no-split buffer<CR>
"" 常用セット
"nnoremap <silent> [unite]u :<C-u>Unite -no-split buffer file_mru<CR>
"" 最近使用したファイル一覧
"nnoremap <silent> [unite]m :<C-u>Unite -no-split file_mru<CR>
"" 現在のバッファのカレントディレクトリからファイル一覧
"nnoremap <silent> [unite]d :<C-u>UniteWithBufferDir -no-split file<CR>
"
"" nnoremap <silent> [unite]b :<C-u>UniteWithBufferDir -buffer-name=files buffer file_mru bookmark file<CR>
"
"let g:yankring_zap_keys = ""
"" from basyura/unite-rails
"nnoremap <silent> [unite]rm :<C-u>Unite -no-split rails/model<CR>
"nnoremap <silent> [unite]rc :<C-u>Unite -no-split rails/controller<CR>
"nnoremap <silent> [unite]rv :<C-u>Unite -no-split rails/view<CR>
"nnoremap <silent> [unite]rl :<C-u>Unite -no-split rails/lib<CR>
"nnoremap <silent> [unite]rj :<C-u>Unite -no-split rails/javascript<CR>
"nnoremap <silent> [unite]rs :<C-u>Unite -no-split rails/spec<CR>
"
"
"autocmd FileType unite call s:unite_my_settings()
"function! s:unite_my_settings()"{{{
" " Overwrite settings.
"
" " ESCキーを2回押すと終了する
" nmap <buffer> <ESC> <Plug>(unite_exit)
" nmap <buffer> <ESC><ESC> <Plug>(unite_exit)
" imap <buffer> jj <Plug>(unite_insert_leave)
" nnoremap <silent><buffer> <C-k> :<C-u>call unite#mappings#do_action('preview')<CR>
" imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
" " Start insert.
" let g:unite_enable_start_insert = 1
"
" " ウィンドウを分割して開く
" nnoremap <silent> <buffer> <expr> <C-l> unite#do_action('split')
" inoremap <silent> <buffer> <expr> <C-l> unite#do_action('split')
"
" " ウィンドウを縦に分割して開く
" nnoremap <silent> <buffer> <expr> <C-v> unite#do_action('vsplit')
" inoremap <silent> <buffer> <expr> <C-v> unite#do_action('vsplit')
"endfunction"}}}
"
"let g:unite_source_file_mru_limit = 200
"
"" unite-plugins
"cnoremap UH Unite help<Enter>
"cnoremap UO Unite outline<Enter>
"------------------------------------
" quickrun.vim
"------------------------------------
let g:quickrun_config = {}
" let g:quickrun_config._ = {'runner' : 'vimproc'}
" デフォルトの設定
" 非同期で実行
" 出力先
" エラー : quickfix
" 成功 : buffer
let g:quickrun_config["_"] = {
\ "runner/vimproc/updatetime" : 80,
\ "outputter/buffer/split" : ":rightbelow 8sp",
\ "outputter/error/error" : "buffer",
\ "outputter/error/success" : "null",
\ "outputter" : "error",
\ "runner" : "vimproc",
\ }
let g:quickrun_config['rspec/bundle'] = {
\ 'type': 'rspec/bundle',
\ 'command': "rspec",
\ 'cmdopt': "-l %{line('.')}",
\ 'exec': "bundle exec %c %o %s ",
\ 'filetype': 'rspec-result'
\}
let g:quickrun_config['rspec/normal'] = {
\ 'type': 'rspec/normal',
\ 'command': "rspec",
\ 'cmdopt': "-l %{line('.')}",
\ 'exec': '%c %o %s',
\ 'filetype': 'rspec-result'
\}
function! RSpecQuickrun()
let b:quickrun_config = {'type' : 'rspec/bundle'}
endfunction
autocmd BufReadPost *_spec.rb call RSpecQuickrun()
let g:quickrun_config.markdown = {
\ 'outputter' : 'null',
\ 'command' : 'open',
\ 'cmdopt' : '-a',
\ 'args' : 'Marked',
\ 'exec' : '%c %o %a %s',
\}
let g:quickrun_config.html = {
\ 'outputter' : 'null',
\ 'command' : 'open',
\ 'exec' : '%c %s',
\}
let g:quickrun_config.diag = {
\ "outputter/buffer/close_on_empty" : 1,
\ 'command' : 'blockdiag',
\ 'exec' : '%c %s',
\}
"------------------------------------
" Pydiction
"------------------------------------
"let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'
"------------------------------------
" Syntastic
"------------------------------------
" エラー行をsignで表示する
"let g:syntastic_enable_signs = 1
" 可能ならhighligt表示する
"let g:syntastic_enable_highlighting = 1
"------------------------------------
" toggle.vim
"------------------------------------
"imap <C-A> <Plug>ToggleI
"nmap <C-A> <Plug>ToggleN
"vmap <C-A> <Plug>ToggleV
"
"let g:toggle_pairs = { 'and':'or', 'or':'and', 'if':'unless', 'unless':'if', 'yes':'no', 'no':'yes', 'enable':'disable', 'disable':'enable', 'pick':'reword', 'reword':'fixup', 'fixup':'squash', 'squash':'edit', 'edit':'exec', 'exec':'pick' }
"
"
"------------------------------------
" vim-rails.vim
"------------------------------------
"let g:rails_some_option = 1
"let g:rails_level = 4
"let g:rails_syntax = 1
"let g:rails_statusline = 1
"let g:rails_url='http://localhost:3000'
"let g:rails_subversion=0
"" let g:dbext_default_SQLITE_bin = 'mysql2'
"let g:rails_default_file='config/database.yml'
"" let g:rails_ctags_arguments = ''
"function! SetUpRailsSetting()
" nmap <buffer><C-C> <Nop>
" imap <buffer><C-C> <Nop>
" map <buffer><C-_><C-C> <Nop>
"
" nmap <buffer><Space>r :R<CR>
" nmap <buffer><Space>a :A<CR>
" nmap <buffer><Space>m :Rmodel<Space>
" nmap <buffer><Space>c :Rcontroller<Space>
" nmap <buffer><Space>v :Rview<Space>
" nmap <buffer><Space>s :Rspec<Space>
" nmap <buffer><Space>p :Rpreview<CR>
" nmap <buffer><Space>t :Runittest<CR>
" au FileType ruby,eruby,ruby.rspec let g:neocomplcache_dictionary_filetype_lists = {
" \'ruby' : $HOME.'/.vim/dict/rails.dict',
" \'eruby' : $HOME.'/.vim/dict/rails.dict'
" \}
" setl dict+=~/.vim/dict/rails.dict
" setl dict+=~/.vim/dict/ruby.dict
"endfunction
"autocmd User Rails call SetUpRailsSetting()
"------------------------------------
" mattn/vim-metarw-redmine
"------------------------------------
"let g:metarw_redmine_server = 'http://redmine.dev.scaleout.jp'
"let g:metarw_redmine_apikey = '2ed945f405865ec799ff91b7bb364215f932c51c'
"