ledger / vim-ledger

Vim plugin for Ledger
GNU General Public License v2.0
370 stars 56 forks source link

feat: Account name completion using matchfuzzy #156

Closed lakshayg closed 4 months ago

lakshayg commented 4 months ago

This commit adds an alternative way for completing account names to the pre-existing completion function. Here's an example:

commodity 1,000.00 USD

account Assets:Bank:Bofa:Checking
account Assets:Bank:Bofa:Savings
account Assets:Bank:Chase:Checking
account Assets:Bank:Chase:Savings
account Expenses:Coffee

2024-01-10  Buy Coffee
  Expenses:Coffee                 5.00 USD
  bofa█
       ,___________________________,
       | Assets:Bank:Bofa:Savings  |
       | Assets:Bank:Bofa:Checking |
       '---------------------------'

The older completion mechanism would need several keypresses before it can insert the Bofa:Checking account especially in a big ledger with a lot of accounts. I have found this fuzzy approach to be faster in my workflow and expect that other people might find it helpful too.

lakshayg commented 4 months ago

This PR is currently missing documentation which I can add once I get some reviews and it looks like a good addition to the plugin.

lakshayg commented 4 months ago

@alerque I have updated the docs. Please re-review