sponsor Vim development Vim logo Vim Book Ad

ProjectBrowse : Browse a list of files below a root directory

 script karma  Rating 28/10, Downloaded by 1708  Comments, bugs, improvements  Vim wiki

created by
Jon Heiner
 
script type
utility
 
description
Generate a list of files below a set of root directories for rapidly finding and editing medium sized source trees. Intended for moderate sized programming projects with several thousand header and source files, but will be useful to anyone editing large numbers of files in a structured directory layout. ( e.g.: websites, config files, etc )

The file list can be set to appear either in a new buffer or in the local buffer. Place the cursor on the line of the file of interest and hit return. Although searching may be done in any way, the suggested usage is the / ( slash search ) command. The buffer is set locally to be case insensitive and not use highlighting. Press / and then type the first few characters of the file of interest followed by return ( twice ).

I created this script in response to the browser that ships with the popular Visual Assist program by Whole Tomato Software for MS Visual .NET. I prefer to use vim for all my editing and ctags is great, but when you have another developer telling you to "Go to file SomeWierdFileDeepInTheDirectoryStructure.cpp" it can be pretty slow and painful sometimes. This browser solves that problem directly.

This script has been under nearly daily usage by myself and several others. Now it has been highly optimized to cache the search results to a file. Special thanks to Steven An.

Please feel free to email me with bugs or feature requests, or just if you like it. I am required to use gvim and .NET extensively, so i am interested in additional features or tips that you want to see.
 
install details
REQUIRES: the unix find command. The script assumes that find is in your path, but you can set the direct path to the directory explicitly. See s:find_path var.

Recommended mapping: use alt-o to open the browser. put this in your .vimrc
map <A-o> :ProjectBrowseCached<CR>
map <A-O> :ProjectBrowse c:\Projects\ c:\Libraries c:\Includes<CR>

The first command will open the cached file list. The second (shift-O) will refresh the list with new files.

s:filter var defaults to nothing. set it to only include cpp and header files, etc.

s:splitBehavior default to none. set it to vert or horiz to open the browser in a new buffer.
 

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
projectbrowse.vim 1.2 2007-02-06 6.0 Jon Heiner Now caches the list of files in your project, making this an extraordinarily fast way to access medium sized source trees. This plugin has been under considerable use over the past few years and is quite robust. Special thanks to Steven An for adding the caching.
projectbrowse.vim 1.1 2006-01-04 6.0 Jon Heiner Better usability for opening in current buffer. Will prompt for save if local buffer is modified. Will hide current buffer if modified and not saved. Various cleanup.
projectbrowse.vim 1.0a 2004-03-23 6.0 Jon Heiner Initial upload
ip used for rating: 3.142.200.226

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