alx741 / vim-hindent

Vim Haskell Hindent integration plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setup issue

mvolkmann opened this issue · comments

I copied the haskell.vim file into my ~/.vim/ftplugins directory.
When I start Vim now I get a bunch of errors like this:
Function name does not match script file name: hindent#HindentEnable.
Is it obvious what is going wrong?

The file hindent.vim in this repo should exist in the same directory tree, so what you actually need in your personal ~/.vim directory is this: ~/.vim/ftplugins/haskell/hindent.vim.

Note that the actual plugin file in this repo is called hindent.vim, not haskell.vim as your comment implies, so be sure to use the same file name (it is relevant at runtime).

Let me know if that did solve the issue.

Thanks! No errors now.
When I enter :%!hindent, it formats the file correctly.
However, just saving the file doesn't trigger that.
I do have this in my .vimrc:
let g:hindent_on_save = 1

mmh, have you tried with call hindent#HindentEnable()?

There are some related functions: hindent#HindentEnable(), hindent#HindentDisable() and hindent#HindentToggle(), Play around with them to see if it works

More info. After I saved a change to a .hs file I entered :mess to see if there was a message. It says "Hindent not found in $PATH". However in my shell when I enter "which hindent" it finds it. So the line "if !executable('hindent')" in hindent.vim is failing for me.

I'm using the fish shell. I just tried in bash and it works. I wonder why executable('hindent') only fails in fish.

I killed that shell and started a new one. Now it works under fish. Not sure why it didn't work in the existing shell.