Skip to content

Instantly share code, notes, and snippets.

@ayosec
Created November 15, 2012 03:02
Show Gist options
  • Select an option

  • Save ayosec/4076380 to your computer and use it in GitHub Desktop.

Select an option

Save ayosec/4076380 to your computer and use it in GitHub Desktop.
Vim: Highlight word under cursor
" When the cursor is hold on a word, that word is highlighted.
" When the cursor is moving, the highlight is hidden
set updatetime=300
au! CursorMoved * set nohlsearch
au! CursorHold * set hlsearch | let @/='\<'.expand("<cword>").'\>'
set hlsearch
@virus-found
Copy link
Copy Markdown

It seems it's intended to work in gvim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment