File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ Tips and useful commands
42
42
43
43
* Align commodities at the decimal point. See ` help ledger-tips ` .
44
44
45
+ * ` :call ledger#entry() `
46
+
47
+ will replace the text on the current line with a new transaction based
48
+ on the replaced text.
49
+
45
50
Configuration
46
51
-------------
47
52
Original file line number Diff line number Diff line change @@ -393,3 +393,10 @@ function! ledger#align_amount_at_cursor()
393
393
endif
394
394
endf !
395
395
396
+ func ! ledger#entry ()
397
+ " enter a new transaction based on the text in the current line.
398
+ let l = line (' .' ) - 1 " Insert transaction at the current line (i.e., below the line above the current one)
399
+ let query = getline (' .' )
400
+ normal " _dd
401
+ exec l . ' read !' g: ledger_bin ' -f' shellescape (expand (' %' )) ' entry' shellescape (query)
402
+ endfunc
Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ Tips and useful commands
85
85
86
86
Now, you may type `123.45 <C-l> ` , and have `$123 .45 ` properly aligned (assuming
87
87
your default commodity is set to `' $' ` ).
88
+
89
+ * `:call ledger#entry()`
90
+
91
+ enters a new transaction based on the text in the current line.
92
+ The text in the current line is replaced by the new transaction.
93
+ This is a front end to `ledger entry`.
94
+
88
95
==============================================================================
89
96
SETTINGS *ledger-settings*
90
97
You can’t perform that action at this time.
0 commit comments