Neovim plugin errors as soon as I try :Ghcid
I'm on Neovim v0.3.1, with the plugin for GHCid installed as per the instructions on this Github repo. I have the following in my .ghci file:
:set -fwarn-unused-binds -fwarn-unused-imports
:set -isrc
I have a Stack project with a single source file in src/AI titled Foo.hs (which is in the exposed-modules part of my cabal file), consisting currently of a module declaration and nothing more. If I open it from the toplevel directory of my project where my .ghci file resides (that is, I call nvim src/AI/Foo.hs), and then try to do :Ghcid, I get this error:
Error detected while processing function 8:
line 2:
Ghcid: Exited with status 127
Press ENTER or type command to continue
If I try again, I get the same error, only with the function number changing.
Am I missing something here, or have I hit a bug?
Upon further investigation, it appears this happens because I have a project-local build of GHCid (using stack build) rather than a global one (using stack install). I know this because manually removing .ghci and running stack exec ghcid works just fine. Is there something I can set in my config file to allow it to still work if I have a project-local ghcid executable?
You can try adding let g:ghcid_command = "stack exec ghcid" to your vimrc before the plugin is loaded. That might do it.
EDIT: You might need to do let g:ghcid_command = "stack exec ghcid --" to ensure that any args are passed to ghcid and not stack.