mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 20:13:51 -05:00
33 lines
1.1 KiB
VimL
33 lines
1.1 KiB
VimL
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ledger') == -1
|
|
|
|
" Vim Compiler File
|
|
" Compiler: ledger
|
|
" by Johann Klähn; Use according to the terms of the GPL>=2.
|
|
" vim:ts=2:sw=2:sts=2:foldmethod=marker
|
|
|
|
scriptencoding utf-8
|
|
|
|
if exists('current_compiler') || !exists('g:ledger_bin')
|
|
finish
|
|
endif
|
|
|
|
let current_compiler = g:ledger_bin
|
|
|
|
if exists(':CompilerSet') != 2
|
|
command -nargs=* CompilerSet setlocal <args>
|
|
endif
|
|
|
|
if !g:ledger_is_hledger
|
|
" Capture Ledger errors (%-C ignores all lines between "While parsing..." and "Error:..."):
|
|
CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%#
|
|
" Capture Ledger warnings:
|
|
CompilerSet errorformat+=%tarning:\ \"%f\"\\,\ line\ %l:\ %m
|
|
" Skip all other lines:
|
|
CompilerSet errorformat+=%-G%.%#
|
|
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ %\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ source\ %'
|
|
else
|
|
exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ %\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)'
|
|
endif
|
|
|
|
endif
|