Skip to content

Commit

Permalink
Update and document compiler to adapt to hledger and Winodws (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konfekt committed Nov 6, 2023
1 parent 8e735f8 commit 281346a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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

0 comments on commit 281346a

Please sign in to comment.