fixed highlight keymapping
This commit is contained in:
parent
f9d34430ae
commit
d91ae17970
@ -25,10 +25,14 @@ vim.keymap.set({ 'n', 'x' }, '<End>', 'g<End>', opts)
|
||||
vim.keymap.set('x', '<', '<gv')
|
||||
vim.keymap.set('x', '>', '>gv')
|
||||
|
||||
local function hlWord()
|
||||
local current_word = vim.call('expand','<cword>')
|
||||
vim.fn.setreg('/', current_word)
|
||||
vim.api.nvim_command "set hlsearch"
|
||||
end
|
||||
-- Highlight word under cursor
|
||||
vim.keymap.set('n', "'", ':let @/=\'\\<<C-R>=expand("<cword>")<CR>\\>\'<CR>:set hls<CR>', { noremap = true, silent = true })
|
||||
-- vim.keymap.set('v', "'", "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>")
|
||||
vim.keymap.set('x', "'", "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>", { noremap = true, silent = true })
|
||||
vim.keymap.set('n', "'", hlWord, { noremap = true, silent = false })
|
||||
vim.keymap.set('x', "'", 'y/\\V<C-R>"<CR>N', { noremap = true, silent = true })
|
||||
|
||||
-- Close Buffer
|
||||
vim.keymap.set('n', '<C-w>', ':bd<CR>')
|
||||
|
Loading…
x
Reference in New Issue
Block a user