Skip to content
master
Go to file
Code

Latest commit

The beancount documentation around what makes an allowable "Account name" is subtle, and has been very slightly misinterpreted here in vim-beancount.

Here's what the doc (https://beancount.github.io/docs/beancount_language_syntax.html#accounts) says:

"An account name is a colon-separated list of capitalized words which begin with a letter, and whose first word must be one of five account types (Assets Liabilities Equity Income Expenses). Each component of the account names begin with a capital letter or a number and are followed by letters, numbers or dash (-) characters. All other characters are disallowed."

This has been interpreted here that the leading character of each *component* must be a capital letter, whereas actually the 2nd, and later, components may start with a number.

As can be seen in the actual beancount/v2 code (https://github.com/beancount/beancount/blob/v2/beancount/core/account.py#L28), the "first character must be upper case" requirement is *only* true of the first/root account name component, which is limited to Assets/Liabilities/Equity/Income/Expenses, so that's true regardless.

This might seem like a minor thing, but vim-beancount's current regex stops auto-alignment of useful account names such as:

```
Assets:ISA:2020-2021
Expenses:Groceries:2019-2020
```

In other words, forcing the use of workarounds like "...:Y2020-2021". Well, "forcing" if one wants to get consistent automatic alignment across an entire file :-)

This commit marries up the vim-beancount regex with the beancount/v2 implementation at https://github.com/beancount/beancount/blob/v2/beancount/core/account.py#L28.
6d762be

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
doc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

vim-beancount

This is the beancount filetype for Vim. Includes highlighting and some basic functions.

Installation

I suggest Vundle or Pathogen, but you can also just copy all of the files into the appropriate places inside your '.vim' directory.

Feature Highlights

  • Syntax highlighting and indenting.

  • Completion: Type Ex:Oth followed by ^X^O to get Expenses:Donations:Other (provided that you have opened an account with that name).

  • Use :make to run bean-check and load errors in the quickfix window.

  • The AlignCommodity command lines up all your decimal points.

For full details, see doc/beancount.txt.

About

Vim ftplugin for beancount

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.