Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt compiler to hledger #149

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion compiler/ledger.vim
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ if !b:is_hledger
CompilerSet errorformat+=%-G%.%#
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ source\ ' . shellescape(expand(g:ledger_main))
else
exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)'
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ check\ '. substitute(g:ledger_extra_options, ' ', '\\ ', 'g')
CompilerSet errorformat=%Ehledger:\ %trror:\ %f:%l:%c%.%#:,%-C\ \ \|\\s%#,%-C\%l\ \|%.%#,%-C\ \ \|\\s%#,%-C\ \ \|%p^,%+C%m,%-Z\\s%#
" Skip all other lines:
CompilerSet errorformat+=%-G%.%#
endif
6 changes: 5 additions & 1 deletion doc/ledger.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ Tips and useful commands
:silent make | redraw! | cwindow

It is recommended to set the value of `g:ledger_extra_options` (see below)
as follows:
as follows for ledger:

let g:ledger_extra_options = '--pedantic --explicit --check-payees'

and as follows for hledger:

let g:ledger_extra_options = '--strict ordereddates payees uniqueleafnames'

to catch most potential problems in your source file.

* Remap vim paragraph motion to move by transaction.
Expand Down
Loading