diff --git a/lua/holger/plugins/flash.lua b/lua/holger/plugins/flash.lua new file mode 100644 index 0000000..10dce83 --- /dev/null +++ b/lua/holger/plugins/flash.lua @@ -0,0 +1,23 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + ---@type Flash.Config + opts = { + modes = { + search = { + enabled = true, + }, + char = { + jump_labels = true, + }, + }, + }, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, 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" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/lua/holger/plugins/substitute.lua b/lua/holger/plugins/substitute.lua index e952b65..852cc82 100644 --- a/lua/holger/plugins/substitute.lua +++ b/lua/holger/plugins/substitute.lua @@ -1,17 +1,17 @@ return { - "gbprod/substitute.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local substitute = require("substitute") + "gbprod/substitute.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local substitute = require("substitute") - substitute.setup() + substitute.setup() - -- set keymaps - local keymap = vim.keymap -- for conciseness + -- set keymaps + local keymap = vim.keymap -- for conciseness - vim.keymap.set("n", "s", substitute.operator, { desc = "Substitute with motion" }) - vim.keymap.set("n", "ss", substitute.line, { desc = "Substitute line" }) - vim.keymap.set("n", "S", substitute.eol, { desc = "Substitute to end of line" }) - vim.keymap.set("x", "s", substitute.visual, { desc = "Substitute in visual mode" }) - end, + vim.keymap.set("n", "r", substitute.operator, { desc = "Substitute with motion" }) + vim.keymap.set("n", "rr", substitute.line, { desc = "Substitute line" }) + vim.keymap.set("n", "R", substitute.eol, { desc = "Substitute to end of line" }) + vim.keymap.set("x", "r", substitute.visual, { desc = "Substitute in visual mode" }) + end, }