neovim-confs/lua/rafi/plugins/extras/lang/python.lua

73 lines
1.6 KiB
Lua
Raw Normal View History

2023-09-06 01:26:46 +02:00
-- rafi.plugins.extras.lang.python
2023-09-06 00:26:45 +02:00
--
-- This is part of LazyVim's code, with my modifications.
-- See: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/plugins/extras/lang/python.lua
return {
{
'nvim-treesitter/nvim-treesitter',
opts = function(_, opts)
if type(opts.ensure_installed) == 'table' then
vim.list_extend(
opts.ensure_installed,
{ 'ninja', 'python', 'requirements', 'rst', 'toml' }
)
end
end,
},
{
'neovim/nvim-lspconfig',
2023-09-06 01:26:46 +02:00
dependencies = 'rafi/neoconf-venom.nvim',
2023-09-06 00:26:45 +02:00
opts = {
servers = {
pyright = {},
},
},
},
{
2023-09-06 01:26:46 +02:00
'rafi/neoconf-venom.nvim',
2023-09-06 00:26:45 +02:00
main = 'venom',
opts = {},
-- stylua: ignore
keys = {
{ '<leader>cv', '<cmd>Telescope venom virtualenvs<cr>', desc = 'Select VirtualEnv' },
},
},
{
'nvim-neotest/neotest',
optional = true,
dependencies = { 'nvim-neotest/neotest-python' },
opts = {
adapters = {
['neotest-python'] = {
-- Here you can specify the settings for the adapter, i.e.
-- runner = "pytest",
-- python = '.venv/bin/python',
},
},
},
},
{
'mfussenegger/nvim-dap',
optional = true,
dependencies = {
'mfussenegger/nvim-dap-python',
-- stylua: ignore
keys = {
{ '<leader>dPt', function() require('dap-python').test_method() end, desc = 'Debug Method' },
{ '<leader>dPc', function() require('dap-python').test_class() end, desc = 'Debug Class' },
},
config = function()
local path =
require('mason-registry').get_package('debugpy'):get_install_path()
require('dap-python').setup(path .. '/venv/bin/python')
end,
},
},
}