Skip to content

Instantly share code, notes, and snippets.

@bps
Created November 4, 2011 18:59
Show Gist options
  • Save bps/1340179 to your computer and use it in GitHub Desktop.
Save bps/1340179 to your computer and use it in GitHub Desktop.
Vim Scons command
function! s:Scons()
if !executable("scons")
echohl Error
echo "No scons executable."
echohl None
return -1
endif
let sconstruct = findfile("SConstruct", ".;")
if len(sconstruct)
exec "cd" fnameescape(fnamemodify(sconstruct, ':h'))
!scons
cd -
else
echohl Error
echo "Cannot find SConstruct."
echohl None
return -1
endif
endfunction
command! -nargs=0 Scons call <SID>Scons()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment