diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json new file mode 100644 index 00000000..ba6c2051 --- /dev/null +++ b/.config/nvim/lazyvim.json @@ -0,0 +1,31 @@ +{ + "extras": [ + "lazyvim.plugins.extras.coding.yanky", + "lazyvim.plugins.extras.dap.core", + "lazyvim.plugins.extras.dap.nlua", + "lazyvim.plugins.extras.editor.symbols-outline", + "lazyvim.plugins.extras.formatting.black", + "lazyvim.plugins.extras.formatting.prettier", + "lazyvim.plugins.extras.lang.docker", + "lazyvim.plugins.extras.lang.go", + "lazyvim.plugins.extras.lang.java", + "lazyvim.plugins.extras.lang.json", + "lazyvim.plugins.extras.lang.omnisharp", + "lazyvim.plugins.extras.lang.python", + "lazyvim.plugins.extras.lang.rust", + "lazyvim.plugins.extras.lang.tailwind", + "lazyvim.plugins.extras.lang.typescript", + "lazyvim.plugins.extras.lang.yaml", + "lazyvim.plugins.extras.linting.eslint", + "lazyvim.plugins.extras.test.core", + "lazyvim.plugins.extras.ui.alpha", + "lazyvim.plugins.extras.util.dot", + "lazyvim.plugins.extras.util.project", + "lazyvim.plugins.extras.vscode", + "plugins.extras.alpha" + ], + "news": { + "NEWS.md": "2123" + }, + "version": 2 +} \ No newline at end of file diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 2f0e618b..5980eb5e 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -2,66 +2,66 @@ -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here local function map(mode, lhs, rhs, opts) - local keys = require("lazy.core.handler").handlers.keys - ---@cast keys LazyKeysHandler - -- do not create the keymap if a lazy keys handler exists - if not keys.active[keys.parse({ lhs, mode = mode }).id] then - opts = opts or {} - opts.silent = opts.silent ~= false - if opts.remap and not vim.g.vscode then - opts.remap = nil - end - vim.keymap.set(mode, lhs, rhs, opts) + local keys = require("lazy.core.handler").handlers.keys + ---@cast keys LazyKeysHandler + -- do not create the keymap if a lazy keys handler exists + if not keys.active[keys.parse({ lhs, mode = mode }).id] then + opts = opts or {} + opts.silent = opts.silent ~= false + if opts.remap and not vim.g.vscode then + opts.remap = nil end + vim.keymap.set(mode, lhs, rhs, opts) + end end map( - "n", - "xs", - ":FloatermNew --disposable --name=duaroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", - { desc = "Workspace Size (root dir)" } + "n", + "xs", + ":FloatermNew --disposable --name=duaroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", + { desc = "Workspace Size (root dir)" } ) map( - "n", - "xS", - ":FloatermNew --disposable --name=duabuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", - { desc = "Workspace Size (cwd)" } + "n", + "xS", + ":FloatermNew --disposable --name=duabuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", + { desc = "Workspace Size (cwd)" } ) map( - "n", - "fx", - ":FloatermNew --disposable --name=xplrroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", - { desc = "Xplr (root dir)" } + "n", + "fx", + ":FloatermNew --disposable --name=xplrroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", + { desc = "Xplr (root dir)" } ) map( - "n", - "fX", - ":FloatermNew --disposable --name=xplrbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", - { desc = "Xplr (cwd)" } + "n", + "fX", + ":FloatermNew --disposable --name=xplrbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", + { desc = "Xplr (cwd)" } ) map( - "n", - "gg", - ":FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", - { desc = "Lazygit (root dir)" } + "n", + "gg", + ":FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", + { desc = "Lazygit (root dir)" } ) map( - "n", - "gG", - ":FloatermNew --disposable --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", - { desc = "Lazygit (cwd)" } + "n", + "gG", + ":FloatermNew --disposable --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", + { desc = "Lazygit (cwd)" } ) map( - "n", - "fd", - ":FloatermNew --disposable --name=lazydocker --opener=edit --titleposition=center --height=0.85 --width=0.85 lazydocker", - { desc = "Lazydocker" } + "n", + "fd", + ":FloatermNew --disposable --name=lazydocker --opener=edit --titleposition=center --height=0.85 --width=0.85 lazydocker", + { desc = "Lazydocker" } ) map("n", "T", ":Telescope floaterm", { desc = "Terminals" }) @@ -76,21 +76,21 @@ map("n", "si", ":Telescope import", { desc = "Imports" }) map("n", "sI", ":Gitignore", { desc = "Gitignore" }) +map("n", "cC", ":ConformInfo", { desc = "Conform Info" }) + map("n", "um", ":MarkdownPreviewToggle", { desc = "Toggle Markdown Preview" }) -map("n", "cn", ":NullLsInfo", { desc = "NullLs Info" }) - map( - "n", - "ft", - ":FloatermNew --name=termroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", - { desc = "New Terminal (root dir)" } + "n", + "ft", + ":FloatermNew --name=termroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", + { desc = "New Terminal (root dir)" } ) map( - "n", - "fT", - ":FloatermNew --name=termcwd --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", - { desc = "New Terminal (cwd)" } + "n", + "fT", + ":FloatermNew --name=termcwd --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", + { desc = "New Terminal (cwd)" } ) map("n", "", ":FloatermToggle", { desc = "Toggle Terminal" }) map("t", "", ":FloatermToggle", { desc = "Toggle Terminal", nowait = true }) @@ -104,51 +104,51 @@ vim.keymap.set("i", "", "PickColorInsert", { noremap = true, silen vim.keymap.set("n", "ccc", "CompilerOpen", { noremap = true, silent = true, desc = "Open Compiler" }) vim.keymap.set("n", "ccR", function() - vim.cmd("CompilerStop") - vim.cmd("CompilerRedo") + vim.cmd("CompilerStop") + vim.cmd("CompilerRedo") end, { noremap = true, silent = true, desc = "Redo Compiler" }) -- Toggle compiler results vim.keymap.set( - "n", - "ccr", - "CompilerToggleResults", - { noremap = true, silent = true, desc = "Toggle Compiler Results" } + "n", + "ccr", + "CompilerToggleResults", + { noremap = true, silent = true, desc = "Toggle Compiler Results" } ) vim.api.nvim_set_keymap( - "n", - "cps", - "lua require('package-info').show({ force = true })", - { silent = true, noremap = true, desc = "Show Package Versions" } + "n", + "cps", + "lua require('package-info').show({ force = true })", + { silent = true, noremap = true, desc = "Show Package Versions" } ) vim.api.nvim_set_keymap( - "n", - "cpu", - "lua require('package-info').update()", - { silent = true, noremap = true, desc = "Update Package" } + "n", + "cpu", + "lua require('package-info').update()", + { silent = true, noremap = true, desc = "Update Package" } ) vim.api.nvim_set_keymap( - "n", - "cpr", - "lua require('package-info').delete()", - { silent = true, noremap = true, desc = "Remove Package" } + "n", + "cpr", + "lua require('package-info').delete()", + { silent = true, noremap = true, desc = "Remove Package" } ) vim.api.nvim_set_keymap( - "n", - "cpv", - "lua require('package-info').change_version()", - { silent = true, noremap = true, desc = "Change Package Version" } + "n", + "cpv", + "lua require('package-info').change_version()", + { silent = true, noremap = true, desc = "Change Package Version" } ) vim.api.nvim_set_keymap( - "n", - "cpn", - "lua require('package-info').install()", - { silent = true, noremap = true, desc = "Install New Dependency" } + "n", + "cpn", + "lua require('package-info').install()", + { silent = true, noremap = true, desc = "Install New Dependency" } ) vim.keymap.set("n", "", "zz") @@ -160,75 +160,75 @@ vim.keymap.set("n", "n", "nzzzv") vim.keymap.set("n", "N", "Nzzzv") local function goto_prev_node() - local ts_utils = require("nvim-treesitter.ts_utils") - local node = ts_utils.get_node_at_cursor() - if not node then - return + local ts_utils = require("nvim-treesitter.ts_utils") + local node = ts_utils.get_node_at_cursor() + if not node then + return + end + local dest_node = ts_utils.get_previous_node(node, true, true) + if not dest_node then + local cur_node = node:parent() + while cur_node do + dest_node = ts_utils.get_previous_node(cur_node, false, false) + if dest_node then + break + end + cur_node = cur_node:parent() end - local dest_node = ts_utils.get_previous_node(node, true, true) - if not dest_node then - local cur_node = node:parent() - while cur_node do - dest_node = ts_utils.get_previous_node(cur_node, false, false) - if dest_node then - break - end - cur_node = cur_node:parent() - end - end - if not dest_node then - return - end - ts_utils.goto_node(dest_node) + end + if not dest_node then + return + end + ts_utils.goto_node(dest_node) end local function goto_next_node() - local ts_utils = require("nvim-treesitter.ts_utils") - local node = ts_utils.get_node_at_cursor() - if not node then - return + local ts_utils = require("nvim-treesitter.ts_utils") + local node = ts_utils.get_node_at_cursor() + if not node then + return + end + local dest_node = ts_utils.get_next_node(node, true, true) + if not dest_node then + local cur_node = node:parent() + while cur_node do + dest_node = ts_utils.get_next_node(cur_node, false, false) + if dest_node then + break + end + cur_node = cur_node:parent() end - local dest_node = ts_utils.get_next_node(node, true, true) - if not dest_node then - local cur_node = node:parent() - while cur_node do - dest_node = ts_utils.get_next_node(cur_node, false, false) - if dest_node then - break - end - cur_node = cur_node:parent() - end - end - if not dest_node then - return - end - ts_utils.goto_node(dest_node) + end + if not dest_node then + return + end + ts_utils.goto_node(dest_node) end local function goto_parent_node() - local ts_utils = require("nvim-treesitter.ts_utils") - local node = ts_utils.get_node_at_cursor() - if not node then - return - end - local dest_node = node:parent() - if not dest_node then - return - end - ts_utils.goto_node(dest_node) + local ts_utils = require("nvim-treesitter.ts_utils") + local node = ts_utils.get_node_at_cursor() + if not node then + return + end + local dest_node = node:parent() + if not dest_node then + return + end + ts_utils.goto_node(dest_node) end local function goto_child_node() - local ts_utils = require("nvim-treesitter.ts_utils") - local node = ts_utils.get_node_at_cursor() - if not node then - return - end - local dest_node = ts_utils.get_named_children(node)[1] - if not dest_node then - return - end - ts_utils.goto_node(dest_node) + local ts_utils = require("nvim-treesitter.ts_utils") + local node = ts_utils.get_node_at_cursor() + if not node then + return + end + local dest_node = ts_utils.get_named_children(node)[1] + if not dest_node then + return + end + ts_utils.goto_node(dest_node) end local keyopts = { noremap = true, silent = true } diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index aa743d3d..4b70a2fd 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -11,24 +11,6 @@ require("lazy").setup({ spec = { -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import any extras modules here - { import = "lazyvim.plugins.extras.lang.typescript" }, - { import = "lazyvim.plugins.extras.lang.json" }, - { import = "lazyvim.plugins.extras.dap.core" }, - { import = "lazyvim.plugins.extras.test.core" }, - { import = "lazyvim.plugins.extras.lang.python" }, - { import = "lazyvim.plugins.extras.lang.docker" }, - { import = "lazyvim.plugins.extras.lang.go" }, - { import = "lazyvim.plugins.extras.lang.rust" }, - { import = "lazyvim.plugins.extras.lang.tailwind" }, - { import = "lazyvim.plugins.extras.linting.eslint" }, - { import = "lazyvim.plugins.extras.formatting.prettier" }, - -- { import = "lazyvim.plugins.extras.coding.copilot" }, - { import = "lazyvim.plugins.extras.util.dot" }, - { import = "lazyvim.plugins.extras.lang.yaml" }, - { import = "lazyvim.plugins.extras.coding.yanky" }, - { import = "lazyvim.plugins.extras.util.project" }, - { import = "lazyvim.plugins.extras.lang.omnisharp" }, { import = "plugins" }, }, defaults = { diff --git a/.config/nvim/lua/plugins/autotag.lua b/.config/nvim/lua/plugins/autotag.lua index 0d9efa2a..135a7f54 100644 --- a/.config/nvim/lua/plugins/autotag.lua +++ b/.config/nvim/lua/plugins/autotag.lua @@ -1,9 +1,7 @@ return { - { - "windwp/nvim-ts-autotag", - event = "InsertEnter", - config = function() - require("nvim-ts-autotag").setup() - end, - }, + { + "windwp/nvim-ts-autotag", + event = "InsertEnter", + opts = {}, + }, } diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua new file mode 100644 index 00000000..261522c9 --- /dev/null +++ b/.config/nvim/lua/plugins/conform.lua @@ -0,0 +1,58 @@ +return { + { + "stevearc/conform.nvim", + dependencies = { "mason.nvim" }, + lazy = true, + cmd = "ConformInfo", + keys = { + { + "cF", + function() + require("conform").format({ formatters = { "injected" } }) + end, + mode = { "n", "v" }, + desc = "Format Injected Langs", + }, + { + "cC", + ":ConformInfo", + mode = { "n", "v" }, + desc = "Conform Info", + }, + }, + opts = { + formatters_by_ft = { + lua = { "stylua" }, + fish = { "fish_indent" }, + sh = { "shfmt", "shellharden" }, + python = { "isort", "black" }, + bash = { "shfmt", "shellharden" }, + javascript = { { "prettierd", "prettier", "rustywind" } }, + javascriptreact = { { "prettierd", "prettier", "rustywind" } }, + typescript = { { "prettierd", "prettier", "rustywind" } }, + typescriptreact = { { "prettierd", "prettier", "rustywind" } }, + vue = { { "prettierd", "prettier", "rustywind" } }, + html = { { "prettierd", "prettier", "rustywind" } }, + rust = { "rusfmt" }, + go = { "gofumpt", "goimports" }, + }, + -- LazyVim will merge the options you set here with builtin formatters. + -- You can also define any custom formatters here. + ---@type table + formatters = { + injected = { options = { ignore_errors = true } }, + -- -- Example of using dprint only when a dprint.json file is present + -- dprint = { + -- condition = function(ctx) + -- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1] + -- end, + -- }, + taplo = { + condition = function(ctx) + return vim.fs.find({ "Cargo.toml" }, { path = ctx.filename, upward = true })[1] + end, + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/context.lua b/.config/nvim/lua/plugins/context.lua index 9713524d..ffd8bad9 100644 --- a/.config/nvim/lua/plugins/context.lua +++ b/.config/nvim/lua/plugins/context.lua @@ -1,9 +1,8 @@ return { - { - "nvim-treesitter/nvim-treesitter-context", - event = "BufReadPost", - config = function() - require("treesitter-context").setup() - end, - }, + { + "nvim-treesitter/nvim-treesitter-context", + event = "LazyFile", + enabled = true, + opts = { mode = "cursor" }, + }, } diff --git a/.config/nvim/lua/plugins/dap.lua b/.config/nvim/lua/plugins/dap.lua deleted file mode 100644 index 8cabe48c..00000000 --- a/.config/nvim/lua/plugins/dap.lua +++ /dev/null @@ -1,104 +0,0 @@ -return { - { - "mfussenegger/nvim-dap", - - dependencies = { - - -- fancy UI for the debugger - { - "rcarriga/nvim-dap-ui", - -- stylua: ignore - keys = { - { "du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, - { "de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} }, - }, - opts = {}, - config = function(_, opts) - local dap = require("dap") - local dapui = require("dapui") - dapui.setup(opts) - dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open({}) - end - dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close({}) - end - dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close({}) - end - end, - }, - - -- virtual text for the debugger - { - "theHamsta/nvim-dap-virtual-text", - opts = {}, - }, - - -- which key integration - { - "folke/which-key.nvim", - optional = true, - opts = { - defaults = { - ["d"] = { name = "+debug" }, - ["da"] = { name = "+adapters" }, - }, - }, - }, - - -- mason.nvim integration - { - "jay-babu/mason-nvim-dap.nvim", - dependencies = "mason.nvim", - cmd = { "DapInstall", "DapUninstall" }, - opts = { - -- Makes a best effort to setup the various debuggers with - -- reasonable debug configurations - automatic_installation = true, - - -- You can provide additional configuration to the handlers, - -- see mason-nvim-dap README for more information - handlers = {}, - - -- You'll need to check that you have the required things installed - -- online, please don't ask me how to install them :) - ensure_installed = { - -- Update this to ensure that you have the debuggers for the langs you want - }, - }, - }, - }, - - -- stylua: ignore - keys = { - { "dc", function() require("dap").continue() end, desc = "Continue" }, - { "dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" }, - { "dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" }, - { "di", function() require("dap").step_into() end, desc = "Step Into" }, - { "dj", function() require("dap").down() end, desc = "Down" }, - { "dk", function() require("dap").up() end, desc = "Up" }, - { "dl", function() require("dap").run_last() end, desc = "Run Last" }, - { "do", function() require("dap").step_out() end, desc = "Step Out" }, - { "dO", function() require("dap").step_over() end, desc = "Step Over" }, - { "dp", function() require("dap").pause() end, desc = "Pause" }, - { "dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" }, - { "ds", function() require("dap").session() end, desc = "Session" }, - { "dt", function() require("dap").terminate() end, desc = "Terminate" }, - { "dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" }, - }, - - config = function() - local Config = require("lazyvim.config") - vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" }) - - for name, sign in pairs(Config.icons.dap) do - sign = type(sign) == "table" and sign or { sign } - vim.fn.sign_define( - "Dap" .. name, - { text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] } - ) - end - end, - }, -} diff --git a/.config/nvim/lua/plugins/dashboard.lua b/.config/nvim/lua/plugins/dashboard.lua new file mode 100644 index 00000000..c53bafc0 --- /dev/null +++ b/.config/nvim/lua/plugins/dashboard.lua @@ -0,0 +1,75 @@ +return { + { + "glepnir/dashboard-nvim", + event = "VimEnter", + opts = function() + local logo = [[ +  + ███████████ █████ ██ + ███████████ █████  + ████████████████ ███████████ ███ ███████ + ████████████████ ████████████ █████ ██████████████ + ██████████████ █████████████ █████ █████ ████ █████ + ██████████████████████████████████ █████ █████ ████ █████ + ██████ ███ █████████████████ ████ █████ █████ ████ ██████ + ]] + -- local logo = [[ + -- ▄ ▄ + -- ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ + -- █ ▄ █▄█ ▄▄▄ █ █▄█ █ █ + -- ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █ + -- ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ + -- █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄ + -- ▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █ + -- █▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █ + -- █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█ + -- ]] + + logo = string.rep("\n", 8) .. logo .. "\n\n" + + local opts = { + theme = "doom", + hide = { + -- this is taken care of by lualine + -- enabling this messes up the actual laststatus setting after loading a file + statusline = false, + }, + config = { + header = vim.split(logo, "\n"), + center = { + { action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" }, + { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" }, + { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" }, + { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" }, + { action = "e $MYVIMRC", desc = " Config", icon = " ", key = "c" }, + { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, + { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, + { action = "qa", desc = " Quit", icon = " ", key = "q" }, + }, + footer = function() + local stats = require("lazy").stats() + local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) + return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" } + end, + }, + } + + for _, button in ipairs(opts.config.center) do + button.desc = button.desc .. string.rep(" ", 43 - #button.desc) + end + + -- close Lazy and re-open when the dashboard is ready + if vim.o.filetype == "lazy" then + vim.cmd.close() + vim.api.nvim_create_autocmd("User", { + pattern = "DashboardLoaded", + callback = function() + require("lazy").show() + end, + }) + end + + return opts + end, + }, +} diff --git a/.config/nvim/lua/plugins/alpha.lua b/.config/nvim/lua/plugins/extras/alpha.lua similarity index 100% rename from .config/nvim/lua/plugins/alpha.lua rename to .config/nvim/lua/plugins/extras/alpha.lua diff --git a/.config/nvim/lua/plugins/extras/dap.lua b/.config/nvim/lua/plugins/extras/dap.lua new file mode 100644 index 00000000..0050c4d9 --- /dev/null +++ b/.config/nvim/lua/plugins/extras/dap.lua @@ -0,0 +1,103 @@ +return { + { + "mfussenegger/nvim-dap", + + dependencies = { + + -- fancy UI for the debugger + { + "rcarriga/nvim-dap-ui", + -- stylua: ignore + keys = { + { "du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, + { "de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} }, + }, + opts = {}, + config = function(_, opts) + local dap = require("dap") + local dapui = require("dapui") + dapui.setup(opts) + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open({}) + end + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close({}) + end + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close({}) + end + end, + }, + + -- virtual text for the debugger + { + "theHamsta/nvim-dap-virtual-text", + opts = {}, + }, + + -- which key integration + { + "folke/which-key.nvim", + optional = true, + opts = { + defaults = { + ["d"] = { name = "+debug" }, + }, + }, + }, + + -- mason.nvim integration + { + "jay-babu/mason-nvim-dap.nvim", + dependencies = "mason.nvim", + cmd = { "DapInstall", "DapUninstall" }, + opts = { + -- Makes a best effort to setup the various debuggers with + -- reasonable debug configurations + automatic_installation = true, + + -- You can provide additional configuration to the handlers, + -- see mason-nvim-dap README for more information + handlers = {}, + + -- You'll need to check that you have the required things installed + -- online, please don't ask me how to install them :) + ensure_installed = { + -- Update this to ensure that you have the debuggers for the langs you want + }, + }, + }, + }, + + -- stylua: ignore + keys = { + { "dc", function() require("dap").continue() end, desc = "Continue" }, + { "dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" }, + { "dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" }, + { "di", function() require("dap").step_into() end, desc = "Step Into" }, + { "dj", function() require("dap").down() end, desc = "Down" }, + { "dk", function() require("dap").up() end, desc = "Up" }, + { "dl", function() require("dap").run_last() end, desc = "Run Last" }, + { "do", function() require("dap").step_out() end, desc = "Step Out" }, + { "dO", function() require("dap").step_over() end, desc = "Step Over" }, + { "dp", function() require("dap").pause() end, desc = "Pause" }, + { "dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" }, + { "ds", function() require("dap").session() end, desc = "Session" }, + { "dt", function() require("dap").terminate() end, desc = "Terminate" }, + { "dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" }, + }, + + config = function() + local Config = require("lazyvim.config") + vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" }) + + for name, sign in pairs(Config.icons.dap) do + sign = type(sign) == "table" and sign or { sign } + vim.fn.sign_define( + "Dap" .. name, + { text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] } + ) + end + end, + }, +} diff --git a/.config/nvim/lua/plugins/lint.lua b/.config/nvim/lua/plugins/lint.lua new file mode 100644 index 00000000..0dd5f8ee --- /dev/null +++ b/.config/nvim/lua/plugins/lint.lua @@ -0,0 +1,30 @@ +return { + { + "mfussenegger/nvim-lint", + event = "LazyFile", + opts = { + -- Event to trigger linters + events = { "BufWritePost", "BufReadPost", "InsertLeave" }, + linters_by_ft = { + fish = { "fish" }, + markdown = { "markdownlint" }, + python = { "pylint" }, + yaml = { "yamllint" }, + dockerfile = { "hadolint" }, + }, + -- LazyVim extension to easily override linter options + -- or add custom linters. + ---@type table + linters = { + -- -- Example of using selene only when a selene.toml file is present + -- selene = { + -- -- `condition` is another LazyVim extension that allows you to + -- -- dynamically enable/disable linters based on the context. + -- condition = function(ctx) + -- return vim.fs.find({ "selene.toml" }, { path = ctx.filename, upward = true })[1] + -- end, + -- }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/live-server.lua b/.config/nvim/lua/plugins/live-server.lua index a0f6c6ff..5f1d1a69 100644 --- a/.config/nvim/lua/plugins/live-server.lua +++ b/.config/nvim/lua/plugins/live-server.lua @@ -1,12 +1,12 @@ return { - { - "aurum77/live-server.nvim", - build = function() - require("live_server.util").install() - end, - cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" }, - keys = { - { "cs", "LiveServer", desc = "Toggle LiveServer" }, - }, + { + "aurum77/live-server.nvim", + build = function() + require("live_server.util").install() + end, + cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" }, + keys = { + { "cL", "LiveServer", desc = "Toggle LiveServer" }, }, + }, } diff --git a/.config/nvim/lua/plugins/lsp-lens.lua.bak b/.config/nvim/lua/plugins/lsp-lens.lua.bak new file mode 100644 index 00000000..1b61c7ae --- /dev/null +++ b/.config/nvim/lua/plugins/lsp-lens.lua.bak @@ -0,0 +1,9 @@ +return { + { + "VidocqH/lsp-lens.nvim", + event = "BufReadPost", + config = function() + require("lsp-lens").setup() + end, + }, +} diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 8f214b09..c7c29990 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -1,94 +1,92 @@ return { - { - "neovim/nvim-lspconfig", - init = function() - local keys = require("lazyvim.plugins.lsp.keymaps").get() - keys[#keys + 1] = { "gd", "Glance definitions", desc = "Goto definition" } - keys[#keys + 1] = { "gr", "Glance references", desc = "References" } - keys[#keys + 1] = { "gy", "Glance type_definitions", desc = "Goto t[y]pe definitions" } - keys[#keys + 1] = { "gI", "Glance implementations", desc = "Goto implementations" } - end, - opts = { - -- options for vim.diagnostic.config() - diagnostics = { - underline = true, - update_in_insert = false, - virtual_text = { - spacing = 4, - source = "if_many", - prefix = "●", - -- this will set set the prefix to a function that returns the diagnostics icon based on the severity - -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported - -- prefix = "icons", - float = { - border = { - { "┌", "FloatBorder" }, - { "─", "FloatBorder" }, - { "┐", "FloatBorder" }, - { "│", "FloatBorder" }, - { "┘", "FloatBorder" }, - { "─", "FloatBorder" }, - { "└", "FloatBorder" }, - { "│", "FloatBorder" }, - }, - }, - }, - severity_sort = true, - }, - -- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0 - -- Be aware that you also will need to properly configure your LSP server to - -- provide the inlay hints. - inlay_hints = { - enabled = false, - }, - -- add any global capabilities here - capabilities = {}, - -- Automatically format on save - autoformat = true, - -- Enable this to show formatters used in a notification - -- Useful for debugging formatter issues - format_notify = false, - -- options for vim.lsp.buf.format - -- `bufnr` and `filter` is handled by the LazyVim formatter, - -- but can be also overridden when specified - format = { - formatting_options = nil, - timeout_ms = nil, - }, - -- LSP Server Settings - ---@type lspconfig.options - servers = { - jsonls = {}, - lua_ls = { - -- mason = false, -- set to false if you don't want this server to be installed with mason - -- Use this to add any additional keymaps - -- for specific lsp servers - ---@type LazyKeys[] - -- keys = {}, - settings = { - Lua = { - workspace = { - checkThirdParty = false, - }, - completion = { - callSnippet = "Replace", - }, - }, - }, - }, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - -- tsserver = function(_, opts) - -- require("typescript").setup({ server = opts }) - -- return true - -- end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, + { + "neovim/nvim-lspconfig", + init = function() + local keys = require("lazyvim.plugins.lsp.keymaps").get() + keys[#keys + 1] = { "gd", "Glance definitions", desc = "Goto definition" } + keys[#keys + 1] = { "gr", "Glance references", desc = "References" } + keys[#keys + 1] = { "gy", "Glance type_definitions", desc = "Goto t[y]pe definitions" } + keys[#keys + 1] = { "gI", "Glance implementations", desc = "Goto implementations" } + end, + opts = { + -- options for vim.diagnostic.config() + diagnostics = { + underline = true, + update_in_insert = false, + virtual_text = { + spacing = 4, + source = "if_many", + prefix = "●", + -- this will set set the prefix to a function that returns the diagnostics icon based on the severity + -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported + -- prefix = "icons", + float = { + border = { + { "┌", "FloatBorder" }, + { "─", "FloatBorder" }, + { "┐", "FloatBorder" }, + { "│", "FloatBorder" }, + { "┘", "FloatBorder" }, + { "─", "FloatBorder" }, + { "└", "FloatBorder" }, + { "│", "FloatBorder" }, }, + }, }, + severity_sort = true, + }, + -- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0 + -- Be aware that you also will need to properly configure your LSP server to + -- provide the inlay hints. + inlay_hints = { + enabled = false, + }, + -- add any global capabilities here + capabilities = {}, + -- Enable this to show formatters used in a notification + -- Useful for debugging formatter issues + format_notify = false, + -- options for vim.lsp.buf.format + -- `bufnr` and `filter` is handled by the LazyVim formatter, + -- but can be also overridden when specified + format = { + formatting_options = nil, + timeout_ms = nil, + }, + -- LSP Server Settings + ---@type lspconfig.options + servers = { + jsonls = {}, + lua_ls = { + -- mason = false, -- set to false if you don't want this server to be installed with mason + -- Use this to add any additional keymaps + -- for specific lsp servers + ---@type LazyKeys[] + -- keys = {}, + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + completion = { + callSnippet = "Replace", + }, + }, + }, + }, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + -- tsserver = function(_, opts) + -- require("typescript").setup({ server = opts }) + -- return true + -- end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, }, + }, } diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 6da61a7e..aa5455b9 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,85 +1,104 @@ return { - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function() - local icons = require("lazyvim.config").icons - local Util = require("lazyvim.util") + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + init = function() + vim.g.lualine_laststatus = vim.o.laststatus + if vim.fn.argc(-1) > 0 then + -- set an empty statusline till lualine loads + vim.o.statusline = " " + else + -- hide the statusline on the starter page + vim.o.laststatus = 0 + end + end, + opts = function() + -- PERF: we don't need this lualine require madness 🤷 + local lualine_require = require("lualine_require") + lualine_require.require = require - return { - options = { - theme = "catppuccin", - globalstatus = true, - disabled_filetypes = { statusline = { "dashboard", "alpha" } }, - component_separators = "", - section_separators = { left = "", right = "" }, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch" }, - lualine_c = { - { - "diagnostics", - symbols = { - error = icons.diagnostics.Error, - warn = icons.diagnostics.Warn, - info = icons.diagnostics.Info, - hint = icons.diagnostics.Hint, - }, - }, - { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, - { "filename", path = 1, symbols = { modified = "  ", readonly = "", unnamed = "" } }, - -- stylua: ignore + local icons = require("lazyvim.config").icons + local Util = require("lazyvim.util") + + vim.o.laststatus = vim.g.lualine_laststatus + + return { + options = { + theme = "catppuccin", + globalstatus = true, + disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } }, + component_separators = "", + section_separators = { left = "", right = "" }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + lualine_c = { + { + "diagnostics", + symbols = { + error = icons.diagnostics.Error, + warn = icons.diagnostics.Warn, + info = icons.diagnostics.Info, + hint = icons.diagnostics.Hint, + }, + }, + { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, + { + function() + return Util.root.pretty_path() + end, + }, +-- stylua: ignore { function() local ok, m = pcall(require, "better_escape") return ok and m.waiting and "✺" or "" end, }, - }, - lualine_x = { + }, + lualine_x = { -- stylua: ignore { function() return require("noice").api.status.command.get() end, cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end, - color = Util.fg("Statement"), + color = Util.ui.fg("Statement"), }, -- stylua: ignore { function() return require("noice").api.status.mode.get() end, cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end, - color = Util.fg("Constant"), + color = Util.ui.fg("Constant"), }, -- stylua: ignore { function() return " " .. require("dap").status() end, cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end, - color = Util.fg("Debug"), + color = Util.ui.fg("Debug"), }, - { - require("lazy.status").updates, - cond = require("lazy.status").has_updates, - color = Util.fg("Special"), - }, - { - "diff", - symbols = { - added = icons.git.added, - modified = icons.git.modified, - removed = icons.git.removed, - }, - }, - }, - - lualine_y = { - { "progress", separator = " ", padding = { left = 1, right = 1 } }, - }, - lualine_z = { - { "location", padding = { left = 1, right = 1 } }, - }, - }, - extensions = { "neo-tree", "lazy" }, - } - end, - }, + { + require("lazy.status").updates, + cond = require("lazy.status").has_updates, + color = Util.ui.fg("Special"), + }, + { + "diff", + symbols = { + added = icons.git.added, + modified = icons.git.modified, + removed = icons.git.removed, + }, + }, + }, + lualine_y = { + { "progress", separator = " ", padding = { left = 1, right = 1 } }, + }, + lualine_z = { + { "location", padding = { left = 1, right = 1 } }, + }, + }, + extensions = { "neo-tree", "lazy" }, + } + end, + }, } diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua index c92ada1c..54236200 100644 --- a/.config/nvim/lua/plugins/mason.lua +++ b/.config/nvim/lua/plugins/mason.lua @@ -1,30 +1,36 @@ return { - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "black", - "prettierd", - "beautysh", - "codespell", - "csharpier", - "css-lsp", - "cssmodules-language-server", - "ktlint", - "hadolint", - "html-lsp", - "rustywind", - "sqlfmt", - "markdownlint", - "marksman", - "markuplint", - "stylua", - "shfmt", - "angular-language-server", - "bash-language-server", - "omnisharp", - "sqlls", - }, - }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "black", + "prettierd", + "codespell", + "csharpier", + "css-lsp", + "cssmodules-language-server", + "ktlint", + "hadolint", + "html-lsp", + "rustywind", + "sqlfmt", + "markdownlint", + "stylua", + "shfmt", + "angular-language-server", + "bash-language-server", + "omnisharp", + "sqlls", + "goimports", + "shellharden", + "codelldb", + "markdownlint", + "pylint", + "gofumpt", + "delve", + "impl", + "gomodifytags", + }, }, + }, } diff --git a/.config/nvim/lua/plugins/neo-tree.lua b/.config/nvim/lua/plugins/neo-tree.lua index 5e2536c3..6634528b 100644 --- a/.config/nvim/lua/plugins/neo-tree.lua +++ b/.config/nvim/lua/plugins/neo-tree.lua @@ -1,116 +1,118 @@ +local Util = require("lazyvim.util") + return { - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - cmd = "Neotree", - keys = { - { - "fe", - function() - require("neo-tree.command").execute({ toggle = true, dir = require("lazyvim.util").get_root() }) - end, - desc = "Explorer NeoTree (root dir)", - }, - { - "fE", - function() - require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() }) - end, - desc = "Explorer NeoTree (cwd)", - }, - { "e", "fe", desc = "Explorer NeoTree (root dir)", remap = true }, - { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, - { - "ge", - function() - require("neo-tree.command").execute({ source = "git_status", toggle = true }) - end, - desc = "Git explorer", - }, - { - "be", - function() - require("neo-tree.command").execute({ source = "buffers", toggle = true }) - end, - desc = "Buffer explorer", - }, - }, - deactivate = function() - vim.cmd([[Neotree close]]) + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + cmd = "Neotree", + keys = { + { + "fe", + function() + require("neo-tree.command").execute({ toggle = true, dir = Util.root() }) end, - init = function() - if vim.fn.argc() == 1 then - local stat = vim.loop.fs_stat(vim.fn.argv(0)) - if stat and stat.type == "directory" then - require("neo-tree") - end - end + desc = "Explorer NeoTree (root dir)", + }, + { + "fE", + function() + require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() }) end, - opts = { - sources = { "filesystem", "git_status", "buffers", "document_symbols" }, - -- source_selector = { - -- winbar = true, - -- statusline = true, - -- }, - open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" }, - enable_git_status = true, - enable_diagnostics = true, - filesystem = { - bind_to_cwd = false, - follow_current_file = { enabled = true }, - use_libuv_file_watcher = true, - }, - window = { - mappings = { - [""] = "none", - ["e"] = "open", - }, - }, - default_component_configs = { - indent = { - with_expanders = true, -- if nil and file nesting is enabled, will enable expanders - expander_collapsed = "", - expander_expanded = "", - expander_highlight = "NeoTreeExpander", - }, - }, - }, - config = function(_, opts) - opts.event_handlers = opts.event_handlers or {} - - local function on_move(data) - local clients = vim.lsp.get_active_clients() - for _, client in ipairs(clients) do - if client:supports_method("workspace/willRenameFiles") then - local resp = client.request_sync("workspace/willRenameFiles", { - files = { - { - oldUri = vim.uri_from_fname(data.source), - newUri = vim.uri_from_fname(data.destination), - }, - }, - }, 1000) - if resp and resp.result ~= nil then - vim.lsp.util.apply_workspace_edit(resp.result, client.offset_encoding) - end - end - end - end - - local events = require("neo-tree.events") - vim.list_extend(opts.event_handlers, { - { event = events.FILE_MOVED, handler = on_move }, - { event = events.FILE_RENAMED, handler = on_move }, - }) - require("neo-tree").setup(opts) - vim.api.nvim_create_autocmd("TermClose", { - pattern = "*lazygit", - callback = function() - if package.loaded["neo-tree.sources.git_status"] then - require("neo-tree.sources.git_status").refresh() - end - end, - }) + desc = "Explorer NeoTree (cwd)", + }, + { "e", "fe", desc = "Explorer NeoTree (root dir)", remap = true }, + { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, + { + "ge", + function() + require("neo-tree.command").execute({ source = "git_status", toggle = true }) end, + desc = "Git explorer", + }, + { + "be", + function() + require("neo-tree.command").execute({ source = "buffers", toggle = true }) + end, + desc = "Buffer explorer", + }, }, + deactivate = function() + vim.cmd([[Neotree close]]) + end, + init = function() + if vim.fn.argc() == 1 then + local stat = vim.loop.fs_stat(vim.fn.argv(0)) + if stat and stat.type == "directory" then + require("neo-tree") + end + end + end, + opts = { + sources = { "filesystem", "git_status", "buffers", "document_symbols" }, + -- source_selector = { + -- winbar = true, + -- statusline = true, + -- }, + open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" }, + enable_git_status = true, + enable_diagnostics = true, + filesystem = { + bind_to_cwd = false, + follow_current_file = { enabled = true }, + use_libuv_file_watcher = true, + }, + window = { + mappings = { + [""] = "none", + ["e"] = "open", + }, + }, + default_component_configs = { + indent = { + with_expanders = true, -- if nil and file nesting is enabled, will enable expanders + expander_collapsed = "", + expander_expanded = "", + expander_highlight = "NeoTreeExpander", + }, + }, + }, + config = function(_, opts) + opts.event_handlers = opts.event_handlers or {} + + local function on_move(data) + local clients = vim.lsp.get_active_clients() + for _, client in ipairs(clients) do + if client:supports_method("workspace/willRenameFiles") then + local resp = client.request_sync("workspace/willRenameFiles", { + files = { + { + oldUri = vim.uri_from_fname(data.source), + newUri = vim.uri_from_fname(data.destination), + }, + }, + }, 1000) + if resp and resp.result ~= nil then + vim.lsp.util.apply_workspace_edit(resp.result, client.offset_encoding) + end + end + end + end + + local events = require("neo-tree.events") + vim.list_extend(opts.event_handlers, { + { event = events.FILE_MOVED, handler = on_move }, + { event = events.FILE_RENAMED, handler = on_move }, + }) + require("neo-tree").setup(opts) + vim.api.nvim_create_autocmd("TermClose", { + pattern = "*lazygit", + callback = function() + if package.loaded["neo-tree.sources.git_status"] then + require("neo-tree.sources.git_status").refresh() + end + end, + }) + end, + }, } diff --git a/.config/nvim/lua/plugins/none-ls.lua b/.config/nvim/lua/plugins/none-ls.lua.bak similarity index 100% rename from .config/nvim/lua/plugins/none-ls.lua rename to .config/nvim/lua/plugins/none-ls.lua.bak diff --git a/.config/nvim/lua/plugins/symbols-outline.lua b/.config/nvim/lua/plugins/symbols-outline.lua deleted file mode 100644 index 16d3f401..00000000 --- a/.config/nvim/lua/plugins/symbols-outline.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - { - "simrat39/symbols-outline.nvim", - event = "BufReadPost", - cmd = "SymbolsOutline", - keys = { { "ul", "SymbolsOutline", desc = "Lsp Symbols Outline" } }, - config = function() - require("symbols-outline").setup() - end, - }, -} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index 89645ee5..fa5f8ecf 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -39,7 +39,7 @@ return { ---@type TSConfig ---@diagnostic disable-next-line: missing-fields opts = { - autotag = { enable = true }, + -- autotag = { enable = true }, endwise = { enable = true }, highlight = { enable = true }, indent = { enable = true }, diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua index a9a911b9..a8c92acf 100644 --- a/.config/nvim/lua/plugins/which-key.lua +++ b/.config/nvim/lua/plugins/which-key.lua @@ -1,43 +1,44 @@ return { - { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - plugins = { spelling = true }, - defaults = { - mode = { "n", "v" }, - ["g"] = { name = "+goto" }, - ["gs"] = { name = "+surround" }, - ["]"] = { name = "+next" }, - ["["] = { name = "+prev" }, - [""] = { name = "+tabs" }, - ["a"] = { name = "+annotation" }, - ["b"] = { name = "+buffer" }, - ["c"] = { name = "+code" }, - ["f"] = { name = "+file/find" }, - ["g"] = { name = "+git" }, - ["gh"] = { name = "+hunks" }, - ["q"] = { name = "+quit/session" }, - ["s"] = { name = "+search" }, - ["u"] = { name = "+ui" }, - ["w"] = { name = "+windows" }, - ["x"] = { name = "+diagnostics/quickfix" }, - ["cc"] = { name = "+compile" }, - ["cp"] = { name = "+packages" }, - ["gd"] = { name = "+diff" }, - ["gw"] = { name = "+worktrees" }, - ["cR"] = { name = "+refactor" }, - ["D"] = { name = "+database" }, - ["sS"] = { name = "+Goto Symbols (Workspace)" }, - ["ss"] = { name = "+Goto Symbols" }, - ["db"] = { name = "+Breakpoints" }, - ["sr"] = { name = "+replace" }, - }, - }, - config = function(_, opts) - local wk = require("which-key") - wk.setup(opts) - wk.register(opts.defaults) - end, + { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + plugins = { spelling = true }, + defaults = { + mode = { "n", "v" }, + ["g"] = { name = "+goto" }, + ["gs"] = { name = "+surround" }, + ["]"] = { name = "+next" }, + ["["] = { name = "+prev" }, + [""] = { name = "+tabs" }, + ["a"] = { name = "+annotation" }, + ["b"] = { name = "+buffer" }, + ["c"] = { name = "+code" }, + ["f"] = { name = "+file/find" }, + ["g"] = { name = "+git" }, + ["gh"] = { name = "+hunks" }, + ["q"] = { name = "+quit/session" }, + ["s"] = { name = "+search" }, + ["u"] = { name = "+ui" }, + ["w"] = { name = "+windows" }, + ["x"] = { name = "+diagnostics/quickfix" }, + ["cc"] = { name = "+compile" }, + ["cp"] = { name = "+packages" }, + ["gd"] = { name = "+diff" }, + ["gw"] = { name = "+worktrees" }, + ["cR"] = { name = "+refactor" }, + ["D"] = { name = "+database" }, + ["sS"] = { name = "+Goto Symbols (Workspace)" }, + ["ss"] = { name = "+Goto Symbols" }, + ["db"] = { name = "+Breakpoints" }, + ["sr"] = { name = "+replace" }, + ["dP"] = { name = "+python" }, + }, }, + config = function(_, opts) + local wk = require("which-key") + wk.setup(opts) + wk.register(opts.defaults) + end, + }, }