dotfiles/nvim/.config/nvim/compiler/stack.vim
Sanchayan Maity a5792a3f3a nvim: Use a custom stack compiler for Haskell
Neovim has a "stack" compiler file but this does not seem to work,
at least not in the shitty monorepo I am working on. Someone provided a
solution on Reddit which uses a custom compiler file and has been
modified to work on modules. Which is also perhaps why it doesn't work
in the monorepo project at work.

https://www.reddit.com/r/neovim/comments/es8wn7/haskell_makeprg_for_stack_build/
https://github.com/maxigit/vimrc/tree/2020/compiler

Use them and tie it up with Neomake! change.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2020-01-27 09:30:19 +05:30

43 lines
1.1 KiB
VimL

" Vim compiler file
" Compiler: Haskell Stack
" Maintainer: Daniel Campoverde <alx@sillybytes.net>
" Latest Revision: 2018-08-27
if exists("current_compiler")
finish
endif
let current_compiler = "stack"
let s:cpo_save = &cpo
set cpo&vim
CompilerSet errorformat=
\%-G%.%#:\ build\ %.%#,
\%-G%.%#:\ configure\ %.%#,
\%-G[%.%#]%.%#,
\%-G%.%#preprocessing\ %.%#,
\%-G%.%#configuring\ %.%#,
\%-G%.%#building\ %.%#,
\%-G%.%#linking\ %.%#,
\%-G%.%#installing\ %.%#,
\%-G%.%#registering\ %.%#,
\%-G%.%#:\ copy/register%.%#,
\%-G%.%#process\ exited\ %.%#,
\%-G%.%#--builddir=%.%#,
\%-G--%.%#,
\%-G%.%#\|%.%#,
\%E%o\ %#>%f:%l:%c:\ error:,%+Z\ \ \ \ %m,
\%E%o\ %#>%f:%l:%c:\ error:\ %m,%-Z,
\%W%o\ %#>%f:%l:%c:\ warning:,%+Z\ \ \ \ %m,
\%W%o\ %#>%f:%l:%c:\ warning:\ %m,%-Z,
\%E%f:%l:%c:\ error:,%+Z\ \ \ \ %m,
\%E%f:%l:%c:\ error:\ %m,%-Z,
\%W%f:%l:%c:\ warning:,%+Z\ \ \ \ %m,
\%W%f:%l:%c:\ warning:\ %m,%-Z,
CompilerSet makeprg=stack\ --no-terminal
let &cpo = s:cpo_save
unlet s:cpo_save