Skip to content

Instantly share code, notes, and snippets.

@osyo-manga
Created November 15, 2012 16:35
Show Gist options
  • Save osyo-manga/4079591 to your computer and use it in GitHub Desktop.
Save osyo-manga/4079591 to your computer and use it in GitHub Desktop.
let s:msvc_dirs = [
\ "C:/Program\ Files/Microsoft\ Visual\ Studio\ 10.0",
\ "C:/Program\ Files/Microsoft\ Visual\ Studio\ 9.0",
\ "C:/Program\ Files/Microsoft\ Visual\ Studio\ 8.0",
\]
function! s:set_msvc_path(msvc_path)
if has_key(s:, "msvc_path") || !isdirectory(a:msvc_path)
return
endif
let s:msvc_path = a:msvc_path
let path = a:msvc_path
let $VSINSTALLDIR=path
let $VCINSTALLDIR=$VSINSTALLDIR."/VC"
let $DevEnvDir=$VSINSTALLDIR."/Common7/IDE;"
let $PATH=$VSINSTALLDIR."Common7/Tools;".$PATH
let $PATH=$VCINSTALLDIR."/bin;".$PATH
let $PATH=$DevEnvDir.";".$PATH
let $INCLUDE=$VCINSTALLDIR."/include;".$INCLUDE
let $LIB=$VCINSTALLDIR."/LIB;".$LIB
let $LIBPATH=$VCINSTALLDIR."/LIB;".$LIBPATH
endfunction
function! s:setup_msvc_path()
    call s:set_msvc_path(get(filter(copy(s:msvc_dirs), "isdirectory(v:val)"), 0, ""))
endfunction
call s:setup_msvc_path()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment