search-in-runtime : Search files through the paths lists, and execute any command on them
script karma |
Rating 31/25,
Downloaded by 4473 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Luc Hermitte |
|
script type |
utility |
|
description |
This plugin extends the command 'runtime' (:h runtime) to execute any command (not only 'source') on files found in the '&runtimepath' option.
It defines the command ":SearchInRuntime" which takes as a first parameter the command to execute and then the search patterns used to search files in the 'runtimepath' directories list.
E.g. 1:
:SearchInRuntime! source here/foo*.vim
is equivalent to :
:runtime! here/foo*.vim
E.g. 2:
:silent exe 'SearchInRuntime 0r there/that.'.&ft
will search 'runtimepath' list for the first file named "that.<filetype>" present in the directory "there", and inserts it in the current buffer. If no file is found, nothing is done.
N.B.: The [!] (bang) character can be used to apply the command to all found files. Otherwise, 'SearchInRuntime' stops after the first file.
Since the version 1.1 :
(*) the 'verbose' option is supported :
>= 0 -> display when no file is found
>= 1 -> display the list of file found
>= 3 -> display the list of directories searched
(*) ':SearchInPATH' : like ':SearchInRuntime', but with $PATH
(*) ':SearchInVar' : works on any list of directories defined in a variable.
(*) Contrary to ':runtime', the search can accept absolute paths, for instance :
:runtime! /usr/local/share/vim/*.vim is not valid while
:SearchInRuntime source /usr/local/share/vim/*.vim is accepted.
Since the version 1.5.:
(*) The commands passed to the different :SearchIn* commands can accept any number of arguments before the names of the files found.To use them, add at the end of the :SearchIn* command: a pipe (' |0 ') and then the list of the other parameters. For instance:
:SearchInRuntime! grep plugin/*foo*.vim |0 text
For every file name plugin/*foo*.vim in the 'runtimepath', this will execute:
:grep text {path-to-the-file}
(*) The commands passed to the different :SearchIn* commands can accept any number of arguments after the names of the files found. To use them, add at the end of the :SearchIn* command: a pipe (' | ') and then the list of the other parameters
:SearchInRuntime! Echo plugin/*foo*.vim | final arguments
For every file name plugin/*foo*.vim in the 'runtimepath', this will execute:
:Echo {path-to-the-file} final arguments
Since Version 2.0.x:
- Custom auto-completion added -- if vim supports it
- New commands: :Split and :Vsplit to split open files found into &path
Since Version 2.1.0:
- new commands for vim7+ only: :GSplit and :GVSplit
- overloaded mapping for vim7+ only: gf and CTRL-W_f
- new mapping: glf that echoes the files in 'path' that match the pattern under the cursor
GSplit, GVSplit, gf and CTRL-W_f permit to help the end-user to select a file among those matching a file-pattern (either given as parameter to the commands, or written under the cursor). If the selected file is already opened in a window, then that window is made the new active window -- this avoid to split-open the same file again and again.
Full documentation available on:
https://github.com/LucHermitte/SearchInRuntime
or within the vimball archive. |
|
install details |
Install search-in-runtime with vim-addon-manager, or get the latest release from https://github.com/LucHermitte/SearchInRuntime#2-installation |
|
script versions (upload new version)
Click on the package to download.
searchInRuntime.tar.gz |
2.1.3 |
2006-01-17 |
6.0 |
Luc Hermitte |
Bug fix: regression introduced on gf and <c-w>f |
searchInRuntime.tar.gz |
2.1.2 |
2006-01-12 |
6.0 |
Luc Hermitte |
* Various bug fixes for :G*split (paths withs spaces, UNC paths, URLs, absolute paths, ... ; factorisation of paths).
* Possibility to choose the names of the "Goto-Or-Split" commands (:G*split).
* New behavior for :G*split: we jump to the first matching window unless the command in banged ; in that latter case, the user is asked to choose the matching file to open/jump-to.
* All these modifications concern only Vim7+ as the corresponding feature is not supported on 6.x versions of Vim. |
searchInRuntime.tar.gz |
2.1.0 |
2005-12-12 |
6.0 |
Luc Hermitte |
Two minor bugfixes. New commands and overridden mappings for vim7+: :GSplit, :GVSplit, gf, CTRL-W_f and glf. When several matching files can be found in 'path', the user is asked which one to open. If it is already opened in a window, that window becomes active. |
searchInRuntime.tar.gz |
2.0.3 |
2005-04-28 |
6.0 |
Luc Hermitte |
Support for "smart" auto-completion added for each command from the plugin -- "smart" means: "respect the parameter position". New commands: :Sp and :Vsp that split open files found into &path ; and :Runtime, another wrapper for :runtime with auto-completion. |
searchInRuntime.tar.gz |
1.6c |
2003-03-29 |
6.0 |
Luc Hermitte |
Bug fix for non-Windows users. |
searchInRuntime.tar.gz |
1.6 |
2002-11-12 |
6.0 |
Luc Hermitte |
Tarball containing the plugin and its documentation. |
searchInRuntime.vim |
1.6 |
2002-11-07 |
6.0 |
Luc Hermitte |
The :SearchIn* commands can pass any number of additional arguments to the "inner" command. SearchInENV changed in SearchInVar. |
searchInRuntime.vim |
1.1 |
2002-04-04 |
6.0 |
Luc Hermitte |
Two more commands : ':SearchInENV' and ':SearchInPATH' ; '&verbose' is supported like with ':runtime'. |
searchInRuntime.vim |
1.0 |
2002-02-25 |
6.0 |
Luc Hermitte |
Initial upload |
ip used for rating: 142.132.191.50
|