[neovim] Add python goodies

This commit is contained in:
Daniel Carrillo 2024-02-10 16:15:03 +01:00
parent 81e4ec11d8
commit 64cf03dcac
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16
4 changed files with 23 additions and 2 deletions

View File

@ -12,6 +12,7 @@ Neovim conf heavily adapted to suit my needs, formerly based on LunarVim's [basi
* stylua
* python-cfn-lint
* python-black
* python-debugpy
* hadolint
* revive
* tree-sitter-cli

View File

@ -226,9 +226,20 @@ require("lazy").setup({
-- DAP
{ "mfussenegger/nvim-dap", event = "VeryLazy", version = "0.*" },
{ "rcarriga/nvim-dap-ui", event = "VeryLazy", version = "v3.*" },
{ "ravenxrz/DAPInstall.nvim", event = "VeryLazy" },
{ "theHamsta/nvim-dap-virtual-text", event = "VeryLazy" },
-- Python
{
"linux-cultist/venv-selector.nvim",
dependencies = {
"mfussenegger/nvim-dap-python",
},
opts = {
dap_enabled = true,
},
event = "VeryLazy",
},
-- Go
{
"ray-x/go.nvim",
@ -239,6 +250,8 @@ require("lazy").setup({
event = { "CmdlineEnter" },
ft = { "go", "gomod" },
},
-- Testing
{
"nvim-neotest/neotest",
dependencies = {

View File

@ -1,7 +1,9 @@
local dap = require("dap")
local dapui = require("dapui")
require("dap-install").config("python", {})
local debugpyPythonPath = require("mason-registry").get_package("debugpy"):get_install_path() .. "/venv/bin/python3"
require("dap-python").setup(debugpyPythonPath, {})
dapui.setup({
layouts = {
{

View File

@ -41,6 +41,11 @@ local venv = function()
return string.format(" %s", string.match(venv, "[^/]+$"))
end
venv = require("venv-selector").get_active_venv()
if venv then
return string.format(" %s", string.match(venv, "[^/]+$"))
end
return ""
end