Skip to content

Commit 37caa44

Browse files
committed
feat(neovim): add 'substitute' plugin.
1 parent 0fdb847 commit 37caa44

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

module/neovim/default.nix

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@
8686
source = config.lib.file.mkOutOfStoreSymlink "${unvX.directory.module}/neovim/lua/plugins/specs/snacks.lua";
8787
target = ".config/nvim/lua/plugins/specs/snacks.lua";
8888
};
89+
"neovim/lua/plugins/specs/substitute.lua" = {
90+
source = config.lib.file.mkOutOfStoreSymlink "${unvX.directory.module}/neovim/lua/plugins/specs/substitute.lua";
91+
target = ".config/nvim/lua/plugins/specs/substitute.lua";
92+
};
8993
"neovim/lua/plugins/specs/telescope.lua" = {
9094
source = config.lib.file.mkOutOfStoreSymlink "${unvX.directory.module}/neovim/lua/plugins/specs/telescope.lua";
9195
target = ".config/nvim/lua/plugins/specs/telescope.lua";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
return {
2+
"gbprod/substitute.nvim",
3+
event = { "BufReadPre", "BufNewFile" },
4+
config = function()
5+
local keymap = vim.keymap
6+
local substitute = require("substitute")
7+
8+
-------------------------------------------------------------------------------
9+
-- Key bindings
10+
-------------------------------------------------------------------------------
11+
12+
keymap.set("n", "s", substitute.operator, { desc = "Substitute with motion" })
13+
keymap.set("n", "ss", substitute.line, { desc = "Substitute line" })
14+
keymap.set("n", "S", substitute.eol, { desc = "Substitute to end of line" })
15+
keymap.set("x", "s", substitute.visual, { desc = "Substitute in visual mode" })
16+
17+
-------------------------------------------------------------------------------
18+
-- Options
19+
-------------------------------------------------------------------------------
20+
21+
substitute.setup()
22+
end,
23+
}

0 commit comments

Comments
 (0)