diff --git a/nvim/.config/nvim/compiler/ghci.vim b/nvim/.config/nvim/compiler/ghci.vim new file mode 100644 index 0000000..b46d776 --- /dev/null +++ b/nvim/.config/nvim/compiler/ghci.vim @@ -0,0 +1,20 @@ +" Vim compiler file +" Compiler: Haskell repl - ghci +" Author: Maxime Bourget + +if exists("current_compiler") + finish +endif +let current_compiler="ghci" +" inherit from stack settings +" compiler stack + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=stack\ repl + +CompilerSet errorformat+=%f:%.%l%.%c%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/nvim/.config/nvim/compiler/stack.vim b/nvim/.config/nvim/compiler/stack.vim new file mode 100644 index 0000000..10d659f --- /dev/null +++ b/nvim/.config/nvim/compiler/stack.vim @@ -0,0 +1,42 @@ +" Vim compiler file +" Compiler: Haskell Stack +" Maintainer: Daniel Campoverde +" 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 diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 156c67e..5963a43 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -386,7 +386,11 @@ augroup END augroup haskell_maps au! - au FileType haskell nmap b :NeomakeSh stack build + " https://www.reddit.com/r/neovim/comments/es8wn7/haskell_makeprg_for_stack_build/ + " https://github.com/maxigit/vimrc/tree/2020/compiler + au FileType haskell compiler stack + au FileType haskell setlocal makeprg=stack\ build + au FileType haskell nmap b :Neomake! au FileType haskell nmap t :NeomakeSh stack exec -- hasktags -x -c . au FileType haskell nmap g :Ghcid au FileType haskell nmap k :GhcidKill