Add beancount
This commit is contained in:
parent
4cee729300
commit
faf0e46498
14
init.lua
14
init.lua
|
|
@ -138,6 +138,8 @@ vim.o.timeoutlen = 300
|
||||||
-- Configure how new splits should be opened
|
-- Configure how new splits should be opened
|
||||||
vim.o.splitright = true
|
vim.o.splitright = true
|
||||||
vim.o.splitbelow = true
|
vim.o.splitbelow = true
|
||||||
|
-- Doesn't work well with WezTerm mux server; disable for now and revisit later.
|
||||||
|
vim.opt.termsync = false
|
||||||
|
|
||||||
-- Sets how neovim will display certain whitespace characters in the editor.
|
-- Sets how neovim will display certain whitespace characters in the editor.
|
||||||
-- See `:help 'list'`
|
-- See `:help 'list'`
|
||||||
|
|
@ -230,6 +232,17 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
callback = function() vim.hl.on_yank() end,
|
callback = function() vim.hl.on_yank() end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local warned_missing_bean_format = false
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = 'beancount',
|
||||||
|
group = vim.api.nvim_create_augroup('beancount-format-check', { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
if warned_missing_bean_format or vim.fn.executable 'bean-format' == 1 then return end
|
||||||
|
warned_missing_bean_format = true
|
||||||
|
vim.notify('bean-format not found. Install it with: uv tool install beancount', vim.log.levels.WARN, { title = 'conform.nvim' })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
|
|
@ -699,6 +712,7 @@ require('lazy').setup({
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
json = { 'prettier' },
|
json = { 'prettier' },
|
||||||
yaml = { 'prettier' },
|
yaml = { 'prettier' },
|
||||||
|
beancount = { 'bean-format' },
|
||||||
-- Conform can also run multiple formatters sequentially
|
-- Conform can also run multiple formatters sequentially
|
||||||
-- python = { "isort", "black" },
|
-- python = { "isort", "black" },
|
||||||
--
|
--
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue