Skip to content

Instantly share code, notes, and snippets.

@garyharan
Created July 26, 2013 21:23
Show Gist options
  • Save garyharan/6092332 to your computer and use it in GitHub Desktop.
Save garyharan/6092332 to your computer and use it in GitHub Desktop.
Run a single spec block in vim using a named pipe.
" Of course this can be edited to run whatever you want instead of spring and rspec
map <leader>l :w\|:silent exe "! echo \"spring rspec " . "%" . ":" . line('.') . "\" > test-commands"<cr>
#!/bin/bash
if [ ! -p test-commands ]; then
mkfifo test-commands
fi
while true; do
sh -c "$(cat test-commands)";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment