From f1bdc4a2218b50213a61f49dab2ac9e173a6e12d Mon Sep 17 00:00:00 2001 From: duma799 Date: Thu, 12 Feb 2026 01:11:21 +0400 Subject: [PATCH] Normalize nvim plugin configs to 4-space indentation --- nvim/lua/plugins/completions.lua | 194 +++++++++++++++---------------- nvim/lua/plugins/csscolors.lua | 12 +- nvim/lua/plugins/git.lua | 2 +- nvim/lua/plugins/icons.lua | 32 ++--- nvim/lua/plugins/neo-tree.lua | 78 ++++++------- nvim/lua/plugins/treesitter.lua | 20 ++-- 6 files changed, 168 insertions(+), 170 deletions(-) diff --git a/nvim/lua/plugins/completions.lua b/nvim/lua/plugins/completions.lua index 646b978..fafa1f0 100755 --- a/nvim/lua/plugins/completions.lua +++ b/nvim/lua/plugins/completions.lua @@ -1,104 +1,102 @@ return { - { - "hrsh7th/cmp-nvim-lsp", - }, - { - "hrsh7th/cmp-buffer", - }, - { - "hrsh7th/cmp-path", - }, - { - "hrsh7th/cmp-cmdline", - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", + { + "hrsh7th/cmp-nvim-lsp", }, - }, - { - "hrsh7th/nvim-cmp", - config = function() - local cmp = require("cmp") - local luasnip = require("luasnip") - require("luasnip.loaders.from_vscode").lazy_load() + { + "hrsh7th/cmp-buffer", + }, + { + "hrsh7th/cmp-path", + }, + { + "hrsh7th/cmp-cmdline", + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + }, + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + require("luasnip.loaders.from_vscode").lazy_load() - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp", priority = 1000 }, - { name = "luasnip", priority = 750 }, - { name = "buffer", priority = 500 }, - { name = "path", priority = 250 }, - }), - formatting = { - format = function(entry, vim_item) - vim_item.menu = ({ - nvim_lsp = "[LSP]", - luasnip = "[Snippet]", - buffer = "[Buffer]", - path = "[Path]", - })[entry.source.name] - return vim_item - end, - }, - experimental = { - ghost_text = true, - }, - }) + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp", priority = 1000 }, + { name = "luasnip", priority = 750 }, + { name = "buffer", priority = 500 }, + { name = "path", priority = 250 }, + }), + formatting = { + format = function(entry, vim_item) + vim_item.menu = ({ + nvim_lsp = "[LSP]", + luasnip = "[Snippet]", + buffer = "[Buffer]", + path = "[Path]", + })[entry.source.name] + return vim_item + end, + }, + experimental = { + ghost_text = true, + }, + }) - -- Use buffer source for `/` and `?` (search) - cmp.setup.cmdline({ "/", "?" }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = "buffer" }, - }, - }) + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) - -- Use cmdline & path source for ':' (command mode) - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - }) - end, - }, + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + }) + end, + }, } diff --git a/nvim/lua/plugins/csscolors.lua b/nvim/lua/plugins/csscolors.lua index 8ceec3c..848043a 100755 --- a/nvim/lua/plugins/csscolors.lua +++ b/nvim/lua/plugins/csscolors.lua @@ -1,8 +1,8 @@ return { - 'norcalli/nvim-colorizer.lua', - config = function() - require('colorizer').setup { - '*' - } - end + 'norcalli/nvim-colorizer.lua', + config = function() + require('colorizer').setup { + '*' + } + end } diff --git a/nvim/lua/plugins/git.lua b/nvim/lua/plugins/git.lua index 622d2a1..161d5bc 100755 --- a/nvim/lua/plugins/git.lua +++ b/nvim/lua/plugins/git.lua @@ -1,5 +1,5 @@ return { - "lewis6991/gitsigns.nvim", -- Add a comma here + "lewis6991/gitsigns.nvim", config = function() require('gitsigns').setup { signs = { diff --git a/nvim/lua/plugins/icons.lua b/nvim/lua/plugins/icons.lua index 5c6e27a..4226269 100755 --- a/nvim/lua/plugins/icons.lua +++ b/nvim/lua/plugins/icons.lua @@ -1,19 +1,19 @@ return { - "echasnovski/mini.icons", - lazy = true, - opts = { - file = { - [".keep"] = { glyph = "󰊢", hl = "MiniIconsGrey" }, - ["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" }, + "echasnovski/mini.icons", + lazy = true, + opts = { + file = { + [".keep"] = { glyph = "󰊢", hl = "MiniIconsGrey" }, + ["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" }, + }, + filetype = { + dotenv = { glyph = "", hl = "MiniIconsYellow" }, + }, }, - filetype = { - dotenv = { glyph = "", hl = "MiniIconsYellow" }, - }, - }, - init = function() - package.preload["nvim-web-devicons"] = function() - require("mini.icons").mock_nvim_web_devicons() - return package.loaded["nvim-web-devicons"] - end - end, + init = function() + package.preload["nvim-web-devicons"] = function() + require("mini.icons").mock_nvim_web_devicons() + return package.loaded["nvim-web-devicons"] + end + end, } diff --git a/nvim/lua/plugins/neo-tree.lua b/nvim/lua/plugins/neo-tree.lua index 1a0478c..ef382ee 100755 --- a/nvim/lua/plugins/neo-tree.lua +++ b/nvim/lua/plugins/neo-tree.lua @@ -1,41 +1,41 @@ return { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - }, - config = function() - require("neo-tree").setup({ - close_if_last_window = false, - popup_border_style = "rounded", - enable_git_status = true, - enable_diagnostics = true, - filesystem = { - filtered_items = { - visible = false, - hide_dotfiles = false, - hide_gitignored = false, - }, - follow_current_file = { - enabled = false, - }, - use_libuv_file_watcher = true, - }, - window = { - position = "left", - width = 30, - }, - event_handlers = { - { - event = "file_opened", - handler = function() - require("neo-tree.command").execute({ action = "close" }) - end, - }, - }, - }) - vim.keymap.set("n", "", ":Neotree filesystem reveal left") - end, + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + require("neo-tree").setup({ + close_if_last_window = false, + popup_border_style = "rounded", + enable_git_status = true, + enable_diagnostics = true, + filesystem = { + filtered_items = { + visible = false, + hide_dotfiles = false, + hide_gitignored = false, + }, + follow_current_file = { + enabled = false, + }, + use_libuv_file_watcher = true, + }, + window = { + position = "left", + width = 30, + }, + event_handlers = { + { + event = "file_opened", + handler = function() + require("neo-tree.command").execute({ action = "close" }) + end, + }, + }, + }) + vim.keymap.set("n", "", ":Neotree filesystem reveal left") + end, } diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index 8af9fca..95e63a0 100755 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -1,12 +1,12 @@ return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - local config = require("nvim-treesitter.configs") - config.setup({ - auto_install = false, - highlight = { enable = true }, - indent = { enable = true }, - }) - end, + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local config = require("nvim-treesitter.configs") + config.setup({ + auto_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, }