fixed highlight keymapping

This commit is contained in:
Oliver Hartmann 2022-10-05 11:52:28 +02:00
parent f9d34430ae
commit d91ae17970

View File

@ -25,10 +25,14 @@ vim.keymap.set({ 'n', 'x' }, '<End>', 'g<End>', opts)
vim.keymap.set('x', '<', '<gv') vim.keymap.set('x', '<', '<gv')
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 -- 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('n', "'", hlWord, { noremap = true, silent = false })
-- vim.keymap.set('v', "'", "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>") vim.keymap.set('x', "'", 'y/\\V<C-R>"<CR>N', { noremap = true, silent = true })
vim.keymap.set('x', "'", "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>", { noremap = true, silent = true })
-- Close Buffer -- Close Buffer
vim.keymap.set('n', '<C-w>', ':bd<CR>') vim.keymap.set('n', '<C-w>', ':bd<CR>')