DescriptionThis module implements commands for highlighting all occurrences of current word, selected text or regular expression with one of 7 predefined colors. Tested in SlickEdit 15.
This is a re-implementation of my old CodeWright macro. I use multiple highlights when analyzing huge log files generated by our system.
Commands'
highlight_textN' commands, where N is from 1 to 7, highlight all occurrences of current word or selected text with color N. Selected text can not span more than current line. If cursor is on existing highlight then that highlight is cleared.
'
highlight_reN' commands, where N is from 1 to 7, prompt user for a Perl regular expression and highlight all occurrences with color N.
'
highlight_text_clear_all' command clears all highlights created with 'highlight_textN' or 'highlight_reN' commands.
'
highlight_text_bind_keys' command binds 'highlight_textN', 'highlight_reN' and 'highlight_text_clear_all' commands all at once. Default bindings are
Ctrl-1 to
Ctrl-7,
Ctrl-Shift-1 to
Ctrl-Shift-7 and
Ctrl-0 keys respectively. Customize this command to your taste.
By default searching for text to highlight is case-insensitive and not restricted to whole words. Two commands '
highlight_text_toggle_case_sensitive' and '
highlight_text_toggle_whole_word' toggle the flags.
Installation- Put attached highlight_text.e into local folder and load with F12 or Macro->Load Module.
- Run 'highlight_text_bind_keys' command to bind keys.
CustomizationPredefined colors are stored in 's_colors' array. You can change them to your taste. It is trivial to add more colors: add a color entry into 's_colors' and then add new 'highlight_textN'/'highlight_reN' commands.
AcknowledgementsThanks to
marksun for SymHighlight macro which I used as a starting point.