Skip to content

Highlight several words in different colors simultaneously. (#1238 continued)

Notifications You must be signed in to change notification settings

zeroflyfire/Mark--Karkat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a mirror of http://www.vim.org/scripts/script.php?script_id=2666

2.8.5	29-Oct-2014
- ENH: Add alternative <Plug>MarkConfirmAllClear optional command that works
  like <Plug>MarkAllClear, but with confirmation. Thanks to Marcelo Montu for
  suggesting this!

DESCRIPTION

This plugin adds mappings and a :Mark command to highlight several words in
different colors simultaneously, similar to the built-in 'hlsearch'
highlighting of search results and the * |star| command. For example, when you
are browsing a big program file, you could highlight multiple identifiers in
parallel. This will make it easier to trace the source code.

This is a continuation of vimscript #1238 by Yuheng Xie, who doesn't maintain
his original version anymore and recommends switching to this fork. This
plugin offers the following advantages over the original:
- Much faster, all colored words can now be highlighted, no more clashes with
  syntax highlighting (due to use of matchadd()).
- Many bug fixes.
- Jumps behave like the built-in search, including wrap and error messages.
- Like the built-in commands, jumps take an optional [count] to quickly skip
  over some marks.
- Marks can be persisted, and patterns can be added / subtracted from
  mark highlight groups.

SEE ALSO								     *

- SearchAlternatives.vim (vimscript #4146) provides mappings and commands to
  add and subtract alternative branches to the current search pattern.
- SearchHighlighting.vim (vimscript #4320) can change the semantics of the
  start command *, extends it to visual mode (like Mark) and has auto-search
  functionality which instantly highlights the word under the cursor when
  typing or moving around, like in many IDEs.

RELATED WORKS								     *

- MultipleSearch (vimscript #479) can highlight in a single window and in all
  buffers, but still relies on the :syntax highlighting method, which is
  slower and less reliable.
- http://vim.wikia.com/wiki/Highlight_multiple_words offers control over the
  color used by mapping the 1-9 keys on the numeric keypad, persistence, and
  highlights only a single window.
- highlight.vim (vimscript #1599) highlights lines or patterns of interest in
  different colors, using mappings that start with CTRL-H and work on cword.
- quickhl.vim (vimscript #3692) can also list the matches with colors and in
  addition offers on-the-fly highlighting of the current word (like many IDEs
  do).
- Highlight (http://www.drchip.org/astronaut/vim/index.html#HIGHLIGHT) has
  commands and mappings for highlighting and searching, uses matchadd(), but
  limits the scope of highlightings to the current window.
- TempKeyword (vimscript #4636) is a simple plugin that can matchadd() the
  word under the cursor with \0 - \9 mappings. (And clear with \c0 etc.)
- simple_highlighting (vimscript #4688) has commands and mappings to highlight
  8 different slots in all buffers.
- searchmatch (vimscript #4869) has commands and mappings for :[1,2,3]match,
  in the current window only.

About

Highlight several words in different colors simultaneously. (#1238 continued)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vim Script 100.0%