---@type LazySpec
return {
- {
- "stevearc/oil.nvim",
+ { "stevearc/oil.nvim",
opts = {
keymaps = {
["g?"] = "actions.show_help",
{ "folke/trouble.nvim",
cmd = { "Trouble" },
opts = {
- keys = {
- ["<space><space>"] = "fold_toggle",
- },
modes = {
lsp = {
win = { position = "right" },
},
},
{ "folke/todo-comments.nvim",
- cmd = { "TodoTrouble", "TodoTelescope" },
- event = "LazyFile",
+ -- Finds and lists all of the TODO, HACK, BUG, etc comment
+ -- in your project and loads them into a browsable list.
+ cmd = { "TodoTrouble"},
+ event = { "BufReadPost", "BufNewFile", "BufWritePre" },
-- stylua: ignore
keys = {
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" },
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" },
{ "<leader>xt", "<cmd>Trouble todo toggle<cr>", desc = "Todo (Trouble)" },
{ "<leader>xT", "<cmd>Trouble todo toggle filter = {tag = {TODO,FIX,FIXME}}<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
- { "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
- { "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
},
+ opts = {}
+ },
+ { "echasnovski/mini.hipatterns", -- highlight hex colours and other matched words
+ event = { "BufReadPost", "BufNewFile", "BufWritePre" },
+ opts = function()
+ local hi = require("mini.hipatterns")
+ return {
+ highlighters = {
+ hex_color = hi.gen_highlighter.hex_color({ priority = 2000 }),
+ },
+ }
+ end,
+ },
+ { "folke/flash.nvim",
+ -- Flash enhances the built-in search functionality by showing labels
+ -- at the end of each match, letting you quickly jump to a specific
+ -- location.
+ event = "VeryLazy",
+ vscode = true,
+ ---@type Flash.Config
+ opts = {},
+ -- stylua: ignore
+ keys = {
+ { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
+ { "S", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
+ { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
+ { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
+ { "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
+ },
+ },
+ { "lewis6991/gitsigns.nvim",
+ -- git signs highlights text that has changed since the list
+ -- git commit, and also lets you interactively stage & unstage
+ -- hunks in a commit.
+ event = { "BufReadPost", "BufNewFile", "BufWritePre" },
+ opts = {
+ signs = {
+ add = { text = "▎" },
+ change = { text = "▎" },
+ delete = { text = "" },
+ topdelete = { text = "" },
+ changedelete = { text = "▎" },
+ untracked = { text = "▎" },
+ },
+ signs_staged = {
+ add = { text = "▎" },
+ change = { text = "▎" },
+ delete = { text = "" },
+ topdelete = { text = "" },
+ changedelete = { text = "▎" },
+ },
+ on_attach = function(buffer)
+ local gs = package.loaded.gitsigns
+
+ local function map(mode, l, r, desc)
+ vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
+ end
+
+ -- stylua: ignore start
+ map("n", "]h", function()
+ if vim.wo.diff then
+ vim.cmd.normal({ "]c", bang = true })
+ else
+ gs.nav_hunk("next")
+ end
+ end, "Next Hunk")
+ map("n", "[h", function()
+ if vim.wo.diff then
+ vim.cmd.normal({ "[c", bang = true })
+ else
+ gs.nav_hunk("prev")
+ end
+ end, "Prev Hunk")
+ map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk")
+ map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk")
+ map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
+ map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
+ map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
+ map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
+ map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
+ map("n", "<leader>ghp", gs.preview_hunk_inline, "Preview Hunk Inline")
+ map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
+ map("n", "<leader>ghB", function() gs.blame() end, "Blame Buffer")
+ map("n", "<leader>ghd", gs.diffthis, "Diff This")
+ map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
+ map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
+ Snacks.toggle({
+ name = "Git Signs",
+ get = function()
+ return require("gitsigns.config").config.signcolumn
+ end,
+ set = function(state)
+ require("gitsigns").toggle_signs(state)
+ end,
+ }):map("<leader>uG")
+ end,
+ },
+ },
+
+ -- TODO: currently unused plugins, check and enable/remove
+ { "MagicDuck/grug-far.nvim", enabled = false,
+ -- search/replace in multiple files
+ opts = { headerMaxWidth = 80 },
+ cmd = "GrugFar",
+ keys = {
+ {
+ "<leader>sr",
+ function()
+ local grug = require("grug-far")
+ local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
+ grug.open({
+ transient = true,
+ prefills = {
+ filesFilter = ext and ext ~= "" and "*." .. ext or nil,
+ },
+ })
+ end,
+ mode = { "n", "v" },
+ desc = "Search and Replace",
+ },
+ },
+ },
+ { "aymericbeaumet/vim-symlink",
+ dependencies = { "moll/vim-bbye" }, -- NOTE: Snacks.buddelete also provides this
},
}