Replies: 3 comments 2 replies
-
|
Sorry, I don't use You could probably use something like this: Alternatively, you set up the keymap so that it calls what But you need to be aware that if you load a Python file, you need to stop the Python command before resetting the Python command after selecting the virtual environment. The Conjure log should show you what Python command was used to start a REPL. So, if you go this route, your workflow would be start Neovim, select the virtual environment, set the Python command for Conjure, and then load a Python file. When you want to change virtual environment, you need to stop the REPL before doing so and start it up again after. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you, Russ.
How do you work with virtual environments?
Just running "bin/activate" from the command line and then starting nvim
from the newly initialized environment or something else?
…On Tue, Feb 18, 2025 at 8:13 PM Russ Tokuyama ***@***.***> wrote:
Sorry, I don't use venv-selector.nvim but I'm guessing that you could set
up a keymap that would look for the VIRTUAL_ENV environment variable set
by venv-selector.nvim and then change the
vim.g["conjure#client#python#stdio#command"] to a path for the python3 in
the virtual environment. The default value is python3 -iq.
You could probably use something like this:
vim.g["conjure#client#python#stdio#command"] = vim.fn.getenv("VIRTUAL_ENV") .. "/bin/python3 -iq"
Alternatively, you set up the keymap so that it calls what ,v would call
and then does the above so that one keymap would select the virtual
environment and set the Python command for the Conjure Python client.
But you need to be aware that if you load a Python file, you need to stop
the Python command before resetting the Python command after selecting the
virtual environment. The Conjure log should show you what Python command
was used to start a REPL. So, if you go this route, your workflow would be
start Neovim, select the virtual environment, set the Python command for
Conjure, and then load a Python file. When you want to change virtual
environment, you need to stop the REPL before doing so and start it up
again after.
—
Reply to this email directly, view it on GitHub
<#651 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCZB23BYGBYJPYPQWVSFD2QPLDLAVCNFSM6AAAAABXIIHAOWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMRUGM4DMMA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks, I'll check it out!
…On Tue, Feb 18, 2025, 11:49 p.m. Oliver Caldwell ***@***.***> wrote:
This is also what I do but with the uv package manager, I do uv exec nvim
usually but sometimes drop into a subshell too.
—
Reply to this email directly, view it on GitHub
<#651 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCZBYCO2ELRPEIVGMHMA32QQEMHAVCNFSM6AAAAABXIIHAOWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMRUGUYTAMI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have these two configurations:
{
"linux-cultist/venv-selector.nvim",
dependencies = {
"neovim/nvim-lspconfig",
"mfussenegger/nvim-dap",
"mfussenegger/nvim-dap-python", --optional
{ "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } },
},
event = "VeryLazy",
branch = "regexp", -- This is the regexp branch, use this for the new version
config = function()
require("venv-selector").setup()
end,
keys = {
{ ",v", "VenvSelect" },
},
},
{
"Olical/conjure",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-treesitter/nvim-treesitter-textobjects",
},
},
but when I open a python file, conjure starts python3 from a system folder rather than the virtual environment that thought gets activated properly, probably it comes after conjure starts the repl.
Is it possible to prevent starting conjure automatically or do it after venv is initialized?
Beta Was this translation helpful? Give feedback.
All reactions