Last active
February 16, 2017 05:10
-
-
Save Kuniwak/e880a008afb84c7b74cf to your computer and use it in GitHub Desktop.
QuickRun + Rspecの設定例
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " NeoBundle ---------------------------------------------------------------- {{{ | |
| " call neobundle#begin(___) ... call neobundle#end() の間に置いてください | |
| " Vim でコマンドを実行して結果を表示するプラグイン「QuickRun」をインストール | |
| NeoBundle 'thinca/vim-quickrun' | |
| " テストを実行中、vimの動作をブロックしないようにするために「vimproc」をインストール | |
| NeoBundle 'Shougo/vimproc' | |
| " -------------------------------------------------------------------------- }}} | |
| " | |
| " QuickRun ----------------------------------------------------------------- {{{ | |
| " QuickRunの設定オブジェクトをつくる | |
| let g:quickrun_config = {} | |
| " すべてのファイルタイプで vimproc をつかってコマンドを実行する | |
| let g:quickrun_config['_'] = { | |
| \ 'runner': 'vimproc', | |
| \ 'runner/vimproc/updatetime' : 100 | |
| \ } | |
| " ruby.rspec というファイルタイプのとき、下のようにコマンドを実行する | |
| " bundle exec rspec FILE_NAME | |
| let g:quickrun_config['ruby.rspec'] = { | |
| \ 'command': 'bundle', | |
| \ 'cmdopt': 'exec rspec', | |
| \ } | |
| " 新規ファイル/開くファイルの名前が ~_spec.rb のとき、ファイルタイプを ruby.rspec にする | |
| augroup my_rspec | |
| autocmd! | |
| autocmd BufEnter *_spec.rb set filetype=ruby.rspec | |
| augroup END | |
| " normal モードのとき ,t で QuickRun を実行(rspec の場合はテストを実行) | |
| nnoremap ,t :<C-u>QuickRun<CR> | |
| " -------------------------------------------------------------------------- }}} | |
| " vim: fdm=marker et ts=2 sw=2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment