Skip to content

Instantly share code, notes, and snippets.

@scajanus
Created June 10, 2016 13:43
Show Gist options
  • Select an option

  • Save scajanus/a105360a6b4cb6bd8dbbead35eb05f60 to your computer and use it in GitHub Desktop.

Select an option

Save scajanus/a105360a6b4cb6bd8dbbead35eb05f60 to your computer and use it in GitHub Desktop.
Make * and # first highlight, then move cursor
nnoremap <expr> * @/=='\<'.expand('<cword>').'\>' ? '*' : ":let @/='\\<'.expand('<cword>').'\\>'<CR>"
nnoremap <expr> # @/=='\<'.expand('<cword>').'\>' ? '#' : ":let @/='\\<'.expand('<cword>').'\\>'<CR>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment