1
- IMPORTANT: comment on: [ What about merging whith Ultisnip using its engine] ( https://github.com/garbas/vim-snipmate/issues/114 )
2
-
3
1
Snipmate & UltiSnip Snippets
4
2
============================
5
3
@@ -9,50 +7,93 @@ It is community-maintained and many people have contributed snippet files and
9
7
other improvements already.
10
8
11
9
Contents
12
- ========
10
+ --------
13
11
14
- snippets/*: snippets using snipmate format
15
- UltiSnips/*: snippets using UltiSnips format
12
+ - ` snippets/* ` : snippets using snipmate format
13
+ - ` UltiSnips/* ` : snippets using UltiSnips format
16
14
17
- Snippet engines
18
- ===============
15
+ Snippet engines supporting vim-snippets
16
+ ----------------------------------------
19
17
20
18
There are different forks of snippet engines which allow the user to insert
21
- sippets by typing the name of a snippet hitting the expansion mapping.
19
+ snippets by typing the name of a snippet hitting the expansion mapping.
20
+
21
+ - [ github.com/SirVer/ultisnips] ( https://github.com/SirVer/ultisnips ) :
22
+ python, supports all snippets in this repo.
23
+ - [ github.com/garbas/vim-snipmate] ( https://github.com/garbas/vim-snipmate ) :
24
+ VimL, snipmate-snippets, engine sometimes behaves strange. Supports
25
+ snippets/*
26
+ - [ github.com/Shougo/neosnippet] ( https://github.com/Shougo/neosnippet.vim ) :
27
+ VimL, supports snippets/* with some configuration.
28
+ - [ github.com/drmingdrmer/xptemplate] ( https://github.com/drmingdrmer/xptemplate ) :
29
+ Totally different syntax, does not read snippets contained in this file, but
30
+ it is also very powerful. It does not support vim-snippets (just listing it
31
+ here for completness)
32
+
33
+ There tries to be a more comprehensive list (which still is incomplete) here:
34
+ http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html
35
+
36
+ UltiSnips has additional features such as high speed, nesting snippets,
37
+ expanding snippets in snippets and offers powerful transformations on text in
38
+ snippets (like visual selections or placeholder texts).
39
+
40
+ Which one to use? If you have python give
41
+ [ SirVer/ultisnips] ( https://github.com/SirVer/ultisnips ) a try because its fast
42
+ and has the most features.
22
43
23
- garbas/vim-snipmate [4]:
24
- VimL, snipmate-snippets, engine sometimes behaves strange, supports
25
- rewriting snippets on the fly (eg adding a second version with folding
26
- markers)
44
+ If you have VimL only (vim without python support) your best option is using
45
+ [ garbas/vim-snipmate] ( https://github.com/garbas/vim-snipmate ) and cope with the
46
+ minor bugs found in the engine.
27
47
28
- MarcWeber/UltiSnips [6]:
29
- python, snipmate-snippets and UltiSnips-snippets
30
48
31
- SirVer/ultisnips [7]:
32
- python, UltiSnips-snippets
49
+ Q: Should "snipmate be deprecated in favour of UltiSnips"?
33
50
34
- github.com/Shougo/neosnippet [5]:
35
- viml, has a compatible mode allowing to reuse most snipmate snippets ?
51
+ A: No, because snimpate is VimL, and UltiSnips requires Python.
52
+ Some people want to use snippets without having to install Vim with Python
53
+ support. Yes - this sucks.
36
54
37
- XPTemplate:
38
- totally different syntax, does not read snippets contained in this file,
39
- but it is also very powerful
55
+ One solution would be: Use snippets if they are good enough, but allow overriding them
56
+ in UltiSnips. This would avoid most duplication while still serving most users.
57
+ AFAIK there is a nested-placeholder branch for snipmate too. snipmate is still
58
+ improved by Adnan Zafar. So maybe time is not ready to make a final decision yet.
40
59
41
- ... there are some more, but they have less features which is why I don't
42
- mention them here
60
+ [ github issue/discussion] ( https://github.com/honza/vim-snippets/issues/363 )
43
61
44
- UltiSnips engine has additional features such as "nested snippets".
62
+ Installation
63
+ ------------
45
64
46
- Which one to use? If you have python give MarcWeber/UltiSnips a try because its
47
- fast and supports all important features. You can prefer the UltiSnip versions
48
- of the snippets by setting the "always_use_first_snippet" option to 1.
65
+ First be aware that there are many options, see "Snippet engines" above.
66
+ Second be aware than there are [ tons of plugin managers] ( http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html )
67
+ which is why Marc Weber thinks that it doesn't make sense to repeat the same
68
+ repetitive information everywhere.
49
69
50
- If you have VimL only (vim without python support) your best option is using
51
- garbas/vim-snipmate and cope with the minor bugs found in the engine.
70
+ * Recommended way:*
71
+ [ vim-addon-manager] ( vim-addon-manager ) (because Marc Weber wrote it for exactly
72
+ this reason, it supports simple dependency management). Eg you're done by this
73
+ line in your .vimrc:
74
+
75
+ ```
76
+ " assuming you want to use snipmate snippet engine
77
+ ActivateAddons vim-snippets snipmate
78
+ ```
79
+
80
+ [ vim-pi] ( https://bitbucket.org/vimcommunity/vim-pi/issue/90/we-really-need-a-web-interface )
81
+ Is the place to discuss plugin managers and repository resources.
82
+
83
+ About how to install snipate see [ snipmate@garbas] ( https://github.com/garbas/vim-snipmate )
52
84
85
+ (Bundle, Pathogen, git clone - keywords to make people find this link by ctrl-f search)
86
+ I know that I should be reading the docs of the snippet engine, just let me copy paste into my .vimrc:
87
+ [ See this pull request] ( https://github.com/honza/vim-snippets/pull/307/files ) .
88
+
89
+ TROUBLE
90
+ =======
91
+ If you still have trouble getting this to work create a github ticket, ask on
92
+ irc or the mailinglist.
53
93
54
94
Policies / for contributors
55
- ===========================
95
+ ---------------------------
96
+
56
97
Some snippets are useful for almost all languages, so let's try to have the same
57
98
triggers for them:
58
99
@@ -64,11 +105,7 @@ el : else ..
64
105
wh : while (cond) ...
65
106
```
66
107
67
- If you're not satisfied with these defaults, open a ticket that we implement
68
- aliasing. Then you can remap "else" to "el" or the like.
69
-
70
-
71
- Don't add stupid placeholder default texts like
108
+ Don't add useless placeholder default texts like
72
109
```
73
110
if (${1:condition}){
74
111
${2:some code here}
@@ -93,9 +130,16 @@ What about one line if ee then .. else .. vs if \n .. then \n ... \n else \n ..
93
130
Which additional policies to add?
94
131
Discuss at: https://github.com/honza/vim-snippets/issues/230
95
132
133
+ * folding markers* :
134
+ Until further work is done on ` vim-snipmate ` , please don't add folding markers
135
+ into snippets. ` vim-snipmate ` has some comments about how to patch all snippets
136
+ on the fly adding those.
137
+
138
+ Currently all snippets from UltiSnips have been put into UltiSnips - some work
139
+ on merging should be done (dropping duplicates etc). Also see engines section above.
96
140
97
141
Related repositories
98
- ====================
142
+ --------------------
99
143
We also encourage people to maintain sets of snippets for particular use cases
100
144
so that all users can benefit from them. People can list their snippet repositories here:
101
145
@@ -106,15 +150,15 @@ so that all users can benefit from them. People can list their snippet reposito
106
150
107
151
Installation using VAM: "github: rbonvall /snipmate-snippets-bib"
108
152
109
-
110
153
Future - ideas - examples
111
- =========================
154
+ -------------------------
155
+
112
156
[ overview snippet engines] ( http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html )
113
157
If you have ideas you can add them to that list of "snippet engine features by example".
114
158
115
159
116
160
Historical notes
117
- ================
161
+ ----------------
118
162
119
163
[ vim-snipmate] [ 1 ] was originally started by [ Michael Sanders] [ 2 ] who has now
120
164
unfortunately abandoned the project. [ Rok Garbas] [ 3 ] is now maintaining a
@@ -138,17 +182,6 @@ let g:snipMate.scope_aliases = {}
138
182
let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'
139
183
```
140
184
141
- or github.com/MarcWeber/UltiSnips this way:
142
-
143
-
144
- ``` vim
145
- let g:UltiSnips = {}
146
-
147
- let g:UltiSnips.snipmate_ft_filter = {
148
- \ 'default' : {'filetypes': ["FILETYPE"] },
149
- \ 'ruby' : {'filetypes': ["ruby", "ruby-rails", "ruby-1.9"] },
150
- ```
151
-
152
185
If it happens that you work on a project requiring ruby-1.8 snippets instead,
153
186
consider using vim-addon-local-vimrc and override the filetypes.
154
187
@@ -160,16 +193,15 @@ ruby-library-version triplet. Sometimes postfixing a name such as
160
193
161
194
will do it then if syntax has changed.
162
195
196
+
163
197
Language maintainers
164
198
--------------------
165
199
166
200
No one can really be proficient in all programming languages. If you would like
167
201
to maintain snippets for a language, please get in touch.
168
202
169
- Notes: People are interested in snippets - and their interest may stop again
170
- at will. So its ok if people maintain a language only for a short period of
171
- time - or jump in and get things done - don't let the flow stop :)
172
- vim-snippets is not like the "linux kernel".
203
+ Notes: People are interested in snippets - and their interest may wane again.
204
+ This list is kept up-to-date on a best effort basis.
173
205
174
206
* Python - [ honza] ( http://github.com/honza )
175
207
* Javascript - [ honza] ( http://github.com/honza )
@@ -181,25 +213,6 @@ vim-snippets is not like the "linux kernel".
181
213
* Falcon - [ steveno] ( https://github.com/steveno )
182
214
* Elixir - [ iurifq] ( https://github.com/iurifq )
183
215
184
- Contributing notes
185
- ------------------
186
-
187
- Until further work is done on ` vim-snipmate ` , please don't add folding markers
188
- into snippets. ` vim-snipmate ` has some comments about how to patch all snippets
189
- on the fly adding those.
190
-
191
- Because MarcWeber/UltiSnips [ 6] supports also snipmate-snippets there is no
192
- need to duplicate all snippets - only those snippets who use advanced UltiSnips
193
- features should be duplicated in UltiSnips (?)
194
-
195
- Currently all snippets from UltiSnips have been put into UltiSnips - some work
196
- on merging should be done (dropping duplicates etc)
197
-
198
- Authors
199
- -------
200
-
201
- For a list of authors, please see the ` AUTHORS ` files.
202
-
203
216
License
204
217
-------
205
218
@@ -211,6 +224,4 @@ terms of the MIT license.
211
224
[ 2 ] : http://github.com/msanders
212
225
[ 3 ] : http://github.com/garbas
213
226
[ 4 ] : http://github.com/garbas/vim-snipmate
214
- [ 5 ] : http://github.com/Shougo/neosnippet
215
- [ 6 ] : http://github.com/MarcWeber/UltiSnips
216
227
[ 7 ] : http://github.com/SirVer/ultisnips
0 commit comments