Created
January 29, 2023 03:25
-
-
Save sidkang/0a83866e79e5b519dd812afb4a20bed7 to your computer and use it in GitHub Desktop.
Neovim Beancount Basic Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- after/ftplugin/beancount.lua | |
vim.opt.wrap = false | |
vim.opt.tabstop = 4 | |
vim.opt.softtabstop = 4 | |
vim.opt.shiftwidth = 4 | |
vim.opt.expandtab = true | |
vim.g.beancount_separator_col = 55 | |
vim.g.beancount_root = vim.trim(vim.fn.system('pwd')) .. "/" .. "main.bean" | |
-- for omni func | |
vim.keymap.set("i", "\"", "\"<C-x><C-o>", { silent = true }) | |
vim.keymap.set("i", ".", ".<C-\\><C-O>:AlignCommodity<CR>", { silent = true }) | |
vim.keymap.set("i", "<C-n>", "<C-x><C-o>", { silent = true }) | |
vim.api.nvim_create_autocmd({ "BufEnter", "InsertLeave" }, { | |
callback = function() | |
vim.cmd([[ :%AlignCommodity ]]) | |
end, | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local beancount_ignore_patterns = { | |
"CNY", | |
"USD", | |
} | |
cmp.setup.filetype("beancount", { | |
sources = { | |
{ | |
name = "buffer", | |
entry_filter = function(entry, ctx) | |
return not vim.tbl_contains(beancount_ignore_patterns, entry:get_word()) | |
end | |
}, | |
{ | |
name = "beancount", | |
option = { | |
account = vim.trim(vim.fn.system('pwd')) .. "/main.bean" | |
}, | |
} | |
}, | |
experimental = { | |
ghost_text = true, | |
native_menu = false, | |
}, | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npairs.setup { | |
... | |
disable_filetype = { "TelescopePrompt", "beancount" }, | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Most needed plugins
general
“hrsh7th/nvim-cmp”
"nvim-treesitter/nvim-treesitter"
beancount
"crispgm/cmp-beancount"
"nathangrigg/vim-beancount"