Mercurial > dotfiles
comparison .chezmoitemplates/init.lua @ 638:652cffd59311
add beancount config
author | zegervdv <zegervdv@me.com> |
---|---|
date | Thu, 18 Aug 2022 21:10:15 +0200 |
parents | 44c31cfaaf8a |
children | b6c64ebecc3e |
comparison
equal
deleted
inserted
replaced
637:8405102e55c4 | 638:652cffd59311 |
---|---|
397 'jose-elias-alvarez/null-ls.nvim', | 397 'jose-elias-alvarez/null-ls.nvim', |
398 requires = 'nvim-lua/plenary.nvim', | 398 requires = 'nvim-lua/plenary.nvim', |
399 } | 399 } |
400 use { | 400 use { |
401 'lukas-reineke/lsp-format.nvim', | 401 'lukas-reineke/lsp-format.nvim', |
402 config = function() require('lsp-format').setup { exclude = { 'sumneko_lua' } } end, | 402 config = function() require('lsp-format').setup { exclude = { 'sumneko_lua', 'beancount' } } end, |
403 } | 403 } |
404 use { 'folke/lua-dev.nvim' } | 404 use { 'folke/lua-dev.nvim' } |
405 use { | 405 use { |
406 'smjonas/inc-rename.nvim', | 406 'smjonas/inc-rename.nvim', |
407 config = function() | 407 config = function() |
640 keys = { [[<F12>]] }, | 640 keys = { [[<F12>]] }, |
641 } | 641 } |
642 | 642 |
643 -- Filetypes | 643 -- Filetypes |
644 use { 'lepture/vim-jinja' } | 644 use { 'lepture/vim-jinja' } |
645 | |
646 use { 'nathangrigg/vim-beancount' } | |
645 | 647 |
646 -- Integration with external tools | 648 -- Integration with external tools |
647 use { | 649 use { |
648 'glacambre/firenvim', | 650 'glacambre/firenvim', |
649 run = function() vim.fn['firenvim#install'](0) end, | 651 run = function() vim.fn['firenvim#install'](0) end, |
1065 on_attach = on_attach, | 1067 on_attach = on_attach, |
1066 capabilities = capabilities, | 1068 capabilities = capabilities, |
1067 root_dir = root_dir, | 1069 root_dir = root_dir, |
1068 } | 1070 } |
1069 | 1071 |
1072 local bean_file = os.getenv 'BEAN_FILE' | |
1073 if bean_file then | |
1074 lsp.beancount.setup { | |
1075 on_attach = on_attach, | |
1076 capabilities = capabilities, | |
1077 root_dir = root_dir, | |
1078 init_options = { | |
1079 journal_file = bean_file, | |
1080 }, | |
1081 } | |
1082 local helpers = require 'null-ls.helpers' | |
1083 local bean_format = { | |
1084 name = 'bean-format', | |
1085 filetypes = { 'beancount' }, | |
1086 method = null_ls.methods.FORMATTING, | |
1087 generator = helpers.formatter_factory { | |
1088 command = 'bean-format', | |
1089 args = { '-w', '80' }, | |
1090 to_stdin = true, | |
1091 }, | |
1092 } | |
1093 null_ls.register { bean_format } | |
1094 end | |
1095 | |
1070 null_ls.setup { | 1096 null_ls.setup { |
1071 sources = { | 1097 sources = { |
1072 null_ls.builtins.formatting.black.with { extra_args = { '--line-length', '100' } }, | 1098 null_ls.builtins.formatting.black.with { extra_args = { '--line-length', '100' } }, |
1073 null_ls.builtins.formatting.stylua, | 1099 null_ls.builtins.formatting.stylua, |
1074 null_ls.builtins.formatting.cbfmt, | 1100 null_ls.builtins.formatting.cbfmt, |