Apply lua linter formatting
Remove snippets Update python path on venv selection Use basedpyright language server for better import resolution
This commit is contained in:
parent
c068921d55
commit
33588e1afc
4 changed files with 24 additions and 16 deletions
|
@ -1,15 +1,15 @@
|
||||||
return {
|
return {
|
||||||
{
|
-- {
|
||||||
"L3MON4D3/LuaSnip",
|
-- "L3MON4D3/LuaSnip",
|
||||||
dependencies = {
|
-- dependencies = {
|
||||||
"saadparwaiz1/cmp_luasnip", -- Snippets source for nvim-cmp
|
-- "saadparwaiz1/cmp_luasnip", -- Snippets source for nvim-cmp
|
||||||
"rafamadriz/friendly-snippets", -- Collection of snippets
|
-- "rafamadriz/friendly-snippets", -- Collection of snippets
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
config = function()
|
config = function()
|
||||||
require("luasnip.loaders.from_vscode").lazy_load() -- Load snippets from friendly-snippets
|
-- require("luasnip.loaders.from_vscode").lazy_load() -- Load snippets from friendly-snippets
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
|
@ -31,7 +31,7 @@ return {
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
--{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" }, -- Show suggestions from LSP
|
||||||
{ name = "luasnip" }, -- For luasnip users.
|
{ name = "luasnip" }, -- For luasnip users.
|
||||||
}, {
|
}, {
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
|
|
|
@ -69,7 +69,11 @@ return {
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<Leader>ea", "<cmd>VenvSelect<cr>", desc = "Activate Virtual Environment" },
|
{ "<Leader>ea", "<cmd>VenvSelect<cr>", desc = "Activate Virtual Environment" },
|
||||||
{ "<Leader>es", "<cmd>lua print(require('venv-selector').venv())<cr>", desc = "Show Active Virtual Environment" },
|
{
|
||||||
|
"<Leader>es",
|
||||||
|
"<cmd>lua print(require('venv-selector').venv())<cr>",
|
||||||
|
desc = "Show Active Virtual Environment",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
search = {
|
search = {
|
||||||
|
@ -80,10 +84,13 @@ return {
|
||||||
command = "fdfind -p '.*/bin/python$' ~/Code/.venvs",
|
command = "fdfind -p '.*/bin/python$' ~/Code/.venvs",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
post_set_venv = function()
|
options = {
|
||||||
local venv_path = require("venv-selector").get_active_path()
|
on_venv_activate_callback = function()
|
||||||
vim.env.PYTHONPATH = venv_path .. "/lib/python3.*/site-packages"
|
local python_path = require("venv-selector").python()
|
||||||
end
|
--print("Active python: " .. python_path)
|
||||||
|
vim.env.PYTHONPATH = python_path
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ return {
|
||||||
"jsonls",
|
"jsonls",
|
||||||
"marksman",
|
"marksman",
|
||||||
"nginx_language_server",
|
"nginx_language_server",
|
||||||
"pyright",
|
"basedpyright",
|
||||||
"ruff",
|
"ruff",
|
||||||
"yamlls",
|
"yamlls",
|
||||||
},
|
},
|
||||||
|
@ -62,7 +62,7 @@ return {
|
||||||
lspconfig.jsonls.setup({ capabilities = capabilities })
|
lspconfig.jsonls.setup({ capabilities = capabilities })
|
||||||
lspconfig.nginx_language_server.setup({ capabilities = capabilities })
|
lspconfig.nginx_language_server.setup({ capabilities = capabilities })
|
||||||
lspconfig.marksman.setup({ capabilities = capabilities })
|
lspconfig.marksman.setup({ capabilities = capabilities })
|
||||||
lspconfig.pyright.setup({ capabilities = capabilities })
|
lspconfig.basedpyright.setup({ capabilities = capabilities })
|
||||||
lspconfig.ruff.setup({
|
lspconfig.ruff.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
|
@ -12,6 +12,7 @@ return {
|
||||||
"query",
|
"query",
|
||||||
"markdown",
|
"markdown",
|
||||||
"markdown_inline",
|
"markdown_inline",
|
||||||
|
"bash",
|
||||||
"json",
|
"json",
|
||||||
"jsonc",
|
"jsonc",
|
||||||
"python",
|
"python",
|
||||||
|
|
Loading…
Reference in a new issue