From faf0e46498e9ce61914bf5ee07ae205be1b75a51 Mon Sep 17 00:00:00 2001 From: hlstwizard Date: Wed, 25 Mar 2026 11:35:11 +0800 Subject: [PATCH] Add beancount --- init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/init.lua b/init.lua index 23ed21e8..71052a91 100644 --- a/init.lua +++ b/init.lua @@ -138,6 +138,8 @@ vim.o.timeoutlen = 300 -- Configure how new splits should be opened vim.o.splitright = 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. -- See `:help 'list'` @@ -230,6 +232,17 @@ vim.api.nvim_create_autocmd('TextYankPost', { 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 ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -699,6 +712,7 @@ require('lazy').setup({ lua = { 'stylua' }, json = { 'prettier' }, yaml = { 'prettier' }, + beancount = { 'bean-format' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, --