Skip to content

Commit

Permalink
:compiler cabal
Browse files Browse the repository at this point in the history
  • Loading branch information
dag committed Apr 2, 2012
1 parent 8c95d07 commit 4db1614
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions compiler/cabal.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
if exists('current_compiler')
finish
endif
let current_compiler = 'cabal'

let s:errorformat = join([
\ '%E%f:%l:%c:',
\ '%+C %m',
\ '%-Z%[%^ ]',
\ ], ',')
execute 'CompilerSet errorformat=' . escape(s:errorformat, ' ')

CompilerSet makeprg=cabal\ build
CompilerSet shellpipe&
20 changes: 20 additions & 0 deletions doc/vim2hs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,32 @@ COMMANDS *vim2hs-commands*
=============================================================================
COMPILERS *vim2hs-compilers*

All compilers shipped with vim2hs use |:CompilerSet| and as such can be
enabled globally using ":compiler!". Optionally you can use an |autocommand|
or |ftplugin| to enable a compiler only for Haskell buffers, for example:
>
autocmd FileType haskell compiler cabal
<
*quickfix-hlint* *compiler-hlint*
:compiler hlint Configure |:make| for using HLint. Requires hlint
(available from Hackage) to be installed and in $PATH.

See also |g:hlint_args|.

*quickfix-cabal* *compiler-cabal*
:compiler cabal Configure |:make| for using Cabal. Requires cabal
(available as cabal-install from Hackage) to be
installed and in $PATH. Runs "cabal build" which also
works with cabal-dev, but you have to install
dependencies and run configure first, for example by
running "cabal-dev install".

Warnings from GHC will be parsed as errors due to
limitations of Vim's |errorformat| patterns and the
complexity of GHC's output. This might be resolved in
the future by filtering Cabal's output through a
script.


=============================================================================
TABULAR *vim2hs-tabular*
Expand Down

0 comments on commit 4db1614

Please sign in to comment.