Skip to content

Instantly share code, notes, and snippets.

@ewal
Created August 20, 2023 01:22
Show Gist options
  • Save ewal/69767d2b1fefe219f26965a549babf23 to your computer and use it in GitHub Desktop.
Save ewal/69767d2b1fefe219f26965a549babf23 to your computer and use it in GitHub Desktop.
neovim - prevent first jump when pattern matching
vim.keymap.set('n', '*', function()
vim.fn.setreg('/', '\\<' .. vim.fn.expand '<cword>' .. '\\>')
vim.opt.hlsearch = true
end, { silent = true })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment