Skip to content

Instantly share code, notes, and snippets.

@sfsekaran
Forked from samg/.vimrc.vim
Created April 6, 2011 21:27

Revisions

  1. sfsekaran revised this gist Apr 6, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions .vimrc.vim
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,6 @@ endfunction

    " Mappings
    " run one rspec example or describe block based on cursor position
    map !r :call RunSpec("-l " . <C-r>=line('.')<CR>)
    map !s :call RunSpec("-l " . <C-r>=line('.')<CR>)
    " run full rspec file
    map !R :call RunSpec("")
    map !S :call RunSpec("")
  2. sfsekaran revised this gist Apr 6, 2011. 1 changed file with 13 additions and 9 deletions.
    22 changes: 13 additions & 9 deletions .vimrc.vim
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,21 @@
    " Execute open rspec buffer
    " Thanks to Ian Smith-Heisters
    function! RunSpec(args)
    if exists("b:rails_root") && filereadable(b:rails_root . "/script/spec")
    let spec = b:rails_root . "/script/spec"
    else
    let spec = "spec"
    end
    let cmd = ":! " . spec . " % -cfn " . a:args
    execute cmd
    if exists("b:rails_root")
    if filereadable(b:rails_root . "/Gemfile")
    let spec = "bundle exec rspec"
    elseif filereadable(b:rails_root . "/script/spec")
    let spec = b:rails_root . "/script/spec"
    else
    let spec = "rspec"
    end
    end
    let cmd = ":! " . spec . " % -cfn " . a:args
    execute cmd
    endfunction

    " Mappings
    " run one rspec example or describe block based on cursor position
    map !s :call RunSpec("-l " . <C-r>=line('.')<CR>)
    map !r :call RunSpec("-l " . <C-r>=line('.')<CR>)
    " run full rspec file
    map !S :call RunSpec("")
    map !R :call RunSpec("")
  3. @samg samg renamed this gist Aug 27, 2009. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @samg samg created this gist Aug 27, 2009.
    17 changes: 17 additions & 0 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    " Execute open rspec buffer
    " Thanks to Ian Smith-Heisters
    function! RunSpec(args)
    if exists("b:rails_root") && filereadable(b:rails_root . "/script/spec")
    let spec = b:rails_root . "/script/spec"
    else
    let spec = "spec"
    end
    let cmd = ":! " . spec . " % -cfn " . a:args
    execute cmd
    endfunction

    " Mappings
    " run one rspec example or describe block based on cursor position
    map !s :call RunSpec("-l " . <C-r>=line('.')<CR>)
    " run full rspec file
    map !S :call RunSpec("")