From dc86bf39898f229e6c9b70f5bde3d8e306c62230 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 22 Jun 2023 12:12:32 +0200 Subject: [PATCH] nvim: HACK Fix quarto running magma session With the new lazy loaded plugin structure, Magma would not start correctly. This commit simply removes the lazy designation for Magma, Quarto and the Jupyter attachments. It also uses the python environment detection utility to set the correct python executable on entering a quarto file (if there exists a virtual environment for the project). --- nvim/.config/nvim/after/ftplugin/quarto.lua | 2 ++ nvim/.config/nvim/lua/plugins/data_analysis.lua | 3 +++ 2 files changed, 5 insertions(+) diff --git a/nvim/.config/nvim/after/ftplugin/quarto.lua b/nvim/.config/nvim/after/ftplugin/quarto.lua index d0cc225..94fd38f 100644 --- a/nvim/.config/nvim/after/ftplugin/quarto.lua +++ b/nvim/.config/nvim/after/ftplugin/quarto.lua @@ -1,5 +1,7 @@ -- Start quarto session local startsession = function(file, args) + local path, _ = require("util").get_python_venv() + vim.g["python3_host_prog"] = path file = file or "/tmp/jupyter-magma-session.json" if args then file = args[0] diff --git a/nvim/.config/nvim/lua/plugins/data_analysis.lua b/nvim/.config/nvim/lua/plugins/data_analysis.lua index 5043ac2..5a5f07e 100644 --- a/nvim/.config/nvim/lua/plugins/data_analysis.lua +++ b/nvim/.config/nvim/lua/plugins/data_analysis.lua @@ -18,6 +18,7 @@ return { }, }) end, + lazy = false, ft = "quarto", }, @@ -33,6 +34,7 @@ return { desc = "Inspect object in kernel", }, }, + lazy = false, }, -- REPL work @@ -51,5 +53,6 @@ return { "MagmaRestart", }, ft = { "quarto", "python" }, + lazy = false, }, }