sponsor Vim development Vim logo Vim Book Ad

files2menu.pm : add all files recursively as menu entry

 script karma  Rating 5/2, Downloaded by 843  Comments, bugs, improvements  Vim wiki

created by
thomas ramming
 
script type
utility
 
description
DESCR     finds files according to predefined file masks in all subdirs starting in parent dir (default).
creates menu commands for gvim for each file found (creates submenues automatically after 40 menu entries).
filemasks and other settings may be easily changed within the perl script for your needs.

Usage: files2menu.pm <options>
options:
                     generate file list on stdout (default)
-o <filelist>       generate filelist in file <filelist>
-v                 generate VIM scriptfile
-v <scriptfile>     generate VIM Scriptfile <scriptfile>
-f <patternlist>   use search pattern <patternlist>
                predefined pattern lists:   CPP, EXE, MAK, GL, DOC, VIM
-m                 create menu entry <menuEntry> for each found file  (blanks allowed in name)
-c                 create submenu after <n> entries
-d                 debug mode
-s <startdir>       start in CWD (default) or parent dir ('..') or <startdir>


I used 'ls' because any other tools had trouble with that genious system of long file names under Windows and Novell.
 
install details
Add a line like the following to your _gvimrc. You will get a menu entry which creates new submenues
with an entry for each C/C++ file found in all paralell directories and below.

'menu 12.10 Proj.Add\ source\ files\ recursiv :exec("!perl ".$VIMRUNTIME."/syntax/files2Menu.pm -f CPP")<CR>:so! files.vim<CR>'

It works fine with Perl (Version 5005_3), ls (GNU fileutils) 3.16 and gvim 5.8

 

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
files2menu.pm 1.0 2001-09-05 5.7 thomas ramming Initial upload
ip used for rating: 3.128.199.88

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