dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

commit 450336a25f14e85386ffa027edf1f62ce2223967
parent da8e96deab8db93b231897178e47b03466d61caa
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:
M.vim/vimrc | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.vim/vimrc b/.vim/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>