tamato.blogg.se

How to highlight more than one thing
How to highlight more than one thing










The second example is the same as placing the cursor on "hello" then pressing 5 on the numeric keypad. The following examples use different colors to highlight various patterns: Depending on your system, you may be able to use the abbreviation :Hi rather than :Highlight. The script defines a :Highlight n pattern command where n is a number (1.99) and pattern is the text you want highlighted. Now you can press the normal search keys n or N to find the next or previous occurrence. This has no effect on search highlighting or history.Īlternatively, type \n or \N to search forwards or backwards. Type \f to find the next match, or \F to find backwards. Patterns highlighted with the :match or :2match commands are also found. Switch to the other window and press * to apply the highlights from the first window.Īfter using \m to enable mappings, you can search for the next or previous occurrence of highlighted text.Press - to remove all highlights in the first window.In the first window, apply the wanted highlighting. Press * to restore the highlighting when - was last used in any window.įor example, suppose you are displaying two windows and you want the same highlighting in each window.Press + to restore the highlighting when - was last used in the current window.Press - to remove all highlights in the current window.With the mappings enabled, you could use the keypad to: All occurrences of the visually selected text will be highlighted, including the "rain" in "rainbow".Įach window has its own set of highlights: if you use :split to show two windows, you can have one set of highlights in the top window, and a different set in the other window. No highlighting will occur in words like "rainbow".Īlternatively, place the cursor on "rain" and press viw to select the word, then 4. Press 0 to remove all highlights from the current visually selected text, or the current word.įor example, if you place the cursor on the word "rain" and press 4 on the keypad, all occurrences of "rain" will be highlighted (use :hi hl4 to show the colors).Press 2 for highlight hl2, 3 for highlight hl3, etc.Press 1 to highlight the current visually selected text, or the current word (if nothing is selected).At startup, the numeric keypad operates normally because only \m is mapped.Īfter typing \m to enable the mappings, you could use the keypad to: Type \m (assuming the default backslash leader key) to toggle mapping of the keypad on/off. 9 on the numeric keypad will highlight the word under the cursor with the colors defined in the corresponding highlight group (for example, press 4 on the keypad to highlight the current word with the hl4 group).

how to highlight more than one thing

Once enabled, pressing one of the keys 1, 2. The script defines highlight groups named hl1, hl2.












How to highlight more than one thing