Skip to content

Commit ffc7852

Browse files
author
Rene Vergara
committed
Conflicts: snippets/php.snippets
2 parents f8318e9 + 4cdf9db commit ffc7852

File tree

140 files changed

+9686
-4277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+9686
-4277
lines changed

AUTHORS

Lines changed: 0 additions & 43 deletions
This file was deleted.

README.md

Lines changed: 163 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,145 @@
1-
IMPORTANT: comment on: [What about merging whith Ultisnip using its engine](https://github.com/garbas/vim-snipmate/issues/114)
2-
31
Snipmate & UltiSnip Snippets
42
============================
53

64
This repository contains snippets files for various programming languages.
75

8-
It is community-maintained and many people have contributed snippet files and other
9-
improvements already.
6+
It is community-maintained and many people have contributed snippet files and
7+
other improvements already.
108

119
Contents
12-
========
10+
--------
1311

14-
snippets/*: snippets using snipmate format
15-
UltiSnips/*: snippets using UltiSnips format
12+
- `snippets/*`: snippets using snipmate format
13+
- `UltiSnips/*`: snippets using UltiSnips format
1614

17-
Snippet engines
18-
===============
15+
Snippet engines supporting vim-snippets
16+
----------------------------------------
1917

2018
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.
2243

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.
2747

28-
MarcWeber/UltiSnips [6]:
29-
python, snipmate-snippets and UltiSnips-snippets
3048

31-
SirVer/ultisnips [7]:
32-
python, UltiSnips-snippets
49+
Q: Should "snipmate be deprecated in favour of UltiSnips"?
3350

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.
3654

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.
4059

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)
4361

44-
UltiSnips engine has additional features such as "nested snippets".
62+
Installation
63+
------------
4564

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.
4969

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)
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.
93+
94+
Policies / for contributors
95+
---------------------------
96+
97+
Some snippets are useful for almost all languages, so let's try to have the same
98+
triggers for them:
99+
100+
```
101+
if : if without else
102+
ife: if $1 else $2
103+
eif : else if ($1) { .. }
104+
el : else ..
105+
wh : while (cond) ...
106+
```
107+
108+
Don't add useless placeholder default texts like
109+
```
110+
if (${1:condition}){
111+
${2:some code here}
112+
}
113+
```
114+
instead use:
115+
116+
```
117+
if (${1}){
118+
${2}
119+
}
120+
```
121+
122+
Exception: Functions which are used less often, such as Vim's matchall(), matchstr()
123+
functions which case hints may be helpful to remember order. In the VimL case
124+
get vim-dev plugin which has function completion
125+
126+
Thus for conditions (while, if ..) and block bodies just use ${N} - Thanks
127+
128+
Open questions:
129+
What about one line if ee then .. else .. vs if \n .. then \n ... \n else \n .. ?
130+
Which additional policies to add?
131+
Discuss at: https://github.com/honza/vim-snippets/issues/230
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.
52140

53141
Related repositories
54-
====================
142+
--------------------
55143
We also encourage people to maintain sets of snippets for particular use cases
56144
so that all users can benefit from them. People can list their snippet repositories here:
57145

@@ -62,45 +150,68 @@ so that all users can benefit from them. People can list their snippet reposito
62150

63151
Installation using VAM: "github:rbonvall/snipmate-snippets-bib"
64152

153+
Future - ideas - examples
154+
-------------------------
155+
156+
[overview snippet engines](http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html)
157+
If you have ideas you can add them to that list of "snippet engine features by example".
158+
159+
65160
Historical notes
66-
================
161+
----------------
67162

68163
[vim-snipmate][1] was originally started by [Michael Sanders][2] who has now
69164
unfortunately abandoned the project. [Rok Garbas][3] is now maintaining a
70165
[fork][4] of the project in hopes of improving the existing code base.
71166

167+
Versions / dialects / ..
168+
========================
169+
There are some issues, such as newer language versions may require other
170+
snippets than older. If this exists we currently recommend doing this:
171+
172+
add snippets/ruby.snippets (common snippets)
173+
add snippets/ruby-1.8.snippets (1.8 only)
174+
add snippets/ruby-1.9.snippets (1.9 only)
175+
176+
then configure github.com/garbas/vim-snipmate this way:
177+
178+
179+
```vim
180+
let g:snipMate = {}
181+
let g:snipMate.scope_aliases = {}
182+
let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'
183+
```
184+
185+
If it happens that you work on a project requiring ruby-1.8 snippets instead,
186+
consider using vim-addon-local-vimrc and override the filetypes.
187+
188+
Well - of course it may not make sense to create a new file for each
189+
ruby-library-version triplet. Sometimes postfixing a name such as
190+
191+
migrate_lib_20_down
192+
migrate_lib_20_up
193+
194+
will do it then if syntax has changed.
195+
72196

73197
Language maintainers
74198
--------------------
75199

76200
No one can really be proficient in all programming languages. If you would like
77201
to maintain snippets for a language, please get in touch.
78202

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.
205+
79206
* Python - [honza](http://github.com/honza)
80207
* Javascript - [honza](http://github.com/honza)
81208
* HTML Django - [honza](http://github.com/honza)
82209
* Markdown - [honza](http://github.com/honza)
83210
* Ruby - [taq](http://github.com/taq)
84211
* PHP - [chrisyue](http://github.com/chrisyue)
85-
86-
Contributing notes
87-
------------------
88-
89-
Until further work is done on `vim-snipmate`, please don't add folding markers
90-
into snippets. `vim-snipmate` has some comments about how to patch all snippets
91-
on the fly adding those.
92-
93-
Because MarcWeber/UltiSnips [6] supports also snipmate-snippets there is no
94-
need to duplicate all snippets - only those snippets who use advanced UltiSnips
95-
features should be duplicated in UltiSnips (?)
96-
97-
Currently all snippets from UltiSnips have been put into UltiSnips - some work
98-
on merging should be done (dropping duplicates etc)
99-
100-
Authors
101-
-------
102-
103-
For a list of authors, please see the `AUTHORS` files.
212+
* Scala - [gorodinskiy](https://github.com/gorodinskiy)
213+
* Falcon - [steveno](https://github.com/steveno)
214+
* Elixir - [iurifq](https://github.com/iurifq)
104215

105216
License
106217
-------
@@ -113,6 +224,4 @@ terms of the MIT license.
113224
[2]: http://github.com/msanders
114225
[3]: http://github.com/garbas
115226
[4]: http://github.com/garbas/vim-snipmate
116-
[5]: http://github.com/Shougo/neosnippet
117-
[6]: http://github.com/MarcWeber/UltiSnips
118227
[7]: http://github.com/SirVer/ultisnips

UltiSnips/README

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
This directory contains the main scripts that come bundled with UltiSnips.
1+
This directory contains the snippets for UltiSnips.
2+
https://github.com/sirver/ultisnips
23

34
Standing On The Shoulders of Giants
45
===================================
@@ -10,12 +11,7 @@ two projects:
1011
TextMate: http://svn.textmate.org/trunk/Bundles/
1112
SnipMate: http://code.google.com/p/snipmate/
1213

13-
All snippets from those sources were copied and cleaned up, so that they are
14-
- not using shell script, only python (so they are cross platform compatible)
15-
- not using any feature that UltiSnips doesn't offer
16-
17-
UltiSnips has seen contributions by various individuals. Those contributions
18-
have been merged into this collection seamlessly and without further comments.
14+
UltiSnips has seen contributions by many individuals. Those contributions have
15+
been merged into this collection seamlessly and without further comments.
1916

2017
-- vim:ft=rst:nospell:
21-

0 commit comments

Comments
 (0)