From 87978e824b3642d5e371dcc0b5a59f378b36a10a Mon Sep 17 00:00:00 2001 From: Joshua Finch Date: Wed, 29 Jan 2025 20:03:41 -0600 Subject: [PATCH] fix: Adding the global flag to the FindandReplace custom function. --- nvim/lua/custom_commands.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/lua/custom_commands.lua b/nvim/lua/custom_commands.lua index 862bf73..28d8752 100644 --- a/nvim/lua/custom_commands.lua +++ b/nvim/lua/custom_commands.lua @@ -1,7 +1,7 @@ vim.api.nvim_create_user_command('FindAndReplace', function(opts) -- Update each quickfix location using substitute, update the files to save changes, close the opened buffers and close the quickfix window -- TODO: Does not close the buffers opened through changes - vim.api.nvim_command(string.format('cdo s/%s/%s/', opts.fargs[1], opts.fargs[2]) .. '| update | cclose') + vim.api.nvim_command(string.format('cdo s/%s/%s/g', opts.fargs[1], opts.fargs[2]) .. '| update | cclose') end, { nargs = '*' }) vim.api.nvim_set_keymap(