From bfd1fe67b343bd093526d53c3cb313b3bb6e3984 Mon Sep 17 00:00:00 2001 From: Valeriy Filippov Date: Wed, 11 Mar 2026 10:51:09 +0300 Subject: [PATCH] Add comments --- nvim/lua/plugins/blink.lua | 91 ++++++++++++++-------------- nvim/lua/plugins/gitlab.lua | 26 ++++---- nvim/lua/plugins/mason.lua | 68 ++++++++++----------- nvim/lua/plugins/snacks.lua | 114 +++++++++++++++++++---------------- nvim/lua/plugins/trouble.lua | 15 ++--- 5 files changed, 163 insertions(+), 151 deletions(-) diff --git a/nvim/lua/plugins/blink.lua b/nvim/lua/plugins/blink.lua index 086d6cd..6b66e07 100644 --- a/nvim/lua/plugins/blink.lua +++ b/nvim/lua/plugins/blink.lua @@ -1,53 +1,54 @@ +-- https://github.com/saghen/blink.cmp return { - 'saghen/blink.cmp', - -- optional: provides snippets for the snippet source - dependencies = { 'rafamadriz/friendly-snippets' }, + "saghen/blink.cmp", + -- optional: provides snippets for the snippet source + dependencies = { "rafamadriz/friendly-snippets" }, - -- use a release tag to download pre-built binaries - version = '1.*', - -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust - -- build = 'cargo build --release', - -- If you use nix, you can build from source using latest nightly rust with: - -- build = 'nix run .#build-plugin', + -- use a release tag to download pre-built binaries + version = "1.*", + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', - ---@module 'blink.cmp' - ---@type blink.cmp.Config - opts = { - -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) - -- 'super-tab' for mappings similar to vscode (tab to accept) - -- 'enter' for enter to accept - -- 'none' for no mappings - -- - -- All presets have the following mappings: - -- C-space: Open menu or open docs if already open - -- C-n/C-p or Up/Down: Select next/previous item - -- C-e: Hide menu - -- C-k: Toggle signature help (if signature.enabled = true) - -- - -- See :h blink-cmp-config-keymap for defining your own keymap - keymap = { preset = 'default' }, + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + keymap = { preset = "default" }, - appearance = { - -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono' - }, + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = "mono", + }, - -- (Default) Only show the documentation popup when manually triggered - completion = { documentation = { auto_show = true } }, + -- (Default) Only show the documentation popup when manually triggered + completion = { documentation = { auto_show = true } }, - -- Default list of enabled providers defined so that you can extend it - -- elsewhere in your config, without redefining it, due to `opts_extend` - sources = { - default = { 'lsp', 'path', 'snippets', 'buffer' }, - }, + -- Default list of enabled providers defined so that you can extend it + -- elsewhere in your config, without redefining it, due to `opts_extend` + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + }, - -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance - -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, - -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` - -- - -- See the fuzzy documentation for more information - fuzzy = { implementation = "prefer_rust_with_warning" } - }, - opts_extend = { "sources.default" } + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance + -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, + -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` + -- + -- See the fuzzy documentation for more information + fuzzy = { implementation = "prefer_rust_with_warning" }, + }, + opts_extend = { "sources.default" }, } diff --git a/nvim/lua/plugins/gitlab.lua b/nvim/lua/plugins/gitlab.lua index dbc4586..36db186 100644 --- a/nvim/lua/plugins/gitlab.lua +++ b/nvim/lua/plugins/gitlab.lua @@ -1,14 +1,16 @@ +-- https://github.com/harrisoncramer/gitlab.nvim return { - "harrisoncramer/gitlab.nvim", - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers. - "nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree. - }, - build = function () require("gitlab.server").build(true) end, -- Builds the Go binary - config = function() - require("gitlab").setup() - end, + "harrisoncramer/gitlab.nvim", + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree. + }, + build = function() + require("gitlab.server").build(true) + end, -- Builds the Go binary + config = function() + require("gitlab").setup() + end, } diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua index 3fa1e52..637e2d5 100644 --- a/nvim/lua/plugins/mason.lua +++ b/nvim/lua/plugins/mason.lua @@ -1,38 +1,38 @@ -- https://github.com/mason-org/mason.nvim -- https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim return { - { - "mason-org/mason.nvim", - opts = { - registries = { - "file:~/.config/mason-registry", - "github:mason-org/mason-registry", - }, - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗" - } - } - } - }, - { - "WhoIsSethDaniel/mason-tool-installer.nvim", - opts = { - ensure_installed = { - "docker-language-server", - "gitlab-ci-ls", - "lua-language-server", - "prettier", - "prettierd", - "stylua", - "terraform-ls", - "yaml-language-server", - }, - }, - dependencies = { - "williamboman/mason.nvim", - }, - } + { + "mason-org/mason.nvim", + opts = { + registries = { + "file:~/.config/mason-registry", + "github:mason-org/mason-registry", + }, + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, + }, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + opts = { + ensure_installed = { + "docker-language-server", -- https://github.com/docker/docker-language-server + "gitlab-ci-ls", -- https://github.com/alesbrelih/gitlab-ci-ls + "lua-language-server", -- https://github.com/luals/lua-language-server + "prettier", -- https://github.com/prettier/prettier + "prettierd", -- https://github.com/prettier/prettier + "stylua", -- https://github.com/JohnnyMorganz/StyLua + "terraform-ls", -- https://github.com/hashicorp/terraform-ls + "yaml-language-server", -- https://github.com/redhat-developer/yaml-language-server + }, + }, + dependencies = { + "williamboman/mason.nvim", + }, + }, } diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua index 332e21a..c685356 100644 --- a/nvim/lua/plugins/snacks.lua +++ b/nvim/lua/plugins/snacks.lua @@ -1,24 +1,25 @@ +-- https://github.com/folke/snacks.nvim return { - "folke/snacks.nvim", - priority = 1000, - lazy = false, - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - indent = { enabled = true }, - input = { enabled = true }, - git = { enabled = true }, - lazygit = { enabled = true }, - notifier = { enabled = true }, - picker = { enabled = true }, - dashboard = { - width = 80, - row = nil, -- dashboard position. nil for center - col = nil, -- dashboard position. nil for center - pane_gap = 20, -- empty columns between vertical panes - preset = { - header = [[ + "folke/snacks.nvim", + priority = 1000, + lazy = false, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + indent = { enabled = true }, + input = { enabled = true }, + git = { enabled = true }, + lazygit = { enabled = true }, + notifier = { enabled = true }, + picker = { enabled = true }, + dashboard = { + width = 80, + row = nil, -- dashboard position. nil for center + col = nil, -- dashboard position. nil for center + pane_gap = 20, -- empty columns between vertical panes + preset = { + header = [[ " *++*- " " -=+++++ " " -=====++= " @@ -49,37 +50,44 @@ return { " ###- " " *####% " " .:-:. "]], - keys = { - { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, - { icon = " ", key = "e", desc = "File Explorer", action = ":NvimTreeToggle" }, - { icon = " ", key = "ff", desc = "Find File", action = ":Telescope find_files" }, - { icon = " ", key = "fs", desc = "Find String", action = ":Telescope live_grep" }, - { icon = " ", key = "s", desc = "Restore Session", action = ":AutoSession restore"}, - { icon = "󰒲 ", key = "L", desc = "Lazy UI", action = ":Lazy" }, - { icon = " ", key = "M", desc = "Mason UI", action = ":Mason" }, - { icon = " ", key = "G", desc = "LazyGit", action = function() Snacks.lazygit() end}, - { icon = " ", key = "q", desc = "Quit", action = ":qa" }, - }, - }, - sections = { - { section = "header" }, - { - pane = 2, - icon = " ", - title = "Git Status", - section = "terminal", - enabled = function() - return Snacks.git.get_root() ~= nil - end, - cmd = "git status --short --branch --renames", - height = 5, - padding = 2, - ttl = 5 * 60, - indent = 3, - }, - { pane = 2, section = "keys", gap = 1, padding = 4 }, - { pane = 2, section = "startup" }, - }, - }, - }, + keys = { + { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, + { icon = " ", key = "e", desc = "File Explorer", action = ":NvimTreeToggle" }, + { icon = " ", key = "ff", desc = "Find File", action = ":Telescope find_files" }, + { icon = " ", key = "fs", desc = "Find String", action = ":Telescope live_grep" }, + { icon = " ", key = "s", desc = "Restore Session", action = ":AutoSession restore" }, + { icon = "󰒲 ", key = "L", desc = "Lazy UI", action = ":Lazy" }, + { icon = " ", key = "M", desc = "Mason UI", action = ":Mason" }, + { + icon = " ", + key = "G", + desc = "LazyGit", + action = function() + Snacks.lazygit() + end, + }, + { icon = " ", key = "q", desc = "Quit", action = ":qa" }, + }, + }, + sections = { + { section = "header" }, + { + pane = 2, + icon = " ", + title = "Git Status", + section = "terminal", + enabled = function() + return Snacks.git.get_root() ~= nil + end, + cmd = "git status --short --branch --renames", + height = 5, + padding = 2, + ttl = 5 * 60, + indent = 3, + }, + { pane = 2, section = "keys", gap = 1, padding = 4 }, + { pane = 2, section = "startup" }, + }, + }, + }, } diff --git a/nvim/lua/plugins/trouble.lua b/nvim/lua/plugins/trouble.lua index e284456..9c2fd97 100644 --- a/nvim/lua/plugins/trouble.lua +++ b/nvim/lua/plugins/trouble.lua @@ -1,9 +1,10 @@ +-- https://github.com/folke/trouble.nvim return { - "folke/trouble.nvim", - dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" }, - opts = { - focus = true, - auto_preview = false, - }, - cmd = "Trouble", + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" }, + opts = { + focus = true, + auto_preview = false, + }, + cmd = "Trouble", }