From edc73d36390f43af979be62a67ab3180d58da4fd Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Wed, 5 Oct 2022 11:53:26 +0200 Subject: [PATCH] small fix for highlight word --- lua/my_keymappings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/my_keymappings.lua b/lua/my_keymappings.lua index 6b4405c..24fcd6f 100644 --- a/lua/my_keymappings.lua +++ b/lua/my_keymappings.lua @@ -27,7 +27,7 @@ vim.keymap.set('x', '>', '>gv') local function hlWord() local current_word = vim.call('expand','') - vim.fn.setreg('/', current_word) + vim.fn.setreg('/', "\\<" .. current_word .. "\\>") vim.api.nvim_command "set hlsearch" end -- Highlight word under cursor