Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim-haskellmode and hsenv

Tags:

vim

haskell

cabal

I've been using hsenv (with great success!) to deal with the usual cabal dependency issues.

Its terrific, but there is one glitch I can't get around: how to persuade the (also excellent!) vim-haskellmode to use the environment variables set by hsenv -- namely the paths to GHC, cabal database and so on when compiling, generating tags etc.

Does anyone know how to solve this problem?

like image 258
Ranjit Jhala Avatar asked Feb 28 '13 19:02

Ranjit Jhala


2 Answers

Sorry, hit the wrong button -- I should be asking questions about how to use SO instead :)

Anyways, an even better trick is to put this into the .vimrc

let g:ghc=system("which ghc") 

This way (assuming that g:ghc gets bound when you run vim) it will pick up whichever ghc is being currently used (by hsenv).

Ranjit Jhala.

like image 81
user2121636 Avatar answered Sep 29 '22 18:09

user2121636


One, simple solution is to hack one's .vimrc so that

let g:ghc="/path/to/hsenv/ghc"
like image 40
2 revs, 2 users 83% Avatar answered Sep 29 '22 17:09

2 revs, 2 users 83%