GetLatestVimScripts + wget.exe git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@170 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
107 lines
4.9 KiB
Plaintext
107 lines
4.9 KiB
Plaintext
*MultipleSearch.txt* Simultaneously show multiple search results Ver. 1.3
|
|
|
|
Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
|
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 <pattern> *:Search*
|
|
will highlight all occurrences of <pattern> in the current buffer. A
|
|
subsequent :Search <pattern2> will highlight all occurrences of <pattern2>
|
|
in the current buffer, retaining the highlighting of <pattern1> as well.
|
|
<pattern1> and <pattern2> are any search pattern like you would use in a
|
|
normal /<pattern> 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 <pattern> *: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 <pattern> 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 <silent> <Leader>*
|
|
|
|
" Following Manuel's idea, adapt the former 'Super Star' tip from vim.org to work with
|
|
" :Search on a visual selection.
|
|
vnoremap <silent> <Leader>*
|
|
|
|
" Set the current search pattern to the next one in the list
|
|
nnoremap <silent> <Leader>n
|
|
|
|
" Set the current search pattern to the previous one in the list
|
|
nnoremap <silent> <Leader>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
|