forked from vim-scripts/UltiSnips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
60 lines (49 loc) · 2.73 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
This is a mirror of http://www.vim.org/scripts/script.php?script_id=2715
UltiSnips is the Ultimate solution for snippets under Vim. Snippets are intelligent texts that spare you a lot of typing. Like many snippets solutions, this one ins heavily inspired by TextMates Snippet Syntax and offers all features that TextMate offers plus some more. But in Vim.
Screencasts:
Intro: http://www.sirver.net/blog/2011/12/30/first-episode-of-ultisnips-screencast/
Basic Snippets: http://www.sirver.net/blog/2012/01/08/second-episode-of-ultisnips-screencast/
Version 2.0s new features: http://www.sirver.net/blog/2012/02/05/third-episode-of-ultisnips-screencast/
UltiSnips has the following features (incomplete list):
- TextMates snippet syntax
- Tabstops, Placeholders (also nested)
- Mirrors and Transformations (also inside Placeholders)
- ShellCode, VimCode and a very powerful PythonCode interpolation
- Live update as you type
- snippets for file types and snippets that are always defined
- same name, multiple snippets
- recursive snippets: snippet in snippet
- forward and backward jumping to placeholders and tab stops
- convert script to download and convert TM bundles, convert script to reuse snipmates snippets.
- automatically reload snippet definition files when they changed.
- extend existing snippet definitions. For example cpp extends c, so that all c snippets are also available in cpp.
- options for snippets: expand only at the beginning of line, inword, convert tabs-to-spaces....
- multi word or regular expression triggers are supported and awesome!
- edit snippets with normal mode commands and move around in them freely while editing
- support for anonymous triggers that other scripts can define on the fly e.g. for automatic completion of parameters of your own functions.
- > 400 unit tests to guarantee that stuff works.
- Tested on Linux, Mac OS X and Windows.
There have been many attempts to do things right; I think, this one nails it.
UltiSnips is a community project, more than 15 people have contributed to it so far. Join in by providing feedback, snippets or code!
Try it:
Example 1:
- open /tmp/file.c
type for<tab>endcounter<c-j>mycounter<c-j><c-j>int a = 3;
yields:
------------------- SNIP -------------------
for(size_t mycounter = 0; mycounter < endcounter; ++mycounter)
{
int a = 3;
}
------------------- SNAP -------------------
Example 2:
- open /tmp/blah.help
- :set ft=help
- type sec<tab>MY COOL SECTION<c-h>blah
yields:
------------------- SNIP -------------------
=============================================================================
MY COOL SECTION *blah-my-cool-section*
blah
------------------- SNAP -------------------
If you like the script, please contact me and vote for the script!