Skip to content

Instantly share code, notes, and snippets.

@kljohann
kljohann / after_ftplugin_ledger.vim
Created July 22, 2013 18:58
Join transactions in a ledger file. All transaction metadata will be transferred to the first transaction. Postings of other transactions will be lost. I use this to reconcile auto-generated (by converting from CSV) postings.
function! LedgerJoinTransactions(begin, end)
let xacts = ledger#transactions(a:begin, a:end)
if len(xacts) < 2
return
endif
let target = remove(xacts, 0)
call reverse(xacts)
" safe view / position
@kljohann
kljohann / vundle-to-mr.vim
Created July 22, 2013 18:54
`:source %` this to print out all your [vundle](https://github.com/gmarik/vundle) bundles converted to [myrepos](http://myrepos.branchable.com/) format.
try
unlet s:mrconfig
"unlet s:bpath
catch /No such/
endtry
let s:mrconfig = []
for bundle in g:bundles
let s:bpath = bundle.path()
if $HOME != ''
let s:bpath = substitute(s:bpath, '^\V'.$HOME, '$HOME', '')