more keybinding description

This commit is contained in:
Oliver Hartmann 2022-12-29 00:51:41 +01:00
parent 1e7fd727c2
commit 54e87b448e

View File

@ -25,13 +25,16 @@ vim.keymap.set('x', '<', '<gv')
vim.keymap.set('x', '>', '>gv')
local function hlWord()
local current_word = vim.call('expand','<cword>')
local current_word = vim.call('expand', '<cword>')
vim.fn.setreg('/', "\\<" .. current_word .. "\\>")
vim.opt.hlsearch = true
end
-- Highlight word under cursor
vim.keymap.set('n', "'", hlWord, { noremap = true, silent = true })
vim.keymap.set('x', "'", 'y/\\V<C-R>"<CR>N', { noremap = true, silent = true })
vim.keymap.set('n', "'", hlWord, { noremap = true, silent = true, desc = 'Higlight word under cursor' })
vim.keymap.set('x', "'", 'y/\\V<C-R>"<CR>N', { noremap = true, silent = true, desc = 'Highlight visual' })
-- Close Buffer
vim.keymap.set('n', '<C-w>', ':bd<CR>')
vim.keymap.set('n', '<C-w>', ':bd<CR>', { desc = 'Close buffer' })
vim.keymap.set('n', '<space>x', 'za', { desc = 'Toggle fold' })