From 21bb2a4393f40890bc43e7cb20a5ba48aee054a2 Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Wed, 17 Dec 2025 07:41:30 +0100 Subject: [PATCH] plugins: fix configurations - Removes deprecated keybindings for diagnostics. - Removes branch options when installing venv-selector. - Updates options for JSON folding. - Fixes other deprecated options, especially for LSP configuration. - Updates the repository URL for Mason plugings. Co-Authored-by: iGor milhit --- after/ftplugin/json.lua | 4 ++-- lua/core/keymaps.lua | 2 +- lua/plugins/lsp/lspconfig.lua | 2 +- lua/plugins/lsp/mason.lua | 30 ++++++++++-------------------- lua/plugins/treesitter.lua | 14 -------------- lua/plugins/venv-selector.lua | 2 +- 6 files changed, 15 insertions(+), 39 deletions(-) diff --git a/after/ftplugin/json.lua b/after/ftplugin/json.lua index 7f6f421..5e49adb 100644 --- a/after/ftplugin/json.lua +++ b/after/ftplugin/json.lua @@ -2,7 +2,7 @@ -- Use treesitter for folding -- Disable the color column -vim.opt.foldmethod="expr" -vim.opt.foldexpr="nvim_treesitter#foldexpr()" +vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' +vim.wo[0][0].foldmethod = 'expr' vim.opt.foldlevel=3 vim.opt.colorcolumn="" diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index f3edf26..13a6a27 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -33,7 +33,7 @@ local highlight_group = vim.api.nvim_create_augroup( ) vim.api.nvim_create_autocmd('TextYankPost', { callback = function() - vim.highlight.on_yank() + vim.hl.on_yank() end, group = highlight_group, pattern = '*', diff --git a/lua/plugins/lsp/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua index 6782501..b1a2d37 100644 --- a/lua/plugins/lsp/lspconfig.lua +++ b/lua/plugins/lsp/lspconfig.lua @@ -9,7 +9,7 @@ return { -- Adds code actions, such as smart file renaming, etc { "antosha417/nvim-lsp-file-operations", config = true }, -- 💫 Extensible UI for Neovim notifications and LSP progress messages - { 'j-hui/fidget.nvim', tag = "legacy", opts = {} }, + { 'j-hui/fidget.nvim', tag = "legacy", opts = {} }, }, config = function() -- Import lsp-zero diff --git a/lua/plugins/lsp/mason.lua b/lua/plugins/lsp/mason.lua index 37d68c7..09536d9 100644 --- a/lua/plugins/lsp/mason.lua +++ b/lua/plugins/lsp/mason.lua @@ -2,9 +2,9 @@ -- LSP return { - "williamboman/mason.nvim", + "mason-org/mason.nvim", dependencies = { - "williamboman/mason-lspconfig.nvim", + "mason-org/mason-lspconfig.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim", }, config = function() @@ -15,9 +15,11 @@ return { local mason_lspconfig = require("mason-lspconfig") -- Import lspconfig - local lspconfig = require("lspconfig") + -- local lspconfig = require("lspconfig") + local lspconfig = vim.lsp.config - local util = require("lspconfig.util") + -- local util = require("lspconfig.util") + local util = vim.lsp.util -- Import mason-tool-installer local mason_tool_installer = require("mason-tool-installer") @@ -35,8 +37,6 @@ return { mason_tool_installer.setup({ ensure_installed = { - "black", - "isort", "prettier", "stylua", "tree-sitter-cli", @@ -54,7 +54,7 @@ return { "jsonls", "lua_ls", "marksman", - "pylsp", + "ruff", "yamlls", }, handlers = { @@ -76,19 +76,9 @@ return { -- The first one is the mason_lspconfig key, the seconde one is the -- lspconfig key. They are identical to the ensure_installed entries. - -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#pylsp - pylsp = function() - lspconfig.pylsp.setup({ - settings = { - pylsp = { - plugins = { - pyflakes = { enabled = false }, - pycodestyle = { - enabled = true, - ignore = { "E501" }, - }, - }, - }, + ruff = function() + lspconfig.ruff.setup({ + setting = { }, }) end, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 1a2114b..29b8878 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,19 +1,5 @@ -- Diagnostic keymaps -vim.keymap.set( - 'n', - '[d', - vim.diagnostic.goto_prev, - { desc = "[Diagnostic] Go to previous diagnostic message" } -) - -vim.keymap.set( - 'n', - ']d', - vim.diagnostic.goto_next, - { desc = "[Diagnostic] Go to next diagnostic message" } -) - vim.keymap.set( 'n', 'e', diff --git a/lua/plugins/venv-selector.lua b/lua/plugins/venv-selector.lua index c0ac6d2..7499b07 100644 --- a/lua/plugins/venv-selector.lua +++ b/lua/plugins/venv-selector.lua @@ -3,7 +3,7 @@ return { 'linux-cultist/venv-selector.nvim', - branch = 'regexp', + -- branch = 'regexp', dependencies = { 'neovim/nvim-lspconfig', 'nvim-telescope/telescope.nvim',