snare : Snippets Again, with Regular Expressions
script karma |
Rating 1/1,
Downloaded by 684 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Paul Isambert |
|
script type |
utility |
|
description |
This plugin expands code snippets for which the trigger is a regular
expression; submatches can be reused in the expansion. Along with command
substitution, regular expressions allow the user to define flexible snippets.
A few examples:
- In HTML, expand "<mytag" to
<mytag>$$</mytag>
(with $$ marking the next position of the cursor), no matter what
"mytag" is.
- In Ruby, expand "do" to
do
$$
end
and "do a b c" to
do |a, b, c|
$$
end
with a single pattern.
- In JavaScript, expand "var a b c" to
var a = $$,
b = $$,
c = $$;
- Etc.
The plugin follows a minimalist design, trying to be a simple yet powerful
tool, using Vim's native resources (vim script, search patterns), and avoiding
fancy features. |
|
install details |
See the "Quick start" section of the help file. |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 18.97.14.85
|