From 081881b714e83bf4330e0a31991966cbf67d931a Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Fri, 28 Nov 2025 01:52:34 +0300 Subject: =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B8=D0=B5?= =?UTF-8?q?=20=D0=B0=D0=BF=D0=B4=D0=B5=D0=B9=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/nvim/lua/plugins/apidocs.lua | 3 -- config/nvim/lua/plugins/autosave.lua | 38 +++---------- config/nvim/lua/plugins/blankline.lua | 7 --- config/nvim/lua/plugins/codecompanion.lua | 89 +++++++++++++++++++++++++++++++ config/nvim/lua/plugins/conform.lua | 11 +--- config/nvim/lua/plugins/dap.lua | 3 -- config/nvim/lua/plugins/dap_go.lua | 51 ------------------ config/nvim/lua/plugins/dapui.lua | 31 ----------- config/nvim/lua/plugins/goimpl.lua | 9 ---- config/nvim/lua/plugins/headlines.lua | 5 -- config/nvim/lua/plugins/multicursor.lua | 76 ++++++++++++++++++++++++++ config/nvim/lua/plugins/resize.lua | 30 ----------- config/nvim/lua/plugins/telescope.lua | 18 ------- config/nvim/lua/plugins/tree.lua | 14 ----- 14 files changed, 174 insertions(+), 211 deletions(-) delete mode 100644 config/nvim/lua/plugins/blankline.lua create mode 100644 config/nvim/lua/plugins/codecompanion.lua delete mode 100644 config/nvim/lua/plugins/dap.lua delete mode 100644 config/nvim/lua/plugins/headlines.lua create mode 100644 config/nvim/lua/plugins/multicursor.lua (limited to 'config/nvim/lua/plugins') diff --git a/config/nvim/lua/plugins/apidocs.lua b/config/nvim/lua/plugins/apidocs.lua index 9bc35da..2727c09 100644 --- a/config/nvim/lua/plugins/apidocs.lua +++ b/config/nvim/lua/plugins/apidocs.lua @@ -10,7 +10,4 @@ return { -- require('apidocs').setup({picker = "snacks"}) -- Possible options are 'ui_select', 'telescope', and 'snacks' end, - keys = { - { "sad", "ApidocsOpen", desc = "Search Api Doc" }, - }, } diff --git a/config/nvim/lua/plugins/autosave.lua b/config/nvim/lua/plugins/autosave.lua index 069afbf..f6f280d 100644 --- a/config/nvim/lua/plugins/autosave.lua +++ b/config/nvim/lua/plugins/autosave.lua @@ -1,18 +1,12 @@ return { "okuuva/auto-save.nvim", enabled = true, - cmd = "ASToggle", -- optional for lazy loading on command - event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events + cmd = "ASToggle", + event = { "InsertLeave", "TextChanged" }, opts = { - enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it) - trigger_events = { -- See :h events - -- -- vim events that trigger an immediate save - -- -- I'm disabling this, as it's autosaving when I leave the buffer and - -- -- that's autoformatting stuff if on insert mode and following a tutorial - -- -- Re-enabling this to only save if NOT in insert mode in the condition below - -- immediate_save = { nil }, - immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, -- vim events that trigger an immediate save - -- vim events that trigger a deferred save (saves after `debounce_delay`) + enabled = true, + trigger_events = { + immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, defer_save = { "InsertLeave", "TextChanged", @@ -29,28 +23,12 @@ return { { "User", pattern = "SnacksPickerInputEnter" }, }, }, - -- function that takes the buffer handle and determines whether to save the current buffer or not - -- return true: if buffer is ok to be saved - -- return false: if it's not ok to be saved - -- if set to `nil` then no specific condition is applied condition = function(buf) - -- Do not save when I'm in insert mode - -- Do NOT ADD VISUAL MODE HERE or the cancel_deferred_save wont' work - -- If I STAY in insert mode and switch to another app, like YouTube to - -- take notes, the BufLeave or FocusLost immediate_save will be ignored - -- and the save will not be triggered local mode = vim.fn.mode() if mode == "i" then return false end - -- Disable auto-save for the harpoon plugin, otherwise it just opens and closes - -- https://github.com/ThePrimeagen/harpoon/issues/434 - -- - -- don't save for `sql` file types - -- I do this so when working with dadbod the file is not saved every time - -- I make a change, and a SQL query executed - -- Run `:set filetype?` on a dadbod query to make sure of the filetype local filetype = vim.bo[buf].filetype if filetype == "harpoon" or filetype == "mysql" then return false @@ -58,12 +36,10 @@ return { return true end, - write_all_buffers = true, -- write all buffers when the current one meets `condition` + write_all_buffers = true, noautocmd = false, - lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details - -- delay after which a pending save is executed (default 1000) + lockmarks = false, debounce_delay = 2000, - -- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable debug = false, }, } diff --git a/config/nvim/lua/plugins/blankline.lua b/config/nvim/lua/plugins/blankline.lua deleted file mode 100644 index b74d9e6..0000000 --- a/config/nvim/lua/plugins/blankline.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "lukas-reineke/indent-blankline.nvim", - main = "ibl", - --@module "ibl" - --@type ibl.config - config = true, -} diff --git a/config/nvim/lua/plugins/codecompanion.lua b/config/nvim/lua/plugins/codecompanion.lua new file mode 100644 index 0000000..a657d09 --- /dev/null +++ b/config/nvim/lua/plugins/codecompanion.lua @@ -0,0 +1,89 @@ +return { + "olimorris/codecompanion.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + { + "MeanderingProgrammer/render-markdown.nvim", + ft = { "markdown", "codecompanion" }, + }, + { + "ravitemer/mcphub.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + build = "npm install -g mcp-hub@latest", + config = function() + require("mcphub").setup() + end, + }, + }, + opts = { + opts = { + log_level = "DEBUG", -- or "TRACE" + }, + extensions = { + mcphub = { + callback = "mcphub.extensions.codecompanion", + opts = { + make_tools = true, -- Make individual tools (@server__tool) and server groups (@server) from MCP servers + show_server_tools_in_chat = true, -- Show individual tools in chat completion (when make_tools=true) + add_mcp_prefix_to_tool_names = false, -- Add mcp__ prefix (e.g `@mcp__github`, `@mcp__neovim__list_issues`) + show_result_in_chat = true, -- Show tool results directly in chat buffer + format_tool = nil, -- function(tool_name:string, tool: CodeCompanion.Agent.Tool) : string Function to format tool names to show in the chat buffer + -- MCP Resources + make_vars = true, -- Convert MCP resources to #variables for prompts + -- MCP Prompts + make_slash_commands = true, -- Add MCP prompts as /slash commands + }, + }, + }, + strategies = { + chat = { + adapter = "scbt", + tools = { + opts = { + default_tools = { + "full_stack_dev", + "mcp", + }, + }, + opts = { + system_promt = "Ты полезный ассистент в редакторе neovim в плагине codecompanion. Основной зык программирования - go. Отвечай всегда на русском языке.", + }, + }, + }, + inline = { + adapter = "scbt", + }, + }, + memory = { + opts = { + chat = { + enabled = true, + }, + }, + }, + adapters = { + http = { + scbt = function() + return require("codecompanion.adapters").extend("openai_compatible", { + env = { + api_key = "cmd: age -d -i ~/.ssh/id_ed25519 ~/.openai-api-key.age", + url = "http://localhost:8888/api", + }, + + schema = { + model = { + default = "qwen3-235b-it", + choices = { + "qwen3-235b-it", + }, + }, + }, + }) + end, + }, + }, + }, +} diff --git a/config/nvim/lua/plugins/conform.lua b/config/nvim/lua/plugins/conform.lua index 3204d2d..3bd4e44 100644 --- a/config/nvim/lua/plugins/conform.lua +++ b/config/nvim/lua/plugins/conform.lua @@ -14,7 +14,7 @@ return { graphql = { "prettier" }, lua = { "stylua" }, python = { "isort", "black" }, - go = { "gofmt" }, + go = { "gofumpt" }, templ = { "templ" }, }, format_on_save = { @@ -24,12 +24,5 @@ return { }, }, keys = { - { - "mp", - function() - require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 500 }) - end, - desc = "Format file or range (in visual mode)", - }, - }, + }, } diff --git a/config/nvim/lua/plugins/dap.lua b/config/nvim/lua/plugins/dap.lua deleted file mode 100644 index ab44a1e..0000000 --- a/config/nvim/lua/plugins/dap.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "mfussenegger/nvim-dap", -} diff --git a/config/nvim/lua/plugins/dap_go.lua b/config/nvim/lua/plugins/dap_go.lua index 262aef8..0864da1 100644 --- a/config/nvim/lua/plugins/dap_go.lua +++ b/config/nvim/lua/plugins/dap_go.lua @@ -104,55 +104,4 @@ return { { text = "→", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" } ) end, - keys = { - { - "", - function() - require("dap").continue() - end, - silent = true, - }, - { - "", -- S-F5 - function() - require("dap").restart() - end, - silent = true, - }, - { - "", -- C-F5 - function() - require("dap").terminate() - end, - silent = true, - }, - { - "", - function() - require("dap").step_over() - end, - silent = true, - }, - { - "", - function() - require("dap").step_into() - end, - silent = true, - }, - { - "", -- S-F7 - function() - require("dap").step_out() - end, - silent = true, - }, - { - "", - function() - require("dap").toggle_breakpoint() - end, - silent = true, - }, - }, } diff --git a/config/nvim/lua/plugins/dapui.lua b/config/nvim/lua/plugins/dapui.lua index 5d35e1e..8530fd1 100644 --- a/config/nvim/lua/plugins/dapui.lua +++ b/config/nvim/lua/plugins/dapui.lua @@ -4,37 +4,6 @@ return { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio", }, - keys = { - { - "", - function() - require("dapui").toggle() - end, - silent = true, - }, - { - "dh", - function() - require("dap.ui.widgets").hover() - end, - silent = true, - }, - { - "dp", - function() - require("dap.ui.widgets").preview() - end, - silent = true, - }, - { - "", - function() - local widgets = require("dap.ui.widgets") - widgets.centered_float(widgets.scopes) - end, - silent = true, - }, - }, opts = { icons = { expanded = "[-]", diff --git a/config/nvim/lua/plugins/goimpl.lua b/config/nvim/lua/plugins/goimpl.lua index 0b906fa..9d97fb6 100644 --- a/config/nvim/lua/plugins/goimpl.lua +++ b/config/nvim/lua/plugins/goimpl.lua @@ -9,13 +9,4 @@ return { config = function() require("telescope").load_extension("goimpl") end, - keys = { - { - "im", - function() - require("telescope").extensions.goimpl.goimpl({}) - end, - desc = "Generate stub for interface on a type for golang", - }, - }, } diff --git a/config/nvim/lua/plugins/headlines.lua b/config/nvim/lua/plugins/headlines.lua deleted file mode 100644 index 5d92245..0000000 --- a/config/nvim/lua/plugins/headlines.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "lukas-reineke/headlines.nvim", - dependencies = "nvim-treesitter/nvim-treesitter", - config = true, - } diff --git a/config/nvim/lua/plugins/multicursor.lua b/config/nvim/lua/plugins/multicursor.lua new file mode 100644 index 0000000..0a762a8 --- /dev/null +++ b/config/nvim/lua/plugins/multicursor.lua @@ -0,0 +1,76 @@ +return { + "jake-stewart/multicursor.nvim", + branch = "1.0", + config = function() + local mc = require("multicursor-nvim") + mc.setup() + + local set = vim.keymap.set + + -- Add or skip cursor above/below the main cursor. + set({ "n", "x" }, "", function() + mc.lineAddCursor(-1) + end ) + set({ "n", "x" }, "", function() + mc.lineAddCursor(1) + end ) + set({ "n", "x" }, "", function() + mc.lineSkipCursor(-1) + end) + set({ "n", "x" }, "", function() + mc.lineSkipCursor(1) + end) + + -- Add or skip adding a new cursor by matching word/selection + set({ "n", "x" }, "n", function() + mc.matchAddCursor(1) + end) + set({ "n", "x" }, "s", function() + mc.matchSkipCursor(1) + end) + set({ "n", "x" }, "N", function() + mc.matchAddCursor(-1) + end) + set({ "n", "x" }, "S", function() + mc.matchSkipCursor(-1) + end) + + -- Add and remove cursors with control + left click. + set("n", "", mc.handleMouse) + set("n", "", mc.handleMouseDrag) + set("n", "", mc.handleMouseRelease) + + -- Disable and enable cursors. + set({ "n", "x" }, "", mc.toggleCursor) + + -- Mappings defined in a keymap layer only apply when there are + -- multiple cursors. This lets you have overlapping mappings. + mc.addKeymapLayer(function(layerSet) + -- Select a different cursor as the main one. + layerSet({ "n", "x" }, "", mc.prevCursor) + layerSet({ "n", "x" }, "", mc.nextCursor) + + -- Delete the main cursor. + layerSet({ "n", "x" }, "x", mc.deleteCursor) + + -- Enable and clear cursors using escape. + layerSet("n", "", function() + if not mc.cursorsEnabled() then + mc.enableCursors() + else + mc.clearCursors() + end + end) + end) + + -- Customize how cursors look. + local hl = vim.api.nvim_set_hl + hl(0, "MultiCursorCursor", { reverse = true }) + hl(0, "MultiCursorVisual", { link = "Visual" }) + hl(0, "MultiCursorSign", { link = "SignColumn" }) + hl(0, "MultiCursorMatchPreview", { link = "Search" }) + hl(0, "MultiCursorDisabledCursor", { reverse = true }) + hl(0, "MultiCursorDisabledVisual", { link = "Visual" }) + hl(0, "MultiCursorDisabledSign", { link = "SignColumn" }) + end, +} diff --git a/config/nvim/lua/plugins/resize.lua b/config/nvim/lua/plugins/resize.lua index 7e22517..bdb3ff6 100644 --- a/config/nvim/lua/plugins/resize.lua +++ b/config/nvim/lua/plugins/resize.lua @@ -1,34 +1,4 @@ return { name = "resize", dir = "~/.config/nvim/lua/myplugins", - keys = { - { - "", - function() - require("myplugins.resize").ResizeLeft() - end, - silent = true, - }, - { - "", - function() - require("myplugins.resize").ResizeRight() - end, - silent = true, - }, - { - "", - function() - require("myplugins.resize").ResizeUp() - end, - silent = true, - }, - { - "", - function() - require("myplugins.resize").ResizeDown() - end, - silent = true, - }, - }, } diff --git a/config/nvim/lua/plugins/telescope.lua b/config/nvim/lua/plugins/telescope.lua index aabcd9c..018d95c 100644 --- a/config/nvim/lua/plugins/telescope.lua +++ b/config/nvim/lua/plugins/telescope.lua @@ -29,22 +29,4 @@ return { }, }) end, - keys = { - { "ff", "Telescope find_files", noremap = true, silent = true, desc = "Find files" }, - { "fg", "Telescope live_grep", noremap = true, silent = true, desc = "Live grep" }, - { - "fb", - "Telescope current_buffer_fuzzy_fund", - noremap = true, - silent = true, - desc = "Find current file", - }, - { "", "Telescope buffers", noremap = true, silent = true, desc = "Find buffers" }, - { "gc", "Telescope git_commits", noremap = true, silent = true }, - { "gs", "Telescope git_status", noremap = true, silent = true }, - { "ch", "Telescope commands_history", noremap = true, silent = true }, - { "e", "Telescope diagnostics", noremap = true, silent = true }, - { "gi", "Telescope lsp_implementations", noremap = true, silent = true }, - { "gr", "Telescope lsp_references", noremap = true, silent = true }, - }, } diff --git a/config/nvim/lua/plugins/tree.lua b/config/nvim/lua/plugins/tree.lua index 3bf9eed..30c0599 100644 --- a/config/nvim/lua/plugins/tree.lua +++ b/config/nvim/lua/plugins/tree.lua @@ -37,18 +37,4 @@ return { enable = true, }, }, - keys = { - { - "", - function() - local api = require("nvim-tree.api") - local global_cwd = vim.fn.getcwd(-1, -1) - api.tree.change_root(global_cwd) - end, - noremap = true, - silent = true, - desc = "Change tree root to CWD", - }, - { "", ":NvimTreeToggle", noremap = true, silent = true, desc = "Toggle file tree" }, - }, } -- cgit v1.2.3