sponsor Vim development Vim logo Vim Book Ad

greplist.vim : vimgrep location list manager

 script karma  Rating 0/0, Downloaded by 889  Comments, bugs, improvements  Vim wiki

created by
Yuri Klubakov
 
script type
utility
 
description
This plug-in is for someone who often does multi-file search in multiple locations and these locations often change when for example you work on several different projects.  It helps to maintain a list of frequently used vimgrep locations and defines commands to edit a list and to perform a search in the selected locations.

:GrepListConfig command loads a list for editing.  A list is kept in
"$HOME/_vimgrep" file or in "$VIM/_vimgrep" file if $HOME is not defined.  If "_vimgrep" file does not exist or empty, a sample list is created.  Status line shows useful normal mode mappings:
  'q' - abandon any changes and wipe the buffer
  's' - save the changes and wipe the buffer
  ' ' - select/deselect current line (selected lines start with '+')

:GrepListFind(mode) command prompts for the string to find and starts the vimgrep search in the selected locations.  The default value for the search string is either the current visual selection (mode != 0) or the current word (mode == 0).  Plug-in automatically surrounds the search string with '/' and adds 'j' option.

As usual, it is more convenient to create mappings for these commands.  For example:
noremap <F8> :GrepListFind 0<CR>
inoremap <F8> <C-O>:GrepListFind 0<CR>
vnoremap <F8> <C-C>:GrepListFind 1<CR>

For more information please see the source code -- it is small and easy to read.
 
install details
Download and copy greplist.vim to $HOME/vimfiles/plugin or
$VIM/vimfiles/plugin directory.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
greplist.vim 1.0 2007-09-01 7.0 Yuri Klubakov Initial upload
ip used for rating: 44.205.5.65

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github