Created
September 10, 2014 12:27
-
-
Save jumski/8e90d049e4abe1f09319 to your computer and use it in GitHub Desktop.
VIM + Rspec : run spec for last cursor save position
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ -S .zeus.sock ] && PREFIX=zeus | |
COMMAND="$PREFIX rspec `cat .cursor_last_position`" | |
VERBOSE=false | |
echo $COMMAND | |
$COMMAND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fu! WriteCursorLastPosition() | |
let output = system('echo ' . getreg('%') . ':' . line('.') . ' > .cursor_last_position') | |
endfunction | |
" | |
if !exists("b:jumski_write_rspec_guide") | |
let b:jumski_write_rspec_guide = 1 | |
au BufWritePost *_spec.rb call WriteCursorLastPosition() | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment