*MultipleSearch.txt* Simultaneously show multiple search results Ver. 1.3 Maintainer: Dan Sharp Last Changed: 13 Aug 2008 License: Vim License ============================================================================== 1. MultipleSearch Plugin *MultipleSearch* MultipleSearch allows you to have the results of multiple searches displayed on the screen at the same time. Each search highlights its results in a different color, and all searches are displayed at once. After the maximum number of colors is used, the script starts over with the first color. Special thanks to: Peter Valach for suggestions and testing! Jeff Mei for the suggesting and testing the :SearchBuffers command. Amber Hassan for fixing problems with a search pattern containing quote characters! Manuel Picaza for the mapping to :Search the word under the cursor. ------------------------------------------------------------------------------ 2. Commands *MultipleSearch-commands* :Search *:Search* will highlight all occurrences of in the current buffer. A subsequent :Search will highlight all occurrences of in the current buffer, retaining the highlighting of as well. and are any search pattern like you would use in a normal / search. The :Search command honors Vim's 'ignorecase' and 'smartcase' settings for its own search. You can use the |\c| and |\C| flags in the search pattern to force case matching no matter the setting of 'ignorecase' and 'smartcase'. :SearchBuffers *:SearchBuffers* The :SearchBuffers command works just like :Search, but the search occurs in all currently listed buffers (i.e., those that appear in the output of :ls). The match in all buffers will have the same color. This is different than :bufdo Search because in that case, each buffer will highlight the match in a different color. " Clear the current search selections and start over with the first color in " the sequence. :SearchReset To clear the highlighting, issue the command :SearchReset (for the current buffer) or :SearchBuffersReset (for all buffers). " Clear the current search selections and start over with the first color in " the sequence. :SearchBuffersReset To clear the highlighting, issue the command :SearchReset (for the current buffer) or :SearchBuffersReset (for all buffers). " Reinitialize the script after changing one of the global preferences. :SearchReinit If you change one of the preference variables, you can issue the command :SearchReinit to update the script with your new selections. ------------------------------------------------------------------------------ 3. Mappings *MultipleSearch-mappings* " Thanks to Manuel Picaza for the following mapping to :Search the word under " the cursor. nnoremap * " Following Manuel's idea, adapt the former 'Super Star' tip from vim.org to work with " :Search on a visual selection. vnoremap * " Set the current search pattern to the next one in the list nnoremap n " Set the current search pattern to the previous one in the list nnoremap N ------------------------------------------------------------------------------ 4. Settings *MultipleSearch-settings* You can specify the maximum number of different colors to use by setting the g:MultipleSearchMaxColors variable in your .vimrc. The default setting is four, but the script should handle as much as your terminal / GUI can display. The g:MultipleSearchColorSequence variable lets you list the colors you want displayed, and in what order. To make the text more readable, you can set the g:MultipleSearchTextColorSequence variable to a list of colors for the text, each position corresponding to the color in the same position in g:MultipleSearchColorSequence. *g:MultipleSearchMaxColors* g:MultipleSearchMaxColors (Default: 8) Specifes a maximum number of colors to use. *g:MultipleSearchColorSequence* g:MultipleSearchColorSequence (Default: "red,yellow,blue,green,magenta, cyan,gray,brown") Defines the sequence of colors to use for searches. *g:MultipleSearchTextColorSequence* g:MultipleSearchTextColorSequence (Default: "white,black,white,black,white, black,black,white") Defines the text color for searches, so that it can still be read against the colored background. ============================================================================== vim: ft=help:norl:ts=8:tw=78