From fcab70e06325f123030a9442aef001707a603950 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 17 Apr 2026 10:53:11 +0100 Subject: refactor: flatten custom/plugins/ to plugins/ Rename lua/custom/plugins/ to lua/plugins/ following the standard lazy.nvim convention. The extra custom/ nesting added no value. Update import path in init.lua accordingly. --- .../.config/nvim/lua/custom/plugins/completion.lua | 152 ------ home/.config/nvim/lua/custom/plugins/debug.lua | 101 ---- home/.config/nvim/lua/custom/plugins/git.lua | 159 ------- home/.config/nvim/lua/custom/plugins/init.lua | 521 --------------------- home/.config/nvim/lua/custom/plugins/lsp.lua | 207 -------- home/.config/nvim/lua/custom/plugins/search.lua | 183 -------- home/.config/nvim/lua/custom/plugins/ts.lua | 153 ------ home/.config/nvim/lua/custom/plugins/ui.lua | 83 ---- 8 files changed, 1559 deletions(-) delete mode 100644 home/.config/nvim/lua/custom/plugins/completion.lua delete mode 100644 home/.config/nvim/lua/custom/plugins/debug.lua delete mode 100644 home/.config/nvim/lua/custom/plugins/git.lua delete mode 100644 home/.config/nvim/lua/custom/plugins/init.lua delete mode 100644 home/.config/nvim/lua/custom/plugins/lsp.lua delete mode 100644 home/.config/nvim/lua/custom/plugins/search.lua delete mode 100644 home/.config/nvim/lua/custom/plugins/ts.lua delete mode 100644 home/.config/nvim/lua/custom/plugins/ui.lua (limited to 'home/.config/nvim/lua/custom') diff --git a/home/.config/nvim/lua/custom/plugins/completion.lua b/home/.config/nvim/lua/custom/plugins/completion.lua deleted file mode 100644 index ca46170..0000000 --- a/home/.config/nvim/lua/custom/plugins/completion.lua +++ /dev/null @@ -1,152 +0,0 @@ -return { - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - build = ":Copilot auth", - event = "InsertEnter", - dependencies = { - { - "copilotlsp-nvim/copilot-lsp", - init = function() - vim.g.copilot_nes_debounce = 500 - end, - }, - }, - keys = { - { - "tc", - function() - require("copilot.command").toggle() - end, - desc = "[T]oggle [C]opilot attachment", - }, - }, - opts = { - suggestion = { enabled = false }, - panel = { enabled = false }, - server_opts_overrides = { - settings = { - telemetry = { - telemetryLevel = "off", - }, - }, - }, - nes = { - enabled = true, - keymap = { - accept_and_goto = "p", - accept = false, - dismiss = "", - }, - }, - }, - }, - { - "saghen/blink.compat", - opts = {}, - }, - { - "saghen/blink.cmp", - dependencies = { - "rafamadriz/friendly-snippets", - "fang2hou/blink-copilot", - "rcarriga/cmp-dap", - "xzbdmw/colorful-menu.nvim", - }, - opts = { - keymap = { - preset = "cmdline", - [""] = { "accept", "fallback" }, - }, - appearance = { - use_nvim_cmp_as_default = true, - }, - completion = { - menu = { - draw = { - -- treesitter = { "lsp" }, - -- We don't need label_description now because label and label_description are already - -- combined together in label by colorful-menu.nvim. - columns = { { "kind_icon" }, { "label", gap = 1 } }, - components = { - label = { - text = function(ctx) - return require("colorful-menu").blink_components_text(ctx) - end, - highlight = function(ctx) - return require("colorful-menu").blink_components_highlight( - ctx - ) - end, - }, - }, - }, - }, - list = { - selection = { - preselect = function() - return not require("blink.cmp").snippet_active({ direction = 1 }) - end, - }, - }, - documentation = { auto_show = true }, - }, - signature = { - enabled = true, - trigger = { - enabled = true, - show_on_keyword = true, - show_on_insert = true, - }, - }, - sources = { - default = { "lazydev", "lsp", "copilot", "snippets", "path", "buffer" }, - per_filetype = { - ["dap-repl"] = { "dap" }, - codecompanion = { "codecompanion" }, - }, - providers = { - path = { - opts = { - get_cwd = vim.fn.getcwd, - }, - }, - copilot = { - name = "copilot", - module = "blink-copilot", - score_offset = 100, - async = true, - }, - lazydev = { - name = "LazyDev", - module = "lazydev.integrations.blink", - -- make lazydev completions top priority (see `:h blink.cmp`) - score_offset = 100, - }, - dap = { name = "dap", module = "blink.compat.source" }, - }, - }, - }, - }, - { - "saghen/blink.pairs", - version = "*", - dependencies = "saghen/blink.download", - opts = { - mappings = { - disabled_filetypes = {}, - }, - highlights = { - groups = { - "BlinkIndentOrange", - "BlinkIndentViolet", - "BlinkIndentBlue", - "BlinkIndentRed", - "BlinkIndentCyan", - "BlinkIndentYellow", - "BlinkIndentGreen", - }, - }, - }, - }, -} diff --git a/home/.config/nvim/lua/custom/plugins/debug.lua b/home/.config/nvim/lua/custom/plugins/debug.lua deleted file mode 100644 index b47dd63..0000000 --- a/home/.config/nvim/lua/custom/plugins/debug.lua +++ /dev/null @@ -1,101 +0,0 @@ -return { - { - "miroshQa/debugmaster.nvim", - branch = "dashboard", - dependencies = "mfussenegger/nvim-dap", - keys = { - { - "td", - function() - require("debugmaster").mode.toggle() - end, - desc = "[T]oggle [D]ebug mode", - }, - }, - }, - { - "mfussenegger/nvim-dap", - config = function() - local dap = require("dap") - - local function get_env_vars() - local variables = vim.fn.environ() - table.insert(variables, { ASAN_OPTIONS = "detect_leaks=0" }) - return variables - end - - dap.adapters.lldb = { - type = "executable", - command = "lldb-dap", - name = "lldb", - env = get_env_vars, - } - dap.adapters.gdb = { - type = "executable", - command = "gdb", - args = { "--interpreter=dap" }, - env = get_env_vars, - } - dap.adapters.codelldb = { - type = "executable", - command = "codelldb", - env = get_env_vars, - } - - local function get_program() - local _program - vim.ui.input({ - prompt = "Program: ", - complete = "file_in_path", - }, function(res) - _program = res - end) - return vim.fn.system("which " .. _program):gsub("\n$", "") - end - - local function get_args() - local _args - vim.ui.input({ - prompt = "Args: ", - default = vim.fn.getreg("+"), - complete = "file", - }, function(res) - _args = res - end) - return require("dap.utils").splitstr(_args) - end - - dap.configurations.cpp = { - { - name = "codelldb Launch", - type = "codelldb", - request = "launch", - cwd = "${workspaceFolder}", - program = get_program, - args = get_args, - stopOnEntry = true, - console = "integratedTerminal", - }, - } - - dap.configurations.c = dap.configurations.cpp - dap.configurations.rust = dap.configurations.cpp - end, - dependencies = { - { - "theHamsta/nvim-dap-virtual-text", - opts = {}, - dependencies = { "nvim-treesitter/nvim-treesitter" }, - }, - "williamboman/mason.nvim", - { - "jay-babu/mason-nvim-dap.nvim", - opts = { - automatic_installation = false, - handlers = {}, - ensure_installed = {}, - }, - }, - }, - }, -} diff --git a/home/.config/nvim/lua/custom/plugins/git.lua b/home/.config/nvim/lua/custom/plugins/git.lua deleted file mode 100644 index 9e920e2..0000000 --- a/home/.config/nvim/lua/custom/plugins/git.lua +++ /dev/null @@ -1,159 +0,0 @@ -return { - { - "akinsho/git-conflict.nvim", - event = "BufRead", - opts = { - disable_diagnostics = true, - default_mappings = { - next = "]x", - prev = "[x", - }, - }, - }, - { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", - }, - keys = { - { - "go", - function() - require("neogit").open() - end, - desc = "neo[G]it [O]pen", - }, - }, - cmd = "Neogit", - opts = { - disable_commit_confirmation = true, - kind = "split", - console_timeout = 5000, - auto_show_console = false, - }, - }, - { - "ruifm/gitlinker.nvim", - keys = { - { - "gy", - function() - require("gitlinker").get_buf_range_url("n") - end, - }, - { - "gy", - function() - require("gitlinker").get_buf_range_url("v") - end, - mode = "v", - }, - }, - dependencies = { - "nvim-lua/plenary.nvim", - }, - opts = { - callbacks = { - ["git.sommerfeld.dev"] = function(url_data) - local url = require("gitlinker.hosts").get_base_https_url(url_data) - url = url .. "/tree/" .. url_data.file .. "?id=" .. url_data.rev - if url_data.lstart then - url = url .. "#n" .. url_data.lstart - end - return url - end, - }, - }, - }, - { - "lewis6991/gitsigns.nvim", - event = "BufRead", - opts = { - signs = { - change = { show_count = true }, - delete = { show_count = true }, - topdelete = { show_count = true }, - changedelete = { show_count = true }, - }, - numhl = true, - on_attach = function(bufnr) - local gs = require("gitsigns") - local function map(mode, l, r, desc) - vim.keymap.set(mode, l, r, { buffer = bufnr, desc = desc }) - end - local function nmap(l, r, desc) - map("n", l, r, desc) - end - local function vmap(l, r, desc) - map("v", l, r, desc) - end - -- Navigation - nmap("]c", function() - if vim.wo.diff then - vim.cmd.normal({ "]c", bang = true }) - else - gs.nav_hunk("next") - end - end, "Jump to next git [c]hange") - - nmap("[c", function() - if vim.wo.diff then - vim.cmd.normal({ "[c", bang = true }) - else - gs.nav_hunk("prev") - end - end, "Jump to previous git [c]hange") - - -- Actions - nmap("hs", gs.stage_hunk, "git [s]tage hunk") - nmap("hr", gs.reset_hunk, "git [r]eset hunk") - vmap("hs", function() - gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, "git [s]tage hunk") - vmap("hr", function() - gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, "git [r]eset hunk") - nmap("hS", gs.stage_buffer, "git [S]tage buffer") - nmap("hR", gs.reset_buffer, "git [R]eset buffer") - nmap("hp", gs.preview_hunk, "git [p]review hunk") - nmap("hb", function() - gs.blame_line({ full = true }) - end, "git [b]lame line") - nmap( - "tb", - gs.toggle_current_line_blame, - "[T]oggle git show [b]lame line" - ) - nmap("hd", gs.diffthis, "git [d]iff against index") - nmap("hD", function() - gs.diffthis("~") - end, "git [D]iff against last commit") - nmap("hc", gs.change_base, "git [C]hange base to index") - nmap("hC", function() - gs.change_base("~") - end, "git [C]hange base to HEAD") - nmap( - "tgd", - gs.preview_hunk_inline, - "[T]oggle [G]it show [D]eleted" - ) - nmap("tgw", gs.toggle_word_diff, "[T]oggle [G]it [W]ord diff") - nmap( - "tgl", - gs.toggle_linehl, - "[T]oggle [G]it [L]ine highlighting" - ) - -- Text object - map( - { "o", "x" }, - "ih", - ":Gitsigns select_hunk", - "git [H]unk text object" - ) - end, - }, - dependencies = { - "nvim-lua/plenary.nvim", - }, - }, -} diff --git a/home/.config/nvim/lua/custom/plugins/init.lua b/home/.config/nvim/lua/custom/plugins/init.lua deleted file mode 100644 index 2822338..0000000 --- a/home/.config/nvim/lua/custom/plugins/init.lua +++ /dev/null @@ -1,521 +0,0 @@ -return { - { "nvim-lua/plenary.nvim", branch = "master", lazy = true }, - { - "nmac427/guess-indent.nvim", - event = "BufRead", - opts = {}, - }, - { - "kylechui/nvim-surround", - event = "VeryLazy", - opts = {}, - }, - { - "chrisgrieser/nvim-various-textobjs", - event = "VeryLazy", - opts = { - keymaps = { - useDefaults = true, - }, - }, - }, - { - "monaqa/dial.nvim", - keys = { - { - "]i", - function() - require("dial.map").inc_normal() - end, - expr = true, - desc = "Increment", - }, - { - "[i", - function() - require("dial.map").dec_normal() - end, - expr = true, - desc = "Decrement", - }, - { - "]i", - function() - require("dial.map").inc_visual() - end, - expr = true, - mode = "v", - desc = "Increment", - }, - { - "[i", - function() - require("dial.map").dec_visual() - end, - expr = true, - mode = "v", - desc = "Decrement", - }, - }, - }, - { - "iamcco/markdown-preview.nvim", - cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, - build = "cd app && yarn install", - ft = "markdown", - }, - { - "rmagatti/auto-session", - lazy = false, - opts = function() - -- Convert the cwd to a simple file name - local function get_cwd_as_name() - local dir = vim.fn.getcwd(0) - return dir:gsub("[^A-Za-z0-9]", "_") - end - local overseer = require("overseer") - return { - use_git_branch = true, - pre_save_cmds = { - function() - overseer.save_task_bundle( - get_cwd_as_name(), - -- Passing nil will use config.opts.save_task_opts. You can call list_tasks() explicitly and - -- pass in the results if you want to save specific tasks. - nil, - { on_conflict = "overwrite" } -- Overwrite existing bundle, if any - ) - end, - }, - -- Optionally get rid of all previous tasks when restoring a session - pre_restore_cmds = { - function() - for _, task in ipairs(overseer.list_tasks({})) do - task:dispose(true) - end - end, - }, - post_restore_cmds = { - function() - overseer.load_task_bundle( - get_cwd_as_name(), - { ignore_missing = true, autostart = false } - ) - end, - }, - save_extra_data = function(_) - local ok, breakpoints = pcall(require, "dap.breakpoints") - if not ok or not breakpoints then - return - end - - local bps = {} - local breakpoints_by_buf = breakpoints.get() - for buf, buf_bps in pairs(breakpoints_by_buf) do - bps[vim.api.nvim_buf_get_name(buf)] = buf_bps - end - if vim.tbl_isempty(bps) then - return - end - local extra_data = { - breakpoints = bps, - } - return vim.fn.json_encode(extra_data) - end, - - restore_extra_data = function(_, extra_data) - local json = vim.fn.json_decode(extra_data) - - if json.breakpoints then - local ok, breakpoints = pcall(require, "dap.breakpoints") - - if not ok or not breakpoints then - return - end - vim.notify("restoring breakpoints") - for buf_name, buf_bps in pairs(json.breakpoints) do - for _, bp in pairs(buf_bps) do - local line = bp.line - local opts = { - condition = bp.condition, - log_message = bp.logMessage, - hit_condition = bp.hitCondition, - } - breakpoints.set(opts, vim.fn.bufnr(buf_name), line) - end - end - end - end, - suppressed_dirs = { "~/", "/" }, - } - end, - }, - { - "aserowy/tmux.nvim", - event = "VeryLazy", - opts = { - resize = { - enable_default_keybindings = false, - }, - }, - }, - { - "stevearc/overseer.nvim", - version = "v1.6.0", - keys = { - { - "to", - function() - require("overseer").toggle() - end, - desc = "[T]oggle [O]verseer", - }, - { - "ob", - function() - require("overseer").run_template({ - name = "just build", - prompt = "never", - }) - end, - desc = "[O]verseer [B]uild", - }, - { - "oB", - function() - require("overseer").run_template({ - name = "just build", - }) - end, - desc = "[O]verseer [B]uild", - }, - { - "ot", - function() - require("overseer").run_template({ - name = "just test", - prompt = "never", - }) - end, - desc = "[O]verseer [J]ust [T]est", - }, - { - "oT", - function() - require("overseer").run_template({ - name = "just test", - }) - end, - desc = "[O]verseer [J]ust [T]est", - }, - { - "of", - function() - require("overseer").run_template({ - name = "just test", - prompt = "never", - params = { target = vim.fn.expand("%") }, - }) - end, - desc = "[O]verseer test [F]ile", - }, - { - "oF", - function() - require("overseer").run_template({ - name = "just test", - params = { target = vim.fn.expand("%") }, - }) - end, - desc = "[O]verseer test [F]ile", - }, - { - "od", - function() - require("overseer").run_template({ - name = "just debug=true test", - prompt = "never", - params = { target = vim.fn.expand("%") }, - }) - end, - desc = "[O]verseer [d]ebug test file", - }, - { - "oD", - function() - require("overseer").run_template({ - name = "just debug=true test", - params = { target = vim.fn.expand("%") }, - }) - end, - desc = "[O]verseer [D]ebug test file", - }, - { - "oa", - function() - require("overseer").run_template({ - name = "just test_autofix", - prompt = "never", - params = { target = vim.fn.expand("%") }, - }) - end, - desc = "[O]verseer [A]utofix", - }, - { - "or", - function() - require("overseer").run_template() - end, - desc = "[O]verseer [R]un", - }, - { - "os", - function() - require("overseer").run_template({ name = "shell" }) - end, - desc = "[O]verseer [S]hell", - }, - { - "ol", - function() - local tasks = require("overseer").list_tasks({ recent_first = true }) - if vim.tbl_isempty(tasks) then - vim.notify("No tasks found", vim.log.levels.WARN) - else - require("overseer").run_action(tasks[1], "restart") - end - end, - desc = "[O]verseer run [L]ast", - }, - }, - config = function() - local overseer = require("overseer") - overseer.setup({}) - overseer.add_template_hook({ name = ".*" }, function(task_defn, util) - util.add_component(task_defn, { - "open_output", - on_start = "never", - on_complete = "failure", - direction = "vertical", - }) - end) - end, - }, - { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - keys = { - { - "re", - function() - require("refactoring").refactor("Extract Function") - end, - mode = "x", - desc = "[R]efactor [E]xtract function", - }, - { - "rf", - function() - require("refactoring").refactor("Extract Function To File") - end, - mode = "x", - desc = "[R]efactor extract function to [F]ile", - }, - { - "rv", - function() - require("refactoring").refactor("Extract Variable") - end, - mode = "x", - desc = "[R]efactor extract [V]ariable", - }, - { - "rI", - function() - require("refactoring").refactor("Inline Function") - end, - desc = "[R]efactor [I]nline function", - }, - { - "ri", - function() - require("refactoring").refactor("Inline Variable") - end, - mode = { "x", "n" }, - desc = "[R]efactor [I]nline variable", - }, - { - "rb", - function() - require("refactoring").refactor("Extract Block") - end, - desc = "[R]efactor extract [B]lock", - }, - { - "rB", - function() - require("refactoring").refactor("Extract Block To File") - end, - desc = "[R]efactor extract [B]lock to file", - }, - { - "rp", - function() - require("refactoring").debug.printf({}) - end, - desc = "[R]efactor [P]rint", - }, - - { - "rV", - function() - require("refactoring").debug.print_var({}) - end, - mode = { "x", "n" }, - desc = "[R]efactor [P]rint [V]ariable", - }, - { - "rc", - function() - require("refactoring").debug.cleanup({}) - end, - desc = "[R]efactor [C]leanup", - }, - }, - opts = {}, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - spec = { - { "g", group = "[G]oto" }, - { "yo", group = "Toggle options" }, - { "]", group = "Navigate to next" }, - { "[", group = "Navigate to previous" }, - { "c", group = "[C]ode", mode = { "n", "x" } }, - { "d", group = "[D]ocument" }, - { "g", group = "[G]it" }, - { "h", group = "Git [H]unk", mode = { "n", "v" } }, - { "n", group = "[N]eotest" }, - { "o", group = "[O]verseer" }, - { "r", group = "[R]efactor" }, - { "s", group = "[S]earch" }, - { "w", group = "[W]orkspace" }, - { "t", group = "[T]oggle" }, - }, - }, - keys = { - { - "?", - function() - require("which-key").show({ global = false }) - end, - desc = "Buffer Local Keymaps (which-key)", - }, - }, - }, - { - "stevearc/quicker.nvim", - event = "FileType qf", - keys = { - { - "tq", - function() - require("quicker").toggle() - end, - desc = "[T]oggle [Q]uickfix", - }, - { - "tl", - function() - require("quicker").toggle({ loclist = true }) - end, - desc = "[T]oggle [L]oclist", - }, - }, - opts = { - keys = { - { - ">", - function() - require("quicker").expand({ - before = 2, - after = 2, - add_to_existing = true, - }) - end, - desc = "Expand quickfix context", - }, - { - "<", - function() - require("quicker").collapse() - end, - desc = "Collapse quickfix context", - }, - }, - }, - }, - { - "olimorris/codecompanion.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "ravitemer/mcphub.nvim", - }, - keys = { - { - "aa", - "CodeCompanionActions", - mode = { "n", "v" }, - noremap = true, - silent = true, - desc = "[A]I [A]ctions", - }, - { - "ta", - "CodeCompanionChat Toggle", - mode = { "n", "v" }, - noremap = true, - silent = true, - desc = "[T]oggle [A]I chat", - }, - { - "ac", - "CodeCompanionChat Add", - mode = "v", - noremap = true, - silent = true, - desc = "[A]I [C]hat add", - }, - }, - opts = { - strategies = { - chat = { - adapter = "copilot", - }, - inline = { - adapter = "copilot", - }, - }, - extensions = { - mcphub = { - callback = "mcphub.extensions.codecompanion", - opts = { - make_vars = true, - make_slash_commands = true, - show_result_in_chat = true, - }, - }, - }, - }, - }, - { - "stevearc/oil.nvim", - opts = {}, - lazy = false, - }, -} diff --git a/home/.config/nvim/lua/custom/plugins/lsp.lua b/home/.config/nvim/lua/custom/plugins/lsp.lua deleted file mode 100644 index 585c285..0000000 --- a/home/.config/nvim/lua/custom/plugins/lsp.lua +++ /dev/null @@ -1,207 +0,0 @@ -return { - { - "folke/lazydev.nvim", - ft = "lua", - opts = { - library = { - { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - }, - }, - }, - { - "neovim/nvim-lspconfig", - version = false, - dependencies = { - { "j-hui/fidget.nvim", opts = {} }, - "saghen/blink.cmp", - { "williamboman/mason.nvim", opts = {} }, - { - "williamboman/mason-lspconfig.nvim", - opts = { - ensure_installed = {}, - automatic_installation = false, - handlers = { - function(server_name) - vim.lsp.enable(server_name) - end, - }, - }, - }, - { - "WhoIsSethDaniel/mason-tool-installer.nvim", - opts = { - ensure_installed = { - "actionlint", - "autotools-language-server", - "basedpyright", - "bash-language-server", - "clangd", - "codelldb", - "codespell", - "css-lsp", - "dockerfile-language-server", - "gh", - "gh-actions-language-server", - "groovy-language-server", - "hadolint", - "html-lsp", - "jq", - "json-lsp", - "jsonlint", - "just-lsp", -- "Platform unsupported" - "lua-language-server", - "markdownlint", - "mdformat", - "neocmakelsp", - "nginx-config-formatter", - "nginx-language-server", -- needs python <= 3.12 - "npm-groovy-lint", - "prettier", - "ruff", - "rust-analyzer", - "shellcheck", - "shellharden", - "shfmt", - "stylelint", - "stylua", - "systemd-lsp", - "systemdlint", - "typescript-language-server", - "typos", - "yaml-language-server", - "yamllint", - "yq", - -- "fortls", - }, - }, - }, - }, - config = function() - vim.lsp.enable("just") - vim.lsp.enable("tblgen_lsp_server") - end, - }, - { - "stevearc/conform.nvim", - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - keys = { - { - "f", - function() - require("conform").format({ async = true, lsp_fallback = true }) - end, - mode = "", - desc = "[F]ormat buffer", - }, - }, - config = function() - require("conform").setup({ - formatters_by_ft = { - awk = { "gawk" }, - bash = { "shfmt" }, - cmake = { "cmake_format" }, - css = { "prettier", "stylelint" }, - groovy = { "npm-groovy-lint" }, - html = { "prettier" }, - javascript = { "prettier" }, - typescript = { "prettier" }, - jenkins = { "npm-groovy-lint" }, - json = { "jq", "jsonlint" }, - jsonc = { "prettier" }, - just = { "just" }, - markdown = { "mdformat" }, - nginx = { "nginxfmt" }, - lua = { "stylua" }, - python = { "ruff_format", "ruff_fix", "ruff_organize_imports" }, - rust = { "rustfmt" }, - sh = { "shfmt", "shellcheck", "shellharden" }, - yaml = { "yamllint" }, - zsh = { "shfmt", "shellcheck", "shellharden" }, - }, - default_format_opts = { - lsp_format = "fallback", - }, - formatters = { - shfmt = { - prepend_args = { "-i", "2" }, - }, - }, - }) - vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" - end, - }, - { - "mrcjkb/rustaceanvim", - ft = "rust", - }, - { - "mfussenegger/nvim-lint", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local lint = require("lint") - - lint.linters_by_ft = { - css = { "stylelint" }, - dockerfile = { "hadolint" }, - groovy = { "npm-groovy-lint" }, - jenkins = { "npm-groovy-lint" }, - json = { "jsonlint" }, - markdown = { "markdownlint" }, - makefile = { "checkmake" }, - systemd = { "systemdlint" }, - yaml = { "yamllint", "yq" }, - ghaction = { "actionlint" }, - zsh = { "zsh" }, - ["*"] = { "codespell", "typos" }, - } - local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) - vim.api.nvim_create_autocmd({ "BufReadPost", "BufWritePost" }, { - group = lint_augroup, - callback = function() - if vim.opt_local.modifiable:get() then - lint.try_lint() - end - end, - }) - end, - }, - { - "rachartier/tiny-inline-diagnostic.nvim", - event = "VeryLazy", - priority = 1000, - opts = { - options = { - show_source = { - if_many = true, - }, - -- Set the arrow icon to the same color as the first diagnostic severity - set_arrow_to_diag_color = true, - -- Configuration for multiline diagnostics - -- Can be a boolean or a table with detailed options - multilines = { - -- Enable multiline diagnostic messages - enabled = true, - }, - - -- Display all diagnostic messages on the cursor line, not just those under cursor - show_all_diags_on_cursorline = true, - -- Enable diagnostics in Select mode (e.g., when auto-completing with Blink) - enable_on_select = true, - -- Configuration for breaking long messages into separate lines - break_line = { - -- Enable breaking messages after a specific length - enabled = true, - }, - -- Filter diagnostics by severity levels - -- Available severities: vim.diagnostic.severity.ERROR, WARN, INFO, HINT - severity = { - vim.diagnostic.severity.ERROR, - vim.diagnostic.severity.WARN, - vim.diagnostic.severity.INFO, - vim.diagnostic.severity.HINT, - }, - }, - }, - }, -} diff --git a/home/.config/nvim/lua/custom/plugins/search.lua b/home/.config/nvim/lua/custom/plugins/search.lua deleted file mode 100644 index 40d8395..0000000 --- a/home/.config/nvim/lua/custom/plugins/search.lua +++ /dev/null @@ -1,183 +0,0 @@ -return { - { - "ibhagwan/fzf-lua", - branch = "main", - keys = { - { - "b", - function() - require("fzf-lua").buffers() - end, - desc = "fzf-lua by [G]rep", - }, - { - "g", - function() - require("fzf-lua").live_grep() - end, - desc = "fzf-lua by [G]rep", - }, - { - "f", - function() - require("fzf-lua").files() - end, - desc = "fzf-lua [F]iles", - }, - { - "", - function() - require("fzf-lua").global() - end, - desc = "fzf-lua global picker", - }, - { - "d", - function() - require("fzf-lua").diagnostics() - end, - desc = "fzf-lua [D]iagnostics", - }, - { - "r", - function() - require("fzf-lua").resume() - end, - desc = "fzf-lua [R]esume", - }, - { - "gc", - function() - require("fzf-lua").git_bcommits() - end, - mode = "n", - desc = "[G]it buffer [C]commits", - }, - { - "gc", - function() - require("fzf-lua").git_bcommits_range() - end, - mode = "v", - desc = "[G]it [C]commits for selected range", - }, - { - "gC", - function() - require("fzf-lua").git_commits() - end, - desc = "[G]it (all) [C]commits", - }, - { - "gb", - function() - require("fzf-lua").git_branches() - end, - desc = "[G]it [B]ranches", - }, - { - "gs", - function() - require("fzf-lua").git_status() - end, - desc = "[G]it [S]tatus", - }, - { - "gS", - function() - require("fzf-lua").git_stash() - end, - desc = "[G]it [S]tash", - }, - }, - config = function() - local fzflua = require("fzf-lua") - fzflua.setup({ - keymap = { - builtin = { - true, - [""] = "toggle-preview", - }, - }, - grep = { - hidden = true, - RIPGREP_CONFIG_PATH = "~/.config/ripgrep/ripgreprc", - }, - lsp = { - includeDeclaration = false, - }, - actions = { - files = { - true, - ["ctrl-x"] = fzflua.actions.file_split, - }, - }, - }) - vim.api.nvim_create_autocmd("LspAttach", { - callback = function(event) - local bnmap = function(keys, func, desc) - vim.keymap.set( - "n", - keys, - func, - { buffer = event.buf, desc = "LSP: " .. desc } - ) - end - bnmap("gd", fzflua.lsp_definitions, "[G]oto [D]efinition") - bnmap("gvd", function() - fzflua.lsp_definitions({ jump1_action = fzflua.actions.file_vsplit }) - end, "[G]oto in a [V]ertical split to [D]efinition") - bnmap("gxd", function() - fzflua.lsp_definitions({ jump1_action = fzflua.actions.file_split }) - end, "[G]oto in a [X]horizontal split to [D]efinition") - bnmap("gtd", function() - fzflua.lsp_definitions({ - jump1_action = fzflua.actions.file_tabedit, - }) - end, "[G]oto in a [T]ab to [D]efinition") - bnmap("D", fzflua.lsp_typedefs, "Type [D]efinition") - bnmap("vD", function() - fzflua.lsp_typedefs({ jump1_action = fzflua.actions.file_vsplit }) - end, "Open in a [V]ertical split Type [D]efinition") - bnmap("xD", function() - fzflua.lsp_typedefs({ jump1_action = fzflua.actions.file_split }) - end, "Open in a [X]horizontal split Type [D]efinition") - bnmap("tD", function() - fzflua.lsp_typedefs({ jump1_action = fzflua.actions.file_tabedit }) - end, "Open in a [T]ab Type [D]efinition") - bnmap("gri", fzflua.lsp_implementations, "[G]oto [I]mplementation") - bnmap("grvi", function() - fzflua.lsp_implementations({ - jump1_action = fzflua.actions.file_vsplit, - }) - end, "[G]oto in a [V]ertical split to [I]mplementation") - bnmap("grxi", function() - fzflua.lsp_implementations({ - jump1_action = fzflua.actions.file_split, - }) - end, "[G]oto in a [X]horizontal split to [I]mplementation") - bnmap("grti", function() - fzflua.lsp_implementations({ - jump1_action = fzflua.actions.file_tabedit, - }) - end, "[G]oto in a [T]ab to [I]mplementation") - bnmap("grr", fzflua.lsp_references, "[G]oto [R]eferences") - bnmap("ic", fzflua.lsp_incoming_calls, "[I]ncoming [C]alls") - bnmap("oc", fzflua.lsp_outgoing_calls, "[O]utgoing [C]alls") - bnmap("gO", fzflua.lsp_document_symbols, "d[O]ocument symbols") - bnmap( - "ws", - fzflua.lsp_live_workspace_symbols, - "[W]orkspace [S]ymbols" - ) - bnmap( - "wd", - fzflua.diagnostics_workspace, - "[W]orkspace [D]iagnostics" - ) - end, - }) - fzflua.register_ui_select() - end, - }, -} diff --git a/home/.config/nvim/lua/custom/plugins/ts.lua b/home/.config/nvim/lua/custom/plugins/ts.lua deleted file mode 100644 index 99c9688..0000000 --- a/home/.config/nvim/lua/custom/plugins/ts.lua +++ /dev/null @@ -1,153 +0,0 @@ -return { - { - "aaronik/treewalker.nvim", - keys = { - { - "", - "Treewalker Up", - mode = { "n", "v" }, - silent = true, - desc = "Moves up to the previous neighbor node", - }, - { - "", - "Treewalker Down", - mode = { "n", "v" }, - silent = true, - desc = "Moves up to the next neighbor node", - }, - { - "", - "Treewalker Left", - mode = { "n", "v" }, - silent = true, - desc = "Moves to the first ancestor node that's on a different line from the current node", - }, - { - "", - "Treewalker Right", - mode = { "n", "v" }, - silent = true, - desc = "Moves to the next node down that's indented further than the current node", - }, - { - "", - "Treewalker SwapUp", - silent = true, - desc = "Swaps the highest node on the line upwards in the document", - }, - { - "", - "Treewalker SwapDown", - silent = true, - desc = "Swaps the biggest node on the line downward in the document", - }, - { - "", - "Treewalker SwapLeft", - silent = true, - desc = "Swap the node under the cursor with its previous neighbor", - }, - { - "", - "Treewalker SwapRight", - silent = true, - desc = "Swap the node under the cursor with its next neighbor", - }, - }, - opts = {}, - }, - { - "nvim-treesitter/nvim-treesitter", - branch = "main", - lazy = false, - dependencies = { - { - "LiadOz/nvim-dap-repl-highlights", - opts = {}, - }, - }, - build = ":TSUpdate", - config = function() - require("nvim-treesitter").install({ - "awk", - "bash", - "c", - "cmake", - "comment", - "cpp", - "css", - "csv", - "diff", - "dockerfile", - "dap_repl", - "doxygen", - "editorconfig", - "fortran", - "git_config", - "git_rebase", - "gitattributes", - "gitcommit", - "gitignore", - "groovy", - "gpg", - "hlsplaylist", - "html", - "http", - "ini", - "javascript", - "jq", - "jsdoc", - "json", - "just", - "llvm", - "lua", - "luadoc", - "luap", - "make", - "markdown", - "markdown_inline", - "query", - "passwd", - "printf", - "python", - "regex", - "readline", - "requirements", - "rust", - "sql", - "ssh_config", - "strace", - "sxhkdrc", - "tablegen", - "tmux", - "todotxt", - "toml", - "typescript", - "vim", - "vimdoc", - "xcompose", - "xml", - "xresources", - "yaml", - }) - end, - }, - "RRethy/nvim-treesitter-endwise", - { "nvim-treesitter/nvim-treesitter-context", opts = {} }, - { - "JoosepAlviste/nvim-ts-context-commentstring", - config = function() - require("ts_context_commentstring").setup({ - enable_autocmd = false, - }) - local get_option = vim.filetype.get_option - - vim.filetype.get_option = function(filetype, option) - return option == "commentstring" - and require("ts_context_commentstring.internal").calculate_commentstring() - or get_option(filetype, option) - end - end, - }, -} diff --git a/home/.config/nvim/lua/custom/plugins/ui.lua b/home/.config/nvim/lua/custom/plugins/ui.lua deleted file mode 100644 index 6ea0c97..0000000 --- a/home/.config/nvim/lua/custom/plugins/ui.lua +++ /dev/null @@ -1,83 +0,0 @@ -return { - { - "ellisonleao/gruvbox.nvim", - priority = 1000, - config = function() - require("gruvbox").setup({}) - vim.o.background = "dark" - vim.cmd([[colorscheme gruvbox]]) - end, - }, - { - "saghen/blink.indent", - --- @module 'blink.indent' - --- @type blink.indent.Config - opts = { - scope = { - highlights = { - "BlinkIndentOrange", - "BlinkIndentViolet", - "BlinkIndentBlue", - "BlinkIndentRed", - "BlinkIndentCyan", - "BlinkIndentYellow", - "BlinkIndentGreen", - }, - underline = { - enabled = true, - highlights = { - "BlinkIndentOrangeUnderline", - "BlinkIndentVioletUnderline", - "BlinkIndentBlueUnderline", - "BlinkIndentRedUnderline", - "BlinkIndentCyanUnderline", - "BlinkIndentYellowUnderline", - "BlinkIndentGreenUnderline", - }, - }, - }, - }, - }, - { - "nvim-lualine/lualine.nvim", - opts = { - options = { - icons_enabled = false, - theme = "gruvbox_dark", - component_separators = "", - section_separators = "|", - disabled_filetypes = { - winbar = { - "dap-view", - "dap-repl", - "dap-view-term", - }, - }, - }, - sections = { - lualine_a = { "filetype", { "filename", path = 1 } }, - lualine_b = { "%l/%L:%c:%o" }, - lualine_c = { "diff" }, - lualine_x = { "searchcount", "selectioncount" }, - lualine_y = { "overseer", "copilot" }, - lualine_z = { "diagnostics" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - }, - dependencies = { - "AndreM222/copilot-lualine", - }, - }, - { - "jake-stewart/auto-cmdheight.nvim", - lazy = false, - opts = {}, - }, -} -- cgit v1.2.3-70-g09d2