File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -99,13 +99,21 @@ Tips and useful commands
99
99
100
100
when the cursor is on a number or immediately after it, invokes
101
101
`ledger#align_amount_at_cursor ()` to align it and add the default currency;
102
- otherwise, performs autocompletion. If you define the following mappings
103
- then you may perform both autocompletion and alignment using the <Tab> key:
102
+ otherwise, performs autocompletion. If you define the following mappings in
103
+ your `.vimrc` then you may perform both autocompletion and alignment using
104
+ the <Tab> key:
104
105
105
106
au FileType ledger inoremap <silent> <Tab> \
106
107
<C-r> =ledger#autocomplete_and_align()<CR>
107
108
au FileType ledger vnoremap <silent> <Tab> :LedgerAlign<CR>
108
109
110
+ Alternatively, you may create a file `.vim /after/ ftplugin/ledger.vim `
111
+ containing the following definitions:
112
+
113
+ inoremap <silent> <buffer> <Tab> \
114
+ <C-r> =ledger#autocomplete_and_align()<CR>
115
+ vnoremap <silent> <buffer> <Tab> :LedgerAlign<CR>
116
+
109
117
Now, you may type `asset:check<Tab><Space> 123.45 <Tab> ` , and have the
110
118
account name autocompleted and `$123 .45 ` properly aligned (assuming your
111
119
default commodity is set to `' $' ` ). Or you may press <Tab> in Visual mode
You can’t perform that action at this time.
0 commit comments