sponsor Vim development Vim logo Vim Book Ad

Project Browser or File explorer for vim : Easy project navigation by listing the files

 script karma  Rating 24/9, Downloaded by 2369  Comments, bugs, improvements  Vim wiki

created by
Pradeep Kudethur
 
script type
utility
 
description
Emulates the project file browser similar to some popular code browsers.      
This will list all the files in the project in a new window and allow user to open any file by mouse click/<CR>/O/V/H. This will come very handy when you are dealing with huge number of files and you really dont want to worry about the project directory structure, but just about the filename you are working on.  

More information about the key maps and configuration can be found in the fileexplorer.vim file.

Feel free to contact me, in case you have any questions/feedback.
 
install details
Copy this file in your .vim/plugin folder. I have tried this on free BSD. This should also work on linux and cygwin.
 

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
fileexplore.vim 1.2 2005-06-24 6.0 Pradeep Kudethur 1. "More faster than before...................”. We need not do the find operation every time we open the vim, since new file addition is not very frequent to the source base. When one opens the vim, he can just do "ctrl-p", which will get the file list from the local database (by default stored in "filelist"). If new file/files are added then one can type 'R' in the file explorer, which will execute the find command from the project root folder and update the file list database.
One can also rebuild the file list database, while opening the file explorer by pressing F5 (similar to the older versions)
NOTE: All the key mappings can be tuned according to the convenience

2. Removed duplicate file names from the file explorer. The project might have duplicate file names but in different folders, we can just display one name for all those duplicate and the back end Csope will always support getting the right file (it will give suggestion for duplicate filename). But one advantage of having duplicate files in the file explorer is to know the number of duplicate files, even before selecting/clicking. There is a knob in the script to enable duplicate files displayed "fileExplorerDuplicateRemove".

3. Also there were some junk files starting with '.' character in my project, by default filenames starting with ‘.’ character is filtered from the file explorer. If you wish to turn of this filtering feature, then you can change "fileExplorerDotRemove"
fileexplore.vim 1.1 2005-06-15 6.0 Pradeep Kudethur Some minor enhancement for keys <CR> and mouse left button double click. In version 1.0 these keys were responsible for opening the file in the new window (split was based on 'splitBehavior' in the script). But I felt, that everytime opening in a new window might not scale/be the requirement. Hence I have mapped these two keys to open the file in the previous window. Previous window is the one, you were before going to the file explorer.

Note:
1. This implementation has a minor problem, which I faced. You are working on a split window session, you close the same and later switch to file explorer for opening a desired file. If you press the <CR> or double click left mouse button, then the file will be opened in the file explorer window itself (which might not be desired).

Work around: Make sure the previous window exists, before you goto file explorer for opening file using <CR> or mouse click option. In the above case you can just switch to a valid window and then go to the file explorer for file selection using <CR> or mouse click option.

2. The key 'O' (capital 'o' and not zero) still holds the same old mapping, i.e opening file in new window( the split was based on 'splitBehavior' in the script).
fileexplore.vim 1.0 2005-06-10 6.0 Pradeep Kudethur Initial upload
ip used for rating: 3.141.100.120

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