1
- Snipmate & UltiSnip Snippets
1
+ snipMate & UltiSnip Snippets
2
2
============================
3
3
4
4
This repository contains snippets files for various programming languages.
@@ -9,7 +9,7 @@ other improvements already.
9
9
Contents
10
10
--------
11
11
12
- - ` snippets/* ` : snippets using snipmate format
12
+ - ` snippets/* ` : snippets using snipMate format
13
13
- ` UltiSnips/* ` : snippets using UltiSnips format
14
14
15
15
Snippet engines supporting vim-snippets
@@ -28,8 +28,8 @@ snippets by typing the name of a snippet hitting the expansion mapping.
28
28
- [ github.com/drmingdrmer/xptemplate] ( https://github.com/drmingdrmer/xptemplate ) :
29
29
Totally different syntax, does not read snippets contained in this file, but
30
30
it is also very powerful. It does not support vim-snippets (just listing it
31
- here for completness )
32
-
31
+ here for completeness )
32
+
33
33
There tries to be a more comprehensive list (which still is incomplete) here:
34
34
http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html
35
35
@@ -45,6 +45,18 @@ If you have VimL only (vim without python support) your best option is using
45
45
[ garbas/vim-snipmate] ( https://github.com/garbas/vim-snipmate ) and cope with the
46
46
minor bugs found in the engine.
47
47
48
+ Q: Should "snipMate be deprecated in favour of UltiSnips"?
49
+
50
+ A: No, because snipMate is VimL, and UltiSnips requires Python.
51
+ Some people want to use snippets without having to install Vim with Python
52
+ support. Yes - this sucks.
53
+
54
+ One solution would be: Use snippets if they are good enough, but allow overriding them
55
+ in UltiSnips. This would avoid most duplication while still serving most users.
56
+ AFAIK there is a nested-placeholder branch for snipMate too. snipMate is still
57
+ improved by Adnan Zafar. So maybe time is not ready to make a final decision yet.
58
+
59
+ [ github issue/discussion] ( https://github.com/honza/vim-snippets/issues/363 )
48
60
49
61
Installation
50
62
------------
@@ -55,28 +67,29 @@ which is why Marc Weber thinks that it doesn't make sense to repeat the same
55
67
repetitive information everywhere.
56
68
57
69
* Recommended way:*
58
- [ vim-addon-manager] ( vim-addon-manager ) (because Marc Weber wrote it for exactly
59
- this reason, it supports simple dependency management). Eg you're done by this
60
- line in your .vimrc:
70
+ [ vim-addon-manager] ( https://github.com/MarcWeber/ vim-addon-manager) (because Marc Weber wrote it for exactly
71
+ this reason, it supports simple dependency management). E.g. you're done by this
72
+ line in your ` .vimrc ` :
61
73
62
- ```
74
+ ``` vim
63
75
" assuming you want to use snipmate snippet engine
64
76
ActivateAddons vim-snippets snipmate
65
77
```
66
78
67
79
[ vim-pi] ( https://bitbucket.org/vimcommunity/vim-pi/issue/90/we-really-need-a-web-interface )
68
80
Is the place to discuss plugin managers and repository resources.
69
81
70
- About how to install snipate see [ snipmate@garbas] ( https://github.com/garbas/vim-snipmate )
82
+ About how to install snipMate see [ snipmate@garbas] ( https://github.com/garbas/vim-snipmate )
71
83
72
84
(Bundle, Pathogen, git clone - keywords to make people find this link by ctrl-f search)
73
- I know that I should be reading the docs of the snippet engine, just let me copy paste into my .vmirc :
74
- ( See this pull request) [ https://github.com/honza/vim-snippets/pull/307/files ] .
85
+ I know that I should be reading the docs of the snippet engine, just let me copy paste into my ` .vimrc ` :
86
+ [ See this pull request] ( https://github.com/honza/vim-snippets/pull/307/files ) .
75
87
76
88
TROUBLE
77
89
=======
78
- If you still have trouble getting this to work create a github ticket, ask on
79
- irc or the mailinglist.
90
+
91
+ If you still have trouble getting this to work create a GitHub ticket, ask on
92
+ IRC or the mailing list.
80
93
81
94
Policies / for contributors
82
95
---------------------------
@@ -92,7 +105,8 @@ el : else ..
92
105
wh : while (cond) ...
93
106
```
94
107
95
- Don't add useless placeholder default texts like
108
+ Don't add useless placeholder default texts like:
109
+
96
110
```
97
111
if (${1:condition}){
98
112
${2:some code here}
@@ -106,7 +120,7 @@ if (${1}){
106
120
}
107
121
```
108
122
109
- Exception: Functions which are used less often, such as Vim's matchall(), matchstr()
123
+ Exception: Functions which are used less often, such as Vim's ` matchall() ` , ` matchstr() `
110
124
functions which case hints may be helpful to remember order. In the VimL case
111
125
get vim-dev plugin which has function completion
112
126
@@ -117,26 +131,33 @@ What about one line if ee then .. else .. vs if \n .. then \n ... \n else \n ..
117
131
Which additional policies to add?
118
132
Discuss at: https://github.com/honza/vim-snippets/issues/230
119
133
134
+ * folding markers* :
135
+ Until further work is done on ` vim-snipmate ` , please don't add folding markers
136
+ into snippets. ` vim-snipmate ` has some comments about how to patch all snippets
137
+ on the fly adding those.
138
+
139
+ Currently all snippets from UltiSnips have been put into UltiSnips - some work
140
+ on merging should be done (dropping duplicates etc). Also see engines section above.
120
141
121
142
Related repositories
122
143
--------------------
144
+
123
145
We also encourage people to maintain sets of snippets for particular use cases
124
146
so that all users can benefit from them. People can list their snippet repositories here:
125
147
126
- * https://github.com/rbonvall/snipmate-snippets-bib (snippets for BibTeX files)
127
- * https://github.com/sudar/vim-arduino-snippets (snippets for Arduino files)
128
- * https://github.com/zedr/zope-snipmate-bundle.git (snippets for Python, TAL and ZCML)
129
- * https://github.com/bonsaiben/bootstrap-snippets (snippets for Twitter Bootstrap markup, in HTML and Haml)
148
+ * https://github.com/rbonvall/snipmate-snippets-bib (snippets for BibTeX files)
149
+ * https://github.com/sudar/vim-arduino-snippets (snippets for Arduino files)
150
+ * https://github.com/zedr/zope-snipmate-bundle.git (snippets for Python, TAL and ZCML)
151
+ * https://github.com/bonsaiben/bootstrap-snippets (snippets for Twitter Bootstrap markup, in HTML and Haml)
130
152
131
- Installation using VAM: "github : rbonvall /snipmate-snippets-bib"
153
+ Installation using VAM: https://github.com/MarcWeber/vim-addon-manager
132
154
133
155
Future - ideas - examples
134
156
-------------------------
135
157
136
158
[ overview snippet engines] ( http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html )
137
159
If you have ideas you can add them to that list of "snippet engine features by example".
138
160
139
-
140
161
Historical notes
141
162
----------------
142
163
@@ -146,15 +167,15 @@ unfortunately abandoned the project. [Rok Garbas][3] is now maintaining a
146
167
147
168
Versions / dialects / ..
148
169
========================
170
+
149
171
There are some issues, such as newer language versions may require other
150
172
snippets than older. If this exists we currently recommend doing this:
151
173
152
- add snippets/ruby.snippets (common snippets)
153
- add snippets/ruby-1.8.snippets (1.8 only)
154
- add snippets/ruby-1.9.snippets (1.9 only)
155
-
156
- then configure github.com/garbas/vim-snipmate this way:
174
+ * add snippets/ruby.snippets (common snippets)
175
+ * add snippets/ruby-1.8.snippets (1.8 only)
176
+ * add snippets/ruby-1.9.snippets (1.9 only)
157
177
178
+ then configure https://github.com/garbas/vim-snipmate this way:
158
179
159
180
``` vim
160
181
let g:snipMate = {}
@@ -163,17 +184,18 @@ let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'
163
184
```
164
185
165
186
If it happens that you work on a project requiring ruby-1.8 snippets instead,
166
- consider using vim-addon-local-vimrc and override the filetypes.
187
+ consider using ` vim-addon-local-vimrc ` and override the filetypes.
167
188
168
189
Well - of course it may not make sense to create a new file for each
169
190
ruby-library-version triplet. Sometimes postfixing a name such as
170
191
171
- migrate_lib_20_down
172
- migrate_lib_20_up
192
+ ```
193
+ migrate_lib_20_down
194
+ migrate_lib_20_up
195
+ ```
173
196
174
197
will do it then if syntax has changed.
175
198
176
-
177
199
Language maintainers
178
200
--------------------
179
201
@@ -193,27 +215,12 @@ This list is kept up-to-date on a best effort basis.
193
215
* Falcon - [ steveno] ( https://github.com/steveno )
194
216
* Elixir - [ iurifq] ( https://github.com/iurifq )
195
217
196
- Contributing notes
197
- ------------------
198
-
199
- Until further work is done on ` vim-snipmate ` , please don't add folding markers
200
- into snippets. ` vim-snipmate ` has some comments about how to patch all snippets
201
- on the fly adding those.
202
-
203
- Because UltiSnips reads snipmate-snippets too there is no need to duplicate all
204
- snippets - only those snippets who use advanced UltiSnips features should be
205
- duplicated in UltiSnips.
206
-
207
- Currently all snippets from UltiSnips have been put into UltiSnips - some work
208
- on merging should be done (dropping duplicates etc)
209
-
210
218
License
211
219
-------
212
220
213
221
Just as the original snipMate plugin, all the snippets are licensed under the
214
222
terms of the MIT license.
215
223
216
-
217
224
[ 1 ] : http://github.com/garbas/vim-snipmate
218
225
[ 2 ] : http://github.com/msanders
219
226
[ 3 ] : http://github.com/garbas
0 commit comments