aboutsummaryrefslogtreecommitdiffstats
path: root/doc/beancount.txt
blob: 0f6c29776fac3c8808a0d8ab124265fa7f13f677 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
beancount.txt  Filetype plugin for beancount files

Author:   Nathan Grigg <http://nathangrigg.net>
Repo:     https://github.com/nathangrigg/vim-beancount
License:  Same terms as Vim itself (see |license|).

INTRODUCTION                                          *beancount*

Filetype plugin and functions for working with beancount files.

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:decimal_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 alignment character can be set using
                    `g:beancount_decimal_separator`.  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-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>
<



COMPLETION                                           *beancount-completion*

You can complete account names using CTRL-X CTRL-O. |i_CTRL-X_CTRL-O|
Accounts must have their `open` directive in the current file. Completion is
always case sensitive and exact. If the base string includes colons, each
colon-separated peice can separately match a peice of the account.

For example, `Ex:Other` would complete to `Expenses:Donations:Other` or
`Liabilities:AmericanExpress:InterestOther`.

SYNTAX                                              *beancount-syntax*

We use the following syntax highlighting groups:

    beanKeyword:  Keywords such as open, close, option.
    beanOptionTitle: The first argument to the option keyword.
    beanDate: A date in a beancount directive.
    beanString: Strings, such as account descriptions.
    beanComment: Comments.
    beanAccount: Account names.
    beanAmount: Monetary amounts.
    beanCurrency: Currency codes.
    beanCost: Cost, e.g. {100.00 USD}
    beanPrice: Price, e.g. @ 100.00 USD

FILETYPE DETECTION                                  *beancount-ftdetect*

The plugin considers files of the form `*.bean` and `*.beancount` to be
beancount files.

  vim:tw=78:et:ft=help:norl: