vim

vim config files
git clone https://git.bracken.jp/vim.git
Log | Files | Refs | LICENSE

commit abf6bc08291946c8ea725f170e781f76f291ad59
parent e71b25b8d0a53d675ca8287d28d7d67d81d7466b
Author: Chris Bracken <chris@bracken.jp>
Date:   Tue, 14 Jun 2022 19:13:46 -0700

beancount: align amount on . only in beancount ft

Previously, on opening a beancount file, we added a mapping for '.' to
insert a period and align the amount on that period; however, we didn't
limit this mapping to the current buffer, so it affected all open files.
This limits these mappings to just beancount files.

Diffstat:
Mvimrc | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vimrc b/vimrc @@ -6,6 +6,7 @@ if has("autocmd") autocmd! endif +. filetype off call plug#begin('~/.vim/plugged') @@ -116,8 +117,8 @@ function! BeancountComplete() endif return '\<Tab>' endfunction -au FileType beancount inoremap <silent> <Tab> <C-r>=BeancountComplete()<CR> -au FileType beancount inoremap . .<C-\><C-o>:AlignCommodity<CR> +au FileType beancount inoremap <buffer> <silent> <Tab> <C-r>=BeancountComplete()<CR> +au FileType beancount inoremap <buffer> . .<C-\><C-o>:AlignCommodity<CR> au FileType beancount nnoremap <buffer> <leader>= :AlignCommodity<CR> au FileType beancount vnoremap <buffer> <leader>= :AlignCommodity<CR>