Skip to content

Instantly share code, notes, and snippets.

@bindiego
Created March 30, 2020 03:26
Show Gist options
  • Save bindiego/4840efeb45b35713178874baccd1fa8e to your computer and use it in GitHub Desktop.
Save bindiego/4840efeb45b35713178874baccd1fa8e to your computer and use it in GitHub Desktop.
Highlight duplicated lines in Vim

Highlight duplicated lines in Vim

:syn clear Repeat | g/^\(.*\)\n\ze\%(.*\n\)*\1$/exe 'syn match Repeat "^' . escape(getline('.'), '".\^$*[]') . '$"' | nohlsearch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment