Skip to content

Instantly share code, notes, and snippets.

@jumski
Created March 3, 2015 14:33
Show Gist options
  • Save jumski/da0da4b905db17fad714 to your computer and use it in GitHub Desktop.
Save jumski/da0da4b905db17fad714 to your computer and use it in GitHub Desktop.
function! SpecCommandForCurrentFile(alternate_letter)
let basename = expand("%:t:r")
exec ":".a:alternate_letter."spec ".basename."!"
endfunction
cmap A! call SpecCommandForCurrentFile("R")<cr>
cmap V! call SpecCommandForCurrentFile("V")<cr>
cmap S! call SpecCommandForCurrentFile("S")<cr>
cmap T! call SpecCommandForCurrentFile("T")<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment