Thursday, January 2, 2025

Re: Adding a single space to 'isk' but not multiple spaces?

On 2025-01-02, Tim Chase <vim@tim.thechases.com> wrote:
> Using ledger(1) for finances, fields are usually delimited by runs
> of 2+ spaces (or a tab), allowing a single space in the account-name.
> So I might have a transaction like
>
> 2024-012-31 ! Groceries
> Expenses:Household:Groceries:Food Lion $18.43
> Liabilities:Credit Card:Visa -$18.43
>
> (note the 2+ space indent and the 2+ space separation between the
> account and the amount, while the single space in "Food Lion" and
> "Credit Card")
>
> It would be awfully handy to have colons and single-spaces be part
> of 'isk' so that i_CTRL-N and i_CTRL-P can find full accounts
> is there a better solution I've overlooked?

Do you know about https://github.com/ledger/vim-ledger? Even if you
don't want a plugin, you may still copy its LedgerComplete omnifunc
function. I'm not using it currently, but I wrote the initial version of
it, and unless something was changed, it should allow you to complete
accounts by specifying prefixes. So, for instance, Ex:F:G<tab> becomes
Expenses:Food:Groceries. Very handy.

Btw, I have a bunch of mappings for several reports. They may not be up
to date, but in case you're interested:

https://github.com/lifepillar/vimrc/blob/master/after/ftplugin/ledger.vim

Hope this helps,
Life


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/vl6vn3%24fci%241%40ciao.gmane.io.

No comments: