diff options
author | Wynn Wolf Arbor | 2020-03-10 17:37:03 +0100 |
---|---|---|
committer | Wynn Wolf Arbor | 2020-04-28 17:59:15 +0200 |
commit | 9f853addd1fdb44966eaaf904114542061a38c5b (patch) | |
tree | 126393f337a17262711f2cdefdbe46bf3297caca /doc | |
parent | 22eb7ac8970394a881946f408a5bc972a72c785d (diff) | |
download | vim-beancount-9f853addd1fdb44966eaaf904114542061a38c5b.tar.gz |
Replace AlignCommodity with bean-format
AlignCommodity replicates the functionality of the bean-format command
that is shipped with beancount itself. Therefore, we can fully replace
it by having vim invoke bean-format through formatprg.
Even though bean-format's output might differ from AlignCommodity in
significant ways, we feel that using one unified tool is superior to
having several (possibly incompatible) custom implementations. That way,
if bean-format is improved upon in the future, all downstream consumers
profit. For regular usage, however, this change should be transparent.
Note that while bean-format supports a few different ways of formatting
the ledger, we have opted to hard-code one specific setting. This will
match the default behaviour of fava, aligning currencies in column 61.
Managing the arguments passed to bean-format dynamically is considered
out of scope, especially given the fact that the user need only override
formatprg to get a custom setting.
This commit will also drop the g:beancount_separator_col variable and
the tests for AlignCommodity. Ideally, testing will now done upstream
for bean-format itself.
Diffstat (limited to '')
-rw-r--r-- | doc/beancount.txt | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/doc/beancount.txt b/doc/beancount.txt index 63e25f5..e3801cc 100644 --- a/doc/beancount.txt +++ b/doc/beancount.txt @@ -21,35 +21,6 @@ Contents: COMMANDS *beancount-commands* - *beancount-:AlignCommodity* -:AlignCommodity Adds spaces between an account and commodity so that the - decimal points of the commodities all occur in the column - given by |g:beancount_separator_col|. If an amount has no - decimal point, the imaginary decimal point to the right - of the least significant digit will align. - - The command acts on a range, with the default being the - current line. If the cursor happens to be inside that - range and to the right of the account name, the cursor - will be pushed to the right the appropriate amount, so - that it remains on the same character. - - The script assumes the use of spaces for alignment. It - does not understand tabs. - - You can use the following insert-mode remap to - automatically align commodities every time you type a - decimal point: > - - inoremap . .<C-\><C-O>:AlignCommodity<CR> -< - You may also want to set other mappings for this. For - example, I use > - - nnoremap <buffer> <leader>= :AlignCommodity<CR> - vnoremap <buffer> <leader>= :AlignCommodity<CR> -< - *beancount-:GetContext* :GetContext Uses bean-doctor context to display the context of the current line. @@ -73,17 +44,16 @@ OPTIONS *beancount-options* Default value: 0 -*g:beancount_separator_col* - The column that the decimal separator is aligned to. - - Default value: 50 - *b:beancount_root* Set the root Beancount file. This is used to gather values for the completion. If not set, the current file will be used. Default value: not set +FORMATTING *beancount-formatting* + +The plugin sets |'formatprg'| to 'bean-format -c61' to provide a formatter for +beancount files. See also |gq|. COMPLETION *beancount-completion* |