Closed cdepillabout closed 9 years ago
They have a load guard variable which is the typical solution offered for dealing with situations like this for Vim plugins:
autocmd FileType haskell
\ if !executable('ghc-mod')
\ let b:did_ftplugin_ghcmod = 1
\ endif
should work.
I support @ches 's idea. Set b:did_ftplugin_ghcmod
at your favorite timing.
@cdepillabout long time ago, but did you ever find a solution for this? whatever I try, I am unable to get the timing of this right.
@pjan I'm sorry, I don't remember how I solved this. I'm pretty sure I checked to see if ghcmod
is on my PATH before loading ghcmod-vim
.
Here is my .vimrc if you want to look through it for ghcmod stuff:
https://github.com/cdepillabout/docs/blob/master/dot_files/dot_vimrc
When starting vim with ghcmod-vim enabled, it throws up an error message "ghcmod: ghc-mod is not executable!". This is annoying.
I am using NixOS, so I don't have ghc-mod installed globally, just in the environments for my haskell projects. Sometimes I use vim to open up a Haskell file without first entering an environment, and I get this warning. I then have to press Enter.
I could work around it by checking in my .vimrc file whether or not ghc-mod exists on the path, but I think not printing an error from ghcmod-vim is a better solution.
I can see how getting errors printed to the screen could be helpful for someone trying to debug problems, but it's just annoying when I know what's going on don't have ghc-mod on my path on purpose.