Skip to content

Instantly share code, notes, and snippets.

@yuga
Last active December 23, 2015 09:09
Show Gist options
  • Save yuga/6612105 to your computer and use it in GitHub Desktop.
Save yuga/6612105 to your computer and use it in GitHub Desktop.
Add support for cabal sandbox to syntastic. Write this in your .vimrc.
function! s:get_cabal_sandbox()
if filereadable('cabal.sandbox.config')
let l:output = system('cat cabal.sandbox.config | grep local-repo')
let l:dir = matchstr(substitute(l:output, '\n', ' ', 'g'), 'local-repo: \zs\S\+\ze\/packages')
return '-s ' . l:dir
else
return ''
endif
endfunction
let g:syntastic_haskell_ghc_mod_args = s:get_cabal_sandbox()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment