top | item 44950952

Vim Macros for Beancount

57 points| xarcolade | 6 months ago |tangled.sh

17 comments

order

xarcolade|6 months ago

Hello! Sharing on HN is a first for me. When I wrote this I thought I was producing something with a steady enough on-ramp that someone could follow along with a little bit of sustained curiosity. After sharing it with some friends I realise it might still be a steeper/poorly constructed ramp than I initially thought. Either way I'd love to hear from you if you found this interesting!

vanous|6 months ago

Very cool! A while ago i did something similar and tried to learn vim more in depth by creating some more complex macros - several of them, to convert some text snippets into markdown. Problem was, that several months later i could not exactly remember some details of these "reusable" macros - where exactly to place cursor when starting them, the order of execution and so on. Thankfully, vim has the amazing ability to run commands/script on text selection, so i rewrote my macros in a scripting language. It has several bonus points: i can store them in git and track changes, code can be self-documented via comments. My macros were not too complex, but still, using a proper scripting ended up being much better.

xz18r|6 months ago

Also check out beancount-mode for emacs: https://github.com/beancount/beancount-mode

xarcolade|6 months ago

I've been struggling to on-ramp and sustain using Emacs for a while now. The paradigm shift from vim for me is frustratingly vast. I know I just need to give it the same patience I gave vim many years ago :)

djhworld|6 months ago

I really wanted to like the vim-beancount plugin but it's just too buggy for me, so I've always just come crawling back to beancount-mode in emacs. It's the only thing I use emacs for and I use evil mode for vim keybindings :)

njt|6 months ago

Just wanted to chime in on my beancount workflow, which you may also want to check out.

I also use vim, and I use it a bit to edit my beancount files, but I mostly use fava, a most excellent web interface for beancount. In addition to having a built in editor (which does formatting and can catch errors and show you exactly where they are), it allows you to quickly add new transactions based on old ones — the dialog box allows you to choose from previously used accounts to speed up input. It’s a lifesaver. I don’t think I would have continued using beancount long term if it wasn’t for fava.

Just about the only negative thing I can say about fava is that it does formatting slightly differently from bean-format. I actually prefer it to beancount, but there are some cases where I prefer the native formatting (like when declaring/opening accounts). So for some months, I will switch from one to another. A minor nitpick, but it’s slightly annoying.

johntash|6 months ago

Fava is great. My only problem is that I was lazy and haven't imported anything for at least 2 years, and now it feels too daunting to try and catch up.

Bengalilol|6 months ago

[deleted]

icy|6 months ago

tangled being in alpha has no bearing on the submitted content whatsoever. i’m confused by this comment.

the author being anonymous doesn’t matter either? there’s tons of good software written by pseudonymous authors.

i don’t understand what the “federation risks” even means so i won’t bother.

the last point is a bit of a giveaway that this is llm generated and you didn’t actually click on the link yourself. fwiw the code is entirely available for you to look at.