From 79c7b4ab7c0df82ccd282bfd1774c1914ae912a2 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Thu, 30 Aug 2018 14:57:07 -0400 Subject: Adds LedgerSort func and config for vim-ledger --- vim/.vimrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vim/.vimrc b/vim/.vimrc index 4aeb6f2..1fc49ff 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -21,5 +21,13 @@ map W :WordCount colorscheme moonfly au BufRead,BufNewFile *.go set filetype=go +au BufRead,BufNewFile *.ldg set filetype=ledger + +function LedgerSort() + :%! ledger -f - print --sort 'date, amount' + :%LedgerAlign + :%s/^ /\t/g +endfunction +command LedgerSort call LedgerSort() filetype plugin on -- cgit v1.1