Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Account name completion using matchfuzzy #156

Merged
merged 2 commits into from
May 7, 2024

Conversation

lakshayg
Copy link
Contributor

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
Copy link
Contributor Author

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.

Copy link
Member

@alerque alerque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supporting matchfuzzy sounds like a great idea, just some implementation questions, and yes docs would be nice.

ftplugin/ledger.vim Show resolved Hide resolved
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
Copy link
Contributor Author

lakshayg commented May 7, 2024

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

Copy link
Member

@alerque alerque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a minor typo that caught my eye.

README.md Outdated Show resolved Hide resolved
@alerque alerque merged commit 7b97c87 into ledger:master May 7, 2024
3 of 5 checks passed
@lakshayg lakshayg deleted the fuzzy_acct_completion branch May 7, 2024 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants