5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vim-quickrunで実行したRSpecの結果にレッドバー/グリーンバーを表示する

Posted at

vim-quickrunで実行したRSpecの結果にレッドバー/グリーンバーを表示する

vim-quickrunで実行したRSpecの結果にレッドバー/グリーンバーを表示する - vimまっしぐら★ - vimグループ

を参考に自分の環境で動かなかったところをいじった。

~/.vim/ftdetect/ruby.vim
autocmd BufWinEnter,BufNewFile *_spec.rb set filetype=ruby.rspec
~/.vim/after/ftplugin/ruby.vim
let g:quickrun_config['ruby.rspec'] = {'command': 'rspec', 'cmdopt': '--format progress -I .', 'outputter': 'buffer:filetype=rspec-result'}
~/.vim/syntax/rspec-result.vim
if exists("b:current_syntax")
  finish
endif
   
if !exists("main_syntax")
  let main_syntax = 'rspec-result'
endif

syntax case match

syntax match RSpecGreen /^\.*$/
syntax match RSpecRed   /^[F.]*F[F.]*$/
syntax match RSpecGreen /^.* 0 failure.*$/
syntax match RSpecRed   /^.* [1-9][0-9]* failure.*$/

highlight RSpecGreen ctermfg=White ctermbg=Green guifg=White guibg=Green
highlight RSpecRed   ctermfg=White ctermbg=Red   guifg=White guibg=Red

"unlet b:current_syntax
let b:current_syntax = 'rspec-result'

if main_syntax == 'rspec-result'
  unlet main_syntax
endif
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?