Skip to content

Vim plugin to display ruby, rake, and rspec output colorized in ConqueTerm with added spork support.

Notifications You must be signed in to change notification settings

nathanielescribano/vim-ruby-conque

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

Ruby Conque & Fast-spec Aware RSpec Finder

  • Colorized Ruby, Rake, RSpec, and Cucumber output in vim using ConqueTerm
  • Spec Finder - use Ctrl-s to automatically find the related spec and open in a split, fast_spec aware!
  • Sensible keybindings (feel free to change), all prefixed with 'rc':
nmap <silent> <Leader>rcrr :call RunRubyCurrentFileConque()<CR>
nmap <silent> <Leader>rcss :call RunRspecCurrentFileConque()<CR>
nmap <silent> <Leader>rcll :call RunRspecCurrentLineConque()<CR>
nmap <silent> <Leader>rccc :call RunCucumberCurrentFileConque()<CR>
nmap <silent> <Leader>rccl :call RunCucumberCurrentLineConque()<CR>
nmap <silent> <Leader>rcRR :call RunRakeConque()<CR>
nmap <silent> <Leader>rcrl :call RunLastConqueCommand()<CR>

nnoremap <silent> <C-s> :call RelatedSpecVOpen()<CR>
nnoremap <silent> ,<C-s> :call RelatedSpecOpen()<CR>

Recommended keybinings

Chords are faster than typing out long strings:

" Cmd-Shift-R for RSpec
nmap <silent> <D-R> :call RunRspecCurrentFileConque()<CR>
" Cmd-Shift-L for RSpec Current Line
nmap <silent> <D-L> :call RunRspecCurrentLineConque()<CR>
" ,Cmd-R for Last conque command
nmap <silent> ,<D-R> :call RunLastConqueCommand()<CR>

Using the Spec Runner

Try some of the keybindings listed above.

Upon running a test your cursor will be in the Conque buffer, you can use these commands:

q   closes/quits the buffer
n   goes to the next Failure message.
p   goes to the previous Failure message.
f   goes to the Finished At section for an overview of the test.

Using the Spec Finder

While inside a ruby file, invoke the shortcut (supplied as Ctrl-s), and the corresponding spec will be open. The assumptions are:

  • Your specs live in spec/ or fast_spec/
  • Your pwd (current dir) is the project root
  • You use the same dir structure in your code and specs so that code living at lib/foo/bar.rb has a spec at spec/lib/foo/bar_spec.rb

For more information, please see doc/spec-finder.txt. There are included functions for opening the spec in the current window, and in a split, as well as just getting its full path.

Configuration

This plugin tries to detect whether you use 'rspec' (rspec2) or 'spec' (rspec1) and set the default executable correctly. To override in your ~/.vimrc:

let g:ruby_conque_rspec_command='spec'

Contribute

About

Vim plugin to display ruby, rake, and rspec output colorized in ConqueTerm with added spork support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%