Created
November 4, 2011 18:59
-
-
Save bps/1340179 to your computer and use it in GitHub Desktop.
Vim Scons command
This file contains hidden or 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
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