I set up Claus Reinke's Haskell mode for Vim today. Based on the documentation and code, it doesn't appear to have gotten much exposure to a Mac. And I didn't find anybody else describing what to do. So, this is my little contribution towards helping those Mac+Vim users that want to use it.
wget http://projects.haskell.org/haskellmode-vim/vimfiles/haskellmode-20090410.vba vim haskellmode-20090410.vba
Once in Vim, source the file:
" Configure browser for haskell_doc.vim let g:haddock_browser = "open" let g:haddock_browser_callformat = "%s %s"
The Mac OS X
open command uses the default browser to open URLs, and the internals of the Vim script use URLs for Haddock pages and such. So, the above settings will tell Haskell mode to open any URL in the default browser.
If you decide you don't want to use your default browser, you can then, for example, use Firefox instead of Safari.
let g:haddock_browser = "open" let g:haddock_browser_callformat = "%s -a Firefox %s"
Note that we can't change
g:haddock_browser here. The script is using
executable() to verify
g:haddock_browser, so we can't add flags to it.
And that's it! Now, you can quit and open up a Haskell file to play with it. Hopefully, your GHC build has the documentation for the libraries and the user guide, so you can take advantage of the undocumented
:Doc command. Unfortunately, I'm using the MacPorts GHC, and it doesn't build the user guide documentation.
If you're not sure whether you should set up Haskell mode for Vim, check out these nice screencasts that demonstrate its power (and the