sponsor Vim development Vim logo Vim Book Ad

Buffersaurus : A Vim Plugin for Searching and Indexing Across Buffers (with Context!)

 script karma  Rating 110/33, Downloaded by 1980  Comments, bugs, improvements  Vim wiki

created by
Jeet Sukumaran
script type
Buffersaurus is a plugin for searching and indexing the contents of buffers
for regular expression patterns or collections of regular expression patterns.
Results are displayed in separate buffer, and can be (optionally) viewed with
user-specifiable lines of context (i.e., a number of lines before and/or after
the line matching the search pattern) or filtered for specific patterns.

Global commands provided include (among others):

  :Bsgrep[!] {pattern}

    Search all buffers (or just current buffer if "!" given) for regular
    expression pattern, {pattern}.


    Construct a "table-of-contents" consisting of filetype-dependent
    "important" patterns (e.g. class and method/function definitions).

Other commands include those for filtering results, jumping to next/previous
matching line without opening the catalog, searching for special user-defined
terms ("Bsterm") etc.

The results list can be browsed/navigated using all the usual Vim movement
commands. Selected lines can be opened in the previous window, a new window
split (vertical or horizontal), or a new tab page. Context can be toggled (i.e.
show a user-specified number of lines before or after the matching line).
Results are grouped and sorted by filename, and then by line number, but can
also be ungrouped and sorted lexically.

Search and replace operations (using the ":Bsreplace" command, or "R" key
mapping), or execution of arbitrary commands ("x" or "X" key mapping),
can also be carried out on matched or contexted lines can be carried out

Detailed usage description is given in the help file, which can be viewed
on-line here:


Source code repository can be found here:


install details
If Pathogen is installed, you can install Buffersaurus by unpacking the source
archive in $VIMRUNTIME/bundle.  Otherwise, unpack the source archive and copy
"buffersaurus.vim" to $VIMRUNTIME/plugin and "buffersaurus.txt" to

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
vim-buffersaurus-v2.1.0.tar.gz 2.1.0 2012-01-07 7.0 Jeet Sukumaran - Renamed command: "Bssubstitute" for search and replace on matched lines in catalog viewer (this used to be "Bsreplace", but now "Bsreplace" is a globally available command; see below)
- Renamed command: "Bsinfo" for status of search (this used to be "Bsstatus")
- NEW command: "Bsreplace" for search and replace across all buffers (global command; available everywhere)
vim-buffersaurus-v2.0.1.tar.gz 2.0.1 2011-12-24 7.0 Jeet Sukumaran - command / search and replace is not carried out silently, allowing for, e.g. "c" flag (i.e., interactive S&R with confirmation)
vim-buffersaurus-v2.0.0.tar.gz 2.0.0 2011-12-24 7.0 Jeet Sukumaran - Ability to carry out search and replace operations ("R" or "ctrl-R" key maps, or ":Bsreplace" command) on matched or context lines.
- Ability to execute arbitrary commands ("x" or "X"  key maps) on matched/context lines.
vim-buffersaurus-v1.2.3.tar.gz 1.2.3 2011-07-06 7.0 Jeet Sukumaran - Do not clobber default register when rendering buffer.
- Fixed bug in window splitting policy.
vim-buffersaurus-v1.2.1.tar.gz 1.2.1 2011-06-14 7.0 Jeet Sukumaran - added (redundant) key-mapping for 'go', 'gi', 'gs' for NERDTree compatibility
vim-buffersaurus-v1.2.0.tar.gz 1.2.0 2011-06-13 7.0 Jeet Sukumaran - switched catalog viewer key mappings to be more consistent with NERDTree: e.g. "o/O", "s/S", "i/I", "t/T" to open/preview in previous window, vertical split, horizontal split, or tab page respectively; (if you prefer the old key-maps, set "g:buffersaurus_use_new_keymap=0" in your $VIMRUNTIME).
vim-buffersaurus-v1.1.0.tar.gz 1.1.0 2011-06-12 7.0 Jeet Sukumaran - Added key mappings to open tabs and splits 'silently' (in the background, keeping focus in catalog window)
ip used for rating:

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.