Skip to content

Commit 3badb61

Browse files
committed
Update lsp-config to use nvim 0.11 LSP API
1 parent 8596592 commit 3badb61

File tree

4 files changed

+69
-90
lines changed

4 files changed

+69
-90
lines changed

.config/nvim/lazy-lock.json

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.config/nvim/lua/plugins/avante-nvim.lua

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,21 @@ return {
55
opts = {
66
provider = "copilot",
77
-- auto_suggestions_provider = "copilot",
8-
-- behaviour = {
9-
-- enable_cursor_planning_mode = true,
10-
-- },
8+
behaviour = {
9+
enable_cursor_planning_mode = true,
10+
real_time_inline_suggestions = true, -- Enables inline suggestions for text editing
11+
suggestion_preview = {
12+
interactive = true, -- Use Telescope for interactive suggestion previews
13+
style = {
14+
border = "rounded", -- Rounded border for previews
15+
highlight = "CursorLine", -- Highlight active line in preview
16+
},
17+
},
18+
fallback_providers = { "copilot", "ollama" }, -- Fallback mechanism if primary provider fails
19+
},
1120
providers = {
1221
copilot = {
13-
model = "claude-3.7-sonnet",
22+
model = "gpt-4o-2024-11-20",
1423
},
1524
ollama = {
1625
endpoint = "http://localhost:11434",
@@ -29,14 +38,7 @@ return {
2938
"nvim-telescope/telescope.nvim",
3039
"ibhagwan/fzf-lua",
3140
"nvim-tree/nvim-web-devicons",
32-
{
33-
"zbirenbaum/copilot.lua",
34-
cmd = "Copilot",
35-
event = "InsertEnter",
36-
config = function()
37-
require("copilot").setup({})
38-
end,
39-
},
41+
"zbirenbaum/copilot.lua",
4042
{
4143
-- support for image pasting
4244
"HakonHarnes/img-clip.nvim",

.config/nvim/lua/plugins/lsp/nvim-lspconfig.lua

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@ return {
99
config = function()
1010
local capabilities = require("blink.cmp").get_lsp_capabilities()
1111

12-
-- Simple servers with default config
13-
local simple_servers = {
14-
"bashls",
15-
"dockerls",
16-
"prismals",
17-
"purescriptls",
18-
"pyright",
19-
"tailwindcss",
20-
}
12+
vim.lsp.config("*", { capabilities = capabilities })
2113

2214
-- Servers with custom config
2315
local custom_servers = {
@@ -27,27 +19,27 @@ return {
2719
ts_ls = "typescript",
2820
}
2921

30-
local lspconfig = require("lspconfig")
31-
local helpers = require("core.helpers")
32-
33-
-- Setup servers with default config
34-
for _, server in ipairs(simple_servers) do
35-
lspconfig[server].setup({ capabilities = capabilities })
36-
end
37-
3822
-- Setup servers with custom config
3923
for server, config_name in pairs(custom_servers) do
4024
local ok, custom_config =
4125
pcall(require, "plugins.lsp.lang." .. config_name)
4226

4327
if ok then
44-
lspconfig[server].setup(
45-
helpers.merge(
46-
custom_config,
47-
{ capabilities = capabilities }
48-
)
49-
)
28+
vim.lsp.config(server, custom_config)
5029
end
5130
end
31+
32+
vim.lsp.enable({
33+
"bashls",
34+
"dockerls",
35+
"hls",
36+
"lua_ls",
37+
"nil_ls",
38+
"prismals",
39+
"purescriptls",
40+
"pyright",
41+
"tailwindcss",
42+
"ts_ls",
43+
})
5244
end,
5345
}

.config/nvim/lua/plugins/venv-selector.lua

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,20 @@ return {
22
"linux-cultist/venv-selector.nvim",
33
dependencies = {
44
"neovim/nvim-lspconfig",
5-
"nvim-telescope/telescope.nvim",
6-
"mfussenegger/nvim-dap-python",
5+
"mfussenegger/nvim-dap",
6+
"mfussenegger/nvim-dap-python", --optional
7+
{
8+
"nvim-telescope/telescope.nvim",
9+
branch = "0.1.x",
10+
dependencies = { "nvim-lua/plenary.nvim" },
11+
},
712
},
8-
config = function()
9-
require("venv-selector").setup({
10-
-- Your options go here
11-
-- name = "venv",
12-
-- auto_refresh = false
13-
stay_on_this_version = true,
14-
})
15-
16-
vim.api.nvim_create_autocmd({ "VimEnter", "BufEnter" }, {
17-
desc = "Auto select virtualenv Nvim open",
18-
pattern = "*",
19-
callback = function()
20-
local venv =
21-
vim.fn.findfile("pyproject.toml", vim.fn.getcwd() .. ";")
22-
if venv ~= "" then
23-
require("venv-selector").retrieve_from_cache()
24-
end
25-
end,
26-
once = true,
27-
})
28-
end,
29-
event = "VeryLazy", -- Optional: needed only if you want to type `:VenvSelect` without a keymapping
13+
ft = "python", -- Load when opening Python files
3014
keys = {
31-
-- Keymap to open VenvSelector to pick a venv.
32-
{ "<leader>vs", "<cmd>VenvSelect<cr>" },
33-
-- Keymap to retrieve the venv from a cache (the one previously used for the same project directory).
34-
{ "<leader>vc", "<cmd>VenvSelectCached<cr>" },
15+
{ ",v", "<cmd>VenvSelect<cr>" }, -- Open picker on keymap
16+
},
17+
opts = { -- this can be an empty lua table - just showing below for clarity.
18+
search = {}, -- if you add your own searches, they go here.
19+
options = {}, -- if you add plugin options, they go here.
3520
},
3621
}

0 commit comments

Comments
 (0)