Skip to content

Instantly share code, notes, and snippets.

@jumski
Created September 10, 2014 12:27
Show Gist options
  • Save jumski/8e90d049e4abe1f09319 to your computer and use it in GitHub Desktop.
Save jumski/8e90d049e4abe1f09319 to your computer and use it in GitHub Desktop.
VIM + Rspec : run spec for last cursor save position
#!/bin/bash
[ -S .zeus.sock ] && PREFIX=zeus
COMMAND="$PREFIX rspec `cat .cursor_last_position`"
VERBOSE=false
echo $COMMAND
$COMMAND
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