diff options
| author | 2026-02-12 18:21:04 +0300 | |
|---|---|---|
| committer | 2026-02-12 18:21:04 +0300 | |
| commit | 529898343aed91872813833b1fa6bdf688cc4b2e (patch) | |
| tree | ddde638184214df1873329539a2f8cc794e2ae12 /config/nvim/lua/plugins | |
| parent | nvim lazy upd (diff) | |
| download | dotfiles-529898343aed91872813833b1fa6bdf688cc4b2e.tar.gz dotfiles-529898343aed91872813833b1fa6bdf688cc4b2e.tar.bz2 dotfiles-529898343aed91872813833b1fa6bdf688cc4b2e.tar.xz dotfiles-529898343aed91872813833b1fa6bdf688cc4b2e.zip | |
12.02.2026
Diffstat (limited to 'config/nvim/lua/plugins')
| -rw-r--r-- | config/nvim/lua/plugins/apidocs.lua | 9 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/claudecode.lua | 26 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/codecompanion.lua | 99 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/conform.lua | 4 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/dap.lua | 96 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/dap_go.lua | 13 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/dapui.lua | 32 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/gitsigns.lua | 118 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/goerr.lua | 3 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/goimpl.lua | 11 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/guihua.lua | 4 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/lazydev.lua | 42 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/neogit.lua | 11 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/nvim-lspconfig.lua | 58 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/plenary.lua | 3 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/resize.lua | 32 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/telescope.lua | 60 | ||||
| -rw-r--r-- | config/nvim/lua/plugins/tree.lua | 19 |
18 files changed, 529 insertions, 111 deletions
diff --git a/config/nvim/lua/plugins/apidocs.lua b/config/nvim/lua/plugins/apidocs.lua index 2727c09..9e76bff 100644 --- a/config/nvim/lua/plugins/apidocs.lua +++ b/config/nvim/lua/plugins/apidocs.lua @@ -4,10 +4,17 @@ return { "nvim-telescope/telescope.nvim", -- or, 'folke/snacks.nvim' }, cmd = { "ApidocsSearch", "ApidocsInstall", "ApidocsOpen", "ApidocsSelect", "ApidocsUninstall" }, + keys = { + { + "<leader>sad", + "<cmd>ApidocsOpen<cr>", + desc = "Search Api Doc", + }, + }, config = function() require("apidocs").setup() -- Picker will be auto-detected. To select a picker of your choice explicitly you can set picker by the configuration option 'picker': -- require('apidocs').setup({picker = "snacks"}) -- Possible options are 'ui_select', 'telescope', and 'snacks' end, -} +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/claudecode.lua b/config/nvim/lua/plugins/claudecode.lua new file mode 100644 index 0000000..8533480 --- /dev/null +++ b/config/nvim/lua/plugins/claudecode.lua @@ -0,0 +1,26 @@ +return { + "coder/claudecode.nvim", + dependencies = { "folke/snacks.nvim" }, + opts = {}, + keys = { + { "<leader>a", nil, desc = "AI/Claude Code" }, -- top‑level prefix + { "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" }, -- open/close Claude:contentReference[oaicite:6]{index=6} + { "<leader>af", "<cmd>ClaudeCodeFocus<cr>", desc = "Focus Claude" }, -- focus/toggle terminal:contentReference[oaicite:7]{index=7} + { "<leader>ar", "<cmd>ClaudeCode --resume<cr>", desc = "Resume Claude" }, -- resume previous session:contentReference[oaicite:8]{index=8} + { "<leader>aC", "<cmd>ClaudeCode --continue<cr>", desc = "Continue Claude" }, -- continue conversation:contentReference[oaicite:9]{index=9} + { "<leader>am", "<cmd>ClaudeCodeSelectModel<cr>", desc = "Select model" }, -- choose Claude model:contentReference[oaicite:10]{index=10} + { "<leader>ab", "<cmd>ClaudeCodeAdd %<cr>", desc = "Add current buffer" }, -- add current file:contentReference[oaicite:11]{index=11} + -- Visual-mode send: use the mapping only in visual mode (mode = "v") + { "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send selection" }, -- :contentReference[oaicite:12]{index=12} + -- File-tree send: applies only in file manager buffers such as nvim‑tree or neo-tree:contentReference[oaicite:13]{index=13} + { + "<leader>as", + "<cmd>ClaudeCodeTreeAdd<cr>", + desc = "Add file", + ft = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" }, + }, + -- Diff management: accept or deny changes:contentReference[oaicite:14]{index=14} + { "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Accept diff" }, + { "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", desc = "Deny diff" }, + }, +} diff --git a/config/nvim/lua/plugins/codecompanion.lua b/config/nvim/lua/plugins/codecompanion.lua deleted file mode 100644 index d8eec4a..0000000 --- a/config/nvim/lua/plugins/codecompanion.lua +++ /dev/null @@ -1,99 +0,0 @@ -return { - "olimorris/codecompanion.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - { - "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 = { - auto_submit_errors = true, -- Send any errors to the LLM automatically? - auto_submit_success = true, -- Send any successful output to the LLM automatically? - default_tools = { - "full_stack_dev", - "mcp", - "filesystem", - }, - }, - 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", - "Qwen3-Coder-30B-A3B-Instruct-FP8", - "qwen2-5-coder-1-5b", - }, - num_ctx = { - default = 120000, - }, - think = { - default = true, - }, - keep_alive = { - default = "5m", - }, - }, - }, - }) - end, - }, - }, - }, -} diff --git a/config/nvim/lua/plugins/conform.lua b/config/nvim/lua/plugins/conform.lua index 59e761b..e08f54a 100644 --- a/config/nvim/lua/plugins/conform.lua +++ b/config/nvim/lua/plugins/conform.lua @@ -22,6 +22,4 @@ return { timeout_ms = 500, }, }, - keys = { - }, -} +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/dap.lua b/config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..315fab8 --- /dev/null +++ b/config/nvim/lua/plugins/dap.lua @@ -0,0 +1,96 @@ +return { + "mfussenegger/nvim-dap", + config = function() + local dap = require("dap") + dap.adapters.go = { + type = "server", + port = "${port}", + executable = { + command = "dlv", + args = { "dap", "-l", "127.0.0.1:${port}" }, + }, + } + -- dap.configurations.go = { + -- { + -- type = "go", + -- name = "Debug", + -- request = "launch", + -- program = "${file}", + -- }, + -- { + -- type = "go", + -- name = "Debug test", + -- request = "launch", + -- mode = "test", + -- program = "${file}", + -- }, + -- { + -- type = "go", + -- name = "Debug test (go test)", + -- request = "launch", + -- mode = "test", + -- program = "${workspaceFolder}", + -- }, + -- } + end, + keys = { + { + "<F5>", + function() + require("dap").continue() + end, + desc = "Debug continue", + }, + { + "<F17>", + function() -- S-F5 + require("dap").restart() + end, + desc = "Debug restart", + }, + { + "<F29>", + function() -- C-F5 + require("dap").terminate() + end, + desc = "Debug terminate", + }, + { + "<F8>", + function() + require("dap").step_over() + end, + desc = "Debug step over", + }, + { + "<F7>", + function() + require("dap").step_into() + end, + desc = "Debug step into", + }, + { + "<F19>", + function() -- S-F7 + require("dap").step_out() + end, + desc = "Debug step out", + }, + { + "<A-b>", + function() + require("dap").toggle_breakpoint() + end, + desc = "Toggle breakpoint", + }, + { + "<F9>", + function() + local widgets = require("dap.ui.widgets") + widgets.centered_float(widgets.scopes) + end, + desc = "Debug scopes", + }, + }, +} + diff --git a/config/nvim/lua/plugins/dap_go.lua b/config/nvim/lua/plugins/dap_go.lua index 91dcac3..aee662b 100644 --- a/config/nvim/lua/plugins/dap_go.lua +++ b/config/nvim/lua/plugins/dap_go.lua @@ -1,5 +1,14 @@ return { - url = "https://gitrepo.ru/NeonXP/nvim-dap-go.git", + "leoluz/nvim-dap-go", dependencies = { "mfussenegger/nvim-dap" }, opts = true, -} + keys = { + { + "<leader>dt", + function() + require("dap-go").debug_test() + end, + desc = "Debug test", + }, + }, +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/dapui.lua b/config/nvim/lua/plugins/dapui.lua index ad2b6b6..f3fcb9c 100644 --- a/config/nvim/lua/plugins/dapui.lua +++ b/config/nvim/lua/plugins/dapui.lua @@ -7,8 +7,12 @@ return { }, opts = { icons = { - expanded = "[-]", - collapsed = "[+]", + expanded = "▼", + collapsed = "▶", + current_frame = "→", + }, + controls = { + enabled = false, }, mappings = { open = "o", @@ -22,6 +26,7 @@ return { { elements = { "repl", + "scopes", }, size = 0.3, position = "bottom", @@ -40,4 +45,27 @@ return { max_type_length = nil, }, }, + keys = { + { + "<F6>", + function() + require("dapui").toggle() + end, + desc = "Toggle debug UI", + }, + { + "<Leader>dh", + function() + require("dap.ui.widgets").hover() + end, + desc = "Debug hover", + }, + { + "<Leader>dp", + function() + require("dap.ui.widgets").preview() + end, + desc = "Debug preview", + }, + }, } diff --git a/config/nvim/lua/plugins/gitsigns.lua b/config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..5994cc8 --- /dev/null +++ b/config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,118 @@ +return { + "lewis6991/gitsigns.nvim", + opts = { + signs = { + add = { text = "│" }, + change = { text = "│" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "┆" }, + }, + auto_attach = true, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + interval = 1000, + follow_files = true, + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>", + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + } + }, + keys = { + { + "]c", + function() + if vim.wo.diff then + vim.cmd.normal({ "]c", bang = true }) + else + require("gitsigns").nav_hunk("next") + end + end, + desc = "Next hunk", + }, + { + "[c", + function() + if vim.wo.diff then + vim.cmd.normal({ "[c", bang = true }) + else + require("gitsigns").nav_hunk("prev") + end + end, + desc = "Previous hunk", + }, + { + "<leader>hs", + function() + require("gitsigns").stage_hunk() + end, + desc = "Stage hunk", + }, + { + "<leader>hr", + function() + require("gitsigns").reset_hunk() + end, + desc = "Reset hunk", + }, + { + "<leader>hp", + function() + require("gitsigns").preview_hunk() + end, + desc = "Preview hunk", + }, + { + "<leader>hi", + function() + require("gitsigns").preview_hunk_inline() + end, + desc = "Preview hunk inline", + }, + { + "<leader>hb", + [[:<C-U>lua require('gitsigns').blame_line{full=true}<CR>]], + desc = "Blame line", + }, + { + "<leader>hd", + [[:<C-U>lua require('gitsigns').diffthis()<CR>]], + desc = "Diff this", + }, + { + "<leader>tb", + function() + require("gitsigns").toggle_current_line_blame() + end, + desc = "Toggle line blame", + }, + { + "ih", + [[:<C-U>lua require('gitsigns').select_hunk()<CR>]], + mode = { "o", "x" }, + desc = "Select hunk", + }, + }, +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/goerr.lua b/config/nvim/lua/plugins/goerr.lua new file mode 100644 index 0000000..9e2ca0d --- /dev/null +++ b/config/nvim/lua/plugins/goerr.lua @@ -0,0 +1,3 @@ +return { + "Snyssfx/goerr-nvim", +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/goimpl.lua b/config/nvim/lua/plugins/goimpl.lua index 9d97fb6..30cb292 100644 --- a/config/nvim/lua/plugins/goimpl.lua +++ b/config/nvim/lua/plugins/goimpl.lua @@ -6,7 +6,16 @@ return { "nvim-telescope/telescope.nvim", "nvim-treesitter/nvim-treesitter", }, + keys = { + { + "<leader>im", + function() + require("telescope").extensions.goimpl.goimpl({}) + end, + desc = "Generate stub for interface on a type for golang", + }, + }, config = function() require("telescope").load_extension("goimpl") end, -} +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/guihua.lua b/config/nvim/lua/plugins/guihua.lua new file mode 100644 index 0000000..60b0876 --- /dev/null +++ b/config/nvim/lua/plugins/guihua.lua @@ -0,0 +1,4 @@ +return { + "ray-x/guihua.lua", + build = "cd lua/fzy && make", +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/lazydev.lua b/config/nvim/lua/plugins/lazydev.lua new file mode 100644 index 0000000..0db6014 --- /dev/null +++ b/config/nvim/lua/plugins/lazydev.lua @@ -0,0 +1,42 @@ +return { + { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + { "nvim-dap-ui" }, + }, + }, + }, + { -- optional cmp completion source for require statements and module annotations + "hrsh7th/nvim-cmp", + opts = function(_, opts) + opts.sources = opts.sources or {} + table.insert(opts.sources, { + name = "lazydev", + group_index = 0, -- set group index to 0 to skip loading LuaLS completions + }) + end, + }, + { -- optional blink completion source for require statements and module annotations + "saghen/blink.cmp", + opts = { + sources = { + -- add lazydev to your completion providers + default = { "lazydev", "lsp", "path", "snippets", "buffer" }, + providers = { + lazydev = { + name = "LazyDev", + module = "lazydev.integrations.blink", + -- make lazydev completions top priority (see `:h blink.cmp`) + score_offset = 100, + }, + }, + }, + }, + }, + -- { "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim +} diff --git a/config/nvim/lua/plugins/neogit.lua b/config/nvim/lua/plugins/neogit.lua new file mode 100644 index 0000000..3932bc1 --- /dev/null +++ b/config/nvim/lua/plugins/neogit.lua @@ -0,0 +1,11 @@ +return { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + }, + cmd = "Neogit", + keys = { + { "<leader>gg", "<cmd>Neogit<cr>", desc = "Show Neogit UI" }, + }, +} diff --git a/config/nvim/lua/plugins/nvim-lspconfig.lua b/config/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..59085f9 --- /dev/null +++ b/config/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,58 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { "saghen/blink.cmp" }, + keys = { + { + "d[", + vim.diagnostic.goto_prev, + desc = "Previous diagnostic", + }, + { + "d]", + vim.diagnostic.goto_next, + desc = "Next diagnostic", + }, + { + "gD", + vim.lsp.buf.declaration, + desc = "Go to declaration", + }, + { + "gd", + vim.lsp.buf.definition, + desc = "Go to definition", + }, + { + "K", + vim.lsp.buf.hover, + desc = "Show documentation", + }, + { + "<A-CR>", + "<cmd>Lspsaga code_action<cr>", + desc = "Code actions", + }, + { + "<F2>", + vim.lsp.buf.rename, + desc = "Rename symbol", + }, + { + "<leader>wa", + vim.lsp.buf.add_workspace_folder, + desc = "Add workspace folder", + }, + { + "<leader>wr", + vim.lsp.buf.remove_workspace_folder, + desc = "Remove workspace folder", + }, + { + "<leader>wl", + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, + desc = "List workspace folders", + }, + }, +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/plenary.lua b/config/nvim/lua/plugins/plenary.lua new file mode 100644 index 0000000..74b7874 --- /dev/null +++ b/config/nvim/lua/plugins/plenary.lua @@ -0,0 +1,3 @@ +return { + "nvim-lua/plenary.nvim", +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/resize.lua b/config/nvim/lua/plugins/resize.lua index bdb3ff6..ea3ce0c 100644 --- a/config/nvim/lua/plugins/resize.lua +++ b/config/nvim/lua/plugins/resize.lua @@ -1,4 +1,34 @@ return { name = "resize", dir = "~/.config/nvim/lua/myplugins", -} + keys = { + { + "<C-A-Left>", + function() + require("myplugins.resize").ResizeLeft() + end, + desc = "Resize window left", + }, + { + "<C-A-Right>", + function() + require("myplugins.resize").ResizeRight() + end, + desc = "Resize window right", + }, + { + "<C-A-Up>", + function() + require("myplugins.resize").ResizeUp() + end, + desc = "Resize window up", + }, + { + "<C-A-Down>", + function() + require("myplugins.resize").ResizeDown() + end, + desc = "Resize window down", + }, + }, +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/telescope.lua b/config/nvim/lua/plugins/telescope.lua index 018d95c..228160f 100644 --- a/config/nvim/lua/plugins/telescope.lua +++ b/config/nvim/lua/plugins/telescope.lua @@ -1,7 +1,64 @@ return { "nvim-telescope/telescope.nvim", + event = "VeryLazy", dependencies = { "nvim-lua/plenary.nvim", + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + }, + }, + keys = { + { + "<leader>ff", + "<cmd>Telescope find_files<CR>", + desc = "Find files", + }, + { + "<leader>fg", + "<cmd>Telescope live_grep<CR>", + desc = "Live grep", + }, + { + "<leader>fb", + "<cmd>Telescope current_buffer_fuzzy_find<CR>", + desc = "Find in current buffer", + }, + { + "<F4>", + "<cmd>Telescope buffers<CR>", + desc = "Find buffers", + }, + { + "<leader>gc", + "<cmd>Telescope git_commits<CR>", + desc = "Git commits", + }, + { + "<leader>gs", + "<cmd>Telescope git_status<CR>", + desc = "Git status", + }, + { + "<leader>ch", + "<cmd>Telescope commands_history<CR>", + desc = "Commands history", + }, + { + "<leader>e", + "<cmd>Telescope diagnostics<CR>", + desc = "Diagnostics", + }, + { + "gi", + "<cmd>Telescope lsp_implementations<CR>", + desc = "LSP implementations", + }, + { + "gr", + "<cmd>Telescope lsp_references<CR>", + desc = "LSP references", + }, }, config = function() local actions = require("telescope.actions") @@ -28,5 +85,6 @@ return { }, }, }) + require("telescope").load_extension("fzf") end, -} +}
\ No newline at end of file diff --git a/config/nvim/lua/plugins/tree.lua b/config/nvim/lua/plugins/tree.lua index 30c0599..e002f49 100644 --- a/config/nvim/lua/plugins/tree.lua +++ b/config/nvim/lua/plugins/tree.lua @@ -20,6 +20,7 @@ return { }, git = { enable = true, + ignore = false, }, renderer = { group_empty = true, @@ -37,4 +38,20 @@ return { enable = true, }, }, -} + keys = { + { + "<C-c>", + function() + local api = require("nvim-tree.api") + local global_cwd = vim.fn.getcwd(-1, -1) + api.tree.change_root(global_cwd) + end, + desc = "Change tree root to CWD", + }, + { + "<F3>", + "<cmd>NvimTreeToggle<CR>", + desc = "Toggle file tree", + }, + }, +}
\ No newline at end of file |
