From 3e3d308717b435f324b949e7eb14dfd2db56836c Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Fri, 4 Oct 2024 08:08:58 +0200 Subject: [PATCH] core: add a python provider configuration - Adds a configuration to use a virtual environment as the python provider. - Documents it shortly. Co-Authored-by: iGor milhit --- README.md | 5 +++++ lua/core/init.lua | 1 + lua/core/python-provider.lua | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 lua/core/python-provider.lua diff --git a/README.md b/README.md index d9ca2ef..202c43b 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ This new configuration is written with the help of: - A [nerd font][3]. - [`vscode-langservers-extracted`][6]. It's mandatory for the JSON LSP. +## Python provider + +I'm using a virtual environment for the python provider, as the +[documentation][7], using `pyenv`. ## Structure @@ -107,3 +111,4 @@ I won't provide links for each of these plugins as they are easily to be found. [4]: https://github.com/nvim-lua/kickstart.nvim [5]: https://vincent.jousse.org/blog/fr/tech/configurer-neovim-comme-ide-a-partir-de-zero-tutoriel-guide [6]: https://github.com/hrsh7th/vscode-langservers-extracted +[7]: https://neovim.io/doc/user/provider.html#python-virtualenv diff --git a/lua/core/init.lua b/lua/core/init.lua index 794a20b..f873c36 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -1,3 +1,4 @@ -- Load all module files +require("core.python-provider") require("core.keymaps") require("core.options") diff --git a/lua/core/python-provider.lua b/lua/core/python-provider.lua new file mode 100644 index 0000000..8b953b8 --- /dev/null +++ b/lua/core/python-provider.lua @@ -0,0 +1,4 @@ +-- Set a virtualenv as python provider +-- https://neovim.io/doc/user/provider.html#python-virtualenv + +vim.g.python3_host_prog = "/home/igor/.pyenv/versions/py-nvim3.10/bin/python"