feat: Adding the custom_commands script with a find and replace function
This commit is contained in:
parent
165582f846
commit
02ba4ea6e6
@ -43,6 +43,7 @@
|
|||||||
-- Created: 7/2/2012
|
-- Created: 7/2/2012
|
||||||
|
|
||||||
require('custom_functions')
|
require('custom_functions')
|
||||||
|
require('custom_commands')
|
||||||
require('keymappings')
|
require('keymappings')
|
||||||
require('settings')
|
require('settings')
|
||||||
require('autocmds')
|
require('autocmds')
|
||||||
|
|||||||
11
nvim/lua/custom_commands.lua
Normal file
11
nvim/lua/custom_commands.lua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
vim.api.nvim_create_user_command('FindAndReplace', function(opts)
|
||||||
|
vim.api.nvim_command(string.format('cdo s/%s/%s', opts.fargs[1], opts.fargs[2]))
|
||||||
|
vim.api.nvim_command('cfdo update')
|
||||||
|
end, { nargs = '*' })
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap(
|
||||||
|
'n',
|
||||||
|
'<leader>ir',
|
||||||
|
':FindAndReplace ',
|
||||||
|
{ noremap = true }
|
||||||
|
)
|
||||||
Loading…
x
Reference in New Issue
Block a user