Instantly share code, notes, and snippets.

Embed
What would you like to do?
let g:zeus_prefix = ""
let g:bundle_prefix = ""
let g:fdoc_prefix = ""
" Toggle the rspec_command
function! ToggleRspecCommand(prefix_name, prefix)
if g:{a:prefix_name}_prefix != ""
let g:{a:prefix_name}_prefix = ""
else
let g:{a:prefix_name}_prefix = a:prefix . " "
endif
let g:rspec_command = "!" . g:fdoc_prefix . g:zeus_prefix . g:bundle_prefix ."rspec {spec}"
echo "rspec_command = " . g:rspec_command
endfunction
map <Leader>z :call ToggleRspecCommand("zeus", "zeus")<cr>
map <Leader>b :call ToggleRspecCommand("bundle", "bundle exec")<cr>
map <Leader>f :call ToggleRspecCommand("fdoc", "FDOC_SCAFFOLD=true")<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment