vim

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

commit 7e1625159f7b76e0d8aa9cde168af677c3d70a04
parent 9c077e1d04b8a090f04e7041e4e4923c33800457
Author: Chris Bracken <chris@bracken.jp>
Date:   Fri,  1 Oct 2021 09:13:41 -0700

Add beancount plugin

Diffstat:
Mvimrc | 20++++++++++++++++++++
1 file changed, 20 insertions(+), 0 deletions(-)

diff --git a/vimrc b/vimrc @@ -10,6 +10,7 @@ Plugin 'spacehi.vim' " Highlight bad whitespace Plugin 'vimwiki/vimwiki' " Language support plugins. +Plugin 'nathangrigg/vim-beancount' Plugin 'cespare/vim-toml' Plugin 'dart-lang/dart-vim-plugin' Plugin 'fatih/vim-go' @@ -95,6 +96,25 @@ let g:go_highlight_operators = 1 let g:go_highlight_build_constraints = 1 let g:syntastic_go_checkers = ["go", "golint", "errcheck"] +" Configure ledger. +let g:ledger_date_format = '%Y-%m-%d' +au FileType ledger inoremap <silent> <Tab> <C-r>=ledger#autocomplete_and_align()<CR> +au FileType ledger vnoremap <silent> <Tab> :LedgerAlign<CR> + +" Configure beancount. +let g:beancount_separator_col = 60 +function! BeancountComplete() + let line = getline('.') + if matchend(line, '^\s\+') >= col('.') - 1 + return '\<C-x>\<C-o>' + 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 nnoremap <buffer> <leader>= :AlignCommodity<CR> +au FileType beancount vnoremap <buffer> <leader>= :AlignCommodity<CR> + " Configure VimWiki. let wiki_1 = {} let wiki_1.index = 'Home'