diff --git a/lua/ow/core/mappings.lua b/lua/ow/core/mappings.lua index f311aad..d905840 100644 --- a/lua/ow/core/mappings.lua +++ b/lua/ow/core/mappings.lua @@ -100,6 +100,15 @@ vim.keymap.set('n', 've', function() end end) +-- Replace all occurrences of word +vim.keymap.set("n", "r", function() + local word = vim.fn.expand("") + local replacement = vim.fn.input('Replace "' .. word .. '" by? ') + if replacement ~= "" then + vim.cmd(":%s/\\<" .. word .. "\\>/" .. replacement .. "/g") + end +end) + -- Removed bindings vim.keymap.set('n', 'gr', '')