ledger / vim-ledger

Vim plugin for Ledger
GNU General Public License v2.0
372 stars 55 forks source link

Allow checking on save #155

Closed lakshayg closed 6 months ago

lakshayg commented 7 months ago

It would be nice to have a way to automatically run the check command when a file is saved. I have a rudimentary version of this working for me locally.

I do this by having a compiler plugin defined for hledger which runs the check command. I trigger make on file write by using an autocmd which then loads up any errors in the quickfix list

Open to discussing ideas on how to make this more general and include it with this plugin. I think it needs to allow the user to:

  1. configure ledger/hledger
  2. enable/disable check on write
  3. check with or without the --strict flag
lakshayg commented 6 months ago

Just realized that vim-ledger already defines a compiler and has instructions on how to use it for error checking in the manual.