nvim: Get beancount python env from dynamic home env
While we are still hacking our way around a specific pipx venv (which has to change), we are at least not hardcoding my own home directory name anymore.
This commit is contained in:
parent
ce78b89597
commit
49c9dfcc9b
1 changed files with 6 additions and 8 deletions
|
@ -1,3 +1,5 @@
|
|||
local is_available = require("core.util").is_available
|
||||
|
||||
local completion_engine = {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
|
@ -178,11 +180,12 @@ local snippet_engine = {
|
|||
"benfowler/telescope-luasnip.nvim",
|
||||
dependencies = { { "nvim-telescope/telescope.nvim", optional = true } },
|
||||
config = function()
|
||||
if require("core.util").is_available("telescope") then
|
||||
if is_available("telescope") then
|
||||
require("telescope").load_extension("luasnip")
|
||||
end
|
||||
end,
|
||||
},
|
||||
{ "hrsh7th/nvim-cmp", optional = true },
|
||||
},
|
||||
event = { "InsertEnter" },
|
||||
build = "make install_jsregexp",
|
||||
|
@ -237,15 +240,10 @@ local beancount_cmp = {
|
|||
},
|
||||
ft = "beancount",
|
||||
opts = function(_, opts)
|
||||
vim.g.python3_host_prog = "/home/marty/.local/pipx/venvs/beancount/bin/python"
|
||||
-- FIXME: Find a way to dynamically derive environment
|
||||
vim.g.python3_host_prog = os.getenv("HOME") .. "/.local/pipx/venvs/beancount/bin/python"
|
||||
table.insert(opts.sources, {
|
||||
name = "beancount",
|
||||
-- option = {
|
||||
-- -- TODO: implement dynamically
|
||||
-- -- I believe if we don't supply this it automatically takes
|
||||
-- -- from the open file which would be good enough
|
||||
-- account = "/home/marty/documents/records/budget/main.beancount",
|
||||
-- },
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue