nvim/lua/user/search_replace.lua
2025-01-15 23:20:30 +05:30

14 lines
336 B
Lua

-- lua/user/search_replace.lua
local M = {}
function M.search_replace()
-- Prompt for the old name
local old_name = vim.fn.input("Old name: ")
-- Prompt for the new name
local new_name = vim.fn.input("New name: ")
-- Execute the search and replace command
vim.cmd(string.format("%%s/%s/%s/g", old_name, new_name))
end
return M