nvim: keymappings: Fix mapping for replace word

With silent set, we could not provide the input at the command line.
Also, the c. mapping wasn't suppose to have <CR>.
This commit is contained in:
Sanchayan Maity 2021-11-18 13:20:59 +05:30
parent c806eafe5c
commit 71fae03c07
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
local remap = vim.api.nvim_set_keymap
local expr_opts = { noremap=true, silent=true, unique=true, expr=true }
local opts = { noremap=true, silent=true, unique=true }
local expr_opts = { noremap=true, unique=true, expr=true }
local opts = { noremap=true, unique=true }
remap('c', '<Esc>', '<C-C>', opts)
-- Use Q to execute default register.
@ -11,7 +11,7 @@ remap('v', '<Leader>Y', '"*y' , opts)
remap('n', '<Leader>p', '<ESC>"+p', opts)
remap('n', '<Leader>P', '<ESC>"*p', opts)
-- Search and Replace
remap('n', 'c.' , ':%s//g<Left><Left><CR>' , opts)
remap('n', 'c.' , ':%s//g<Left><Left>' , opts)
remap('n', '<Leader>c.', ':%s/\\<<C-r><C-w>\\>//g<Left><Left>', opts)
-- Quit
remap('n', '<Leader>x', '<Esc>:x<CR>' , opts)