mirror of
https://github.com/amix/vimrc
synced 2025-07-07 17:05:00 +08:00
renamed sources_non_forked folder to bundle
This commit is contained in:
20
bundle/vim-snippets/LICENSE
Normal file
20
bundle/vim-snippets/LICENSE
Normal file
@ -0,0 +1,20 @@
|
||||
Copyright (c) 2011 see AUTHORS
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
221
bundle/vim-snippets/README.md
Normal file
221
bundle/vim-snippets/README.md
Normal file
@ -0,0 +1,221 @@
|
||||
Snipmate & UltiSnip Snippets
|
||||
============================
|
||||
|
||||
This repository contains snippets files for various programming languages.
|
||||
|
||||
It is community-maintained and many people have contributed snippet files and
|
||||
other improvements already.
|
||||
|
||||
Contents
|
||||
--------
|
||||
|
||||
- `snippets/*`: snippets using snipmate format
|
||||
- `UltiSnips/*`: snippets using UltiSnips format
|
||||
|
||||
Snippet engines supporting vim-snippets
|
||||
----------------------------------------
|
||||
|
||||
There are different forks of snippet engines which allow the user to insert
|
||||
snippets by typing the name of a snippet hitting the expansion mapping.
|
||||
|
||||
- [github.com/SirVer/ultisnips](https://github.com/SirVer/ultisnips):
|
||||
python, supports all snippets in this repo.
|
||||
- [github.com/garbas/vim-snipmate](https://github.com/garbas/vim-snipmate):
|
||||
VimL, snipmate-snippets, engine sometimes behaves strange. Supports
|
||||
snippets/*
|
||||
- [github.com/Shougo/neosnippet](https://github.com/Shougo/neosnippet.vim):
|
||||
VimL, supports snippets/* with some configuration.
|
||||
- [github.com/drmingdrmer/xptemplate](https://github.com/drmingdrmer/xptemplate):
|
||||
Totally different syntax, does not read snippets contained in this file, but
|
||||
it is also very powerful. It does not support vim-snippets (just listing it
|
||||
here for completness)
|
||||
|
||||
There tries to be a more comprehensive list (which still is incomplete) here:
|
||||
http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html
|
||||
|
||||
UltiSnips has additional features such as high speed, nesting snippets,
|
||||
expanding snippets in snippets and offers powerful transformations on text in
|
||||
snippets (like visual selections or placeholder texts).
|
||||
|
||||
Which one to use? If you have python give
|
||||
[SirVer/ultisnips](https://github.com/SirVer/ultisnips) a try because its fast
|
||||
and has the most features.
|
||||
|
||||
If you have VimL only (vim without python support) your best option is using
|
||||
[garbas/vim-snipmate](https://github.com/garbas/vim-snipmate) and cope with the
|
||||
minor bugs found in the engine.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
First be aware that there are many options, see "Snippet engines" above.
|
||||
Second be aware than there are [tons of plugin managers](http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html)
|
||||
which is why Marc Weber thinks that it doesn't make sense to repeat the same
|
||||
repetitive information everywhere.
|
||||
|
||||
*Recommended way:*
|
||||
[vim-addon-manager](vim-addon-manager) (because Marc Weber wrote it for exactly
|
||||
this reason, it supports simple dependency management). Eg you're done by this
|
||||
line in your .vimrc:
|
||||
|
||||
```
|
||||
" assuming you want to use snipmate snippet engine
|
||||
ActivateAddons vim-snippets snipmate
|
||||
```
|
||||
|
||||
[vim-pi](https://bitbucket.org/vimcommunity/vim-pi/issue/90/we-really-need-a-web-interface)
|
||||
Is the place to discuss plugin managers and repository resources.
|
||||
|
||||
About how to install snipate see [snipmate@garbas](https://github.com/garbas/vim-snipmate)
|
||||
|
||||
(Bundle, Pathogen, git clone - keywords to make people find this link by ctrl-f search)
|
||||
I know that I should be reading the docs of the snippet engine, just let me copy paste into my .vmirc:
|
||||
(See this pull request)[https://github.com/honza/vim-snippets/pull/307/files].
|
||||
|
||||
TROUBLE
|
||||
=======
|
||||
If you still have trouble getting this to work create a github ticket, ask on
|
||||
irc or the mailinglist.
|
||||
|
||||
Policies / for contributors
|
||||
---------------------------
|
||||
|
||||
Some snippets are useful for almost all languages, so let's try to have the same
|
||||
triggers for them:
|
||||
|
||||
```
|
||||
if : if without else
|
||||
ife: if $1 else $2
|
||||
eif : else if ($1) { .. }
|
||||
el : else ..
|
||||
wh : while (cond) ...
|
||||
```
|
||||
|
||||
Don't add useless placeholder default texts like
|
||||
```
|
||||
if (${1:condition}){
|
||||
${2:some code here}
|
||||
}
|
||||
```
|
||||
instead use:
|
||||
|
||||
```
|
||||
if (${1}){
|
||||
${2}
|
||||
}
|
||||
```
|
||||
|
||||
Exception: Functions which are used less often, such as Vim's matchall(), matchstr()
|
||||
functions which case hints may be helpful to remember order. In the VimL case
|
||||
get vim-dev plugin which has function completion
|
||||
|
||||
Thus for conditions (while, if ..) and block bodies just use ${N} - Thanks
|
||||
|
||||
Open questions:
|
||||
What about one line if ee then .. else .. vs if \n .. then \n ... \n else \n .. ?
|
||||
Which additional policies to add?
|
||||
Discuss at: https://github.com/honza/vim-snippets/issues/230
|
||||
|
||||
|
||||
Related repositories
|
||||
--------------------
|
||||
We also encourage people to maintain sets of snippets for particular use cases
|
||||
so that all users can benefit from them. People can list their snippet repositories here:
|
||||
|
||||
* https://github.com/rbonvall/snipmate-snippets-bib (snippets for BibTeX files)
|
||||
* https://github.com/sudar/vim-arduino-snippets (snippets for Arduino files)
|
||||
* https://github.com/zedr/zope-snipmate-bundle.git (snippets for Python, TAL and ZCML)
|
||||
* https://github.com/bonsaiben/bootstrap-snippets (snippets for Twitter Bootstrap markup, in HTML and Haml)
|
||||
|
||||
Installation using VAM: "github:rbonvall/snipmate-snippets-bib"
|
||||
|
||||
Future - ideas - examples
|
||||
-------------------------
|
||||
|
||||
[overview snippet engines](http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html)
|
||||
If you have ideas you can add them to that list of "snippet engine features by example".
|
||||
|
||||
|
||||
Historical notes
|
||||
----------------
|
||||
|
||||
[vim-snipmate][1] was originally started by [Michael Sanders][2] who has now
|
||||
unfortunately abandoned the project. [Rok Garbas][3] is now maintaining a
|
||||
[fork][4] of the project in hopes of improving the existing code base.
|
||||
|
||||
Versions / dialects / ..
|
||||
========================
|
||||
There are some issues, such as newer language versions may require other
|
||||
snippets than older. If this exists we currently recommend doing this:
|
||||
|
||||
add snippets/ruby.snippets (common snippets)
|
||||
add snippets/ruby-1.8.snippets (1.8 only)
|
||||
add snippets/ruby-1.9.snippets (1.9 only)
|
||||
|
||||
then configure github.com/garbas/vim-snipmate this way:
|
||||
|
||||
|
||||
```vim
|
||||
let g:snipMate = {}
|
||||
let g:snipMate.scope_aliases = {}
|
||||
let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'
|
||||
```
|
||||
|
||||
If it happens that you work on a project requiring ruby-1.8 snippets instead,
|
||||
consider using vim-addon-local-vimrc and override the filetypes.
|
||||
|
||||
Well - of course it may not make sense to create a new file for each
|
||||
ruby-library-version triplet. Sometimes postfixing a name such as
|
||||
|
||||
migrate_lib_20_down
|
||||
migrate_lib_20_up
|
||||
|
||||
will do it then if syntax has changed.
|
||||
|
||||
|
||||
Language maintainers
|
||||
--------------------
|
||||
|
||||
No one can really be proficient in all programming languages. If you would like
|
||||
to maintain snippets for a language, please get in touch.
|
||||
|
||||
Notes: People are interested in snippets - and their interest may wane again.
|
||||
This list is kept up-to-date on a best effort basis.
|
||||
|
||||
* Python - [honza](http://github.com/honza)
|
||||
* Javascript - [honza](http://github.com/honza)
|
||||
* HTML Django - [honza](http://github.com/honza)
|
||||
* Markdown - [honza](http://github.com/honza)
|
||||
* Ruby - [taq](http://github.com/taq)
|
||||
* PHP - [chrisyue](http://github.com/chrisyue)
|
||||
* Scala - [gorodinskiy](https://github.com/gorodinskiy)
|
||||
* Falcon - [steveno](https://github.com/steveno)
|
||||
* Elixir - [iurifq](https://github.com/iurifq)
|
||||
|
||||
Contributing notes
|
||||
------------------
|
||||
|
||||
Until further work is done on `vim-snipmate`, please don't add folding markers
|
||||
into snippets. `vim-snipmate` has some comments about how to patch all snippets
|
||||
on the fly adding those.
|
||||
|
||||
Because UltiSnips reads snipmate-snippets too there is no need to duplicate all
|
||||
snippets - only those snippets who use advanced UltiSnips features should be
|
||||
duplicated in UltiSnips.
|
||||
|
||||
Currently all snippets from UltiSnips have been put into UltiSnips - some work
|
||||
on merging should be done (dropping duplicates etc)
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Just as the original snipMate plugin, all the snippets are licensed under the
|
||||
terms of the MIT license.
|
||||
|
||||
|
||||
[1]: http://github.com/garbas/vim-snipmate
|
||||
[2]: http://github.com/msanders
|
||||
[3]: http://github.com/garbas
|
||||
[4]: http://github.com/garbas/vim-snipmate
|
||||
[7]: http://github.com/SirVer/ultisnips
|
17
bundle/vim-snippets/UltiSnips/README
Normal file
17
bundle/vim-snippets/UltiSnips/README
Normal file
@ -0,0 +1,17 @@
|
||||
This directory contains the snippets for UltiSnips.
|
||||
https://github.com/sirver/ultisnips
|
||||
|
||||
Standing On The Shoulders of Giants
|
||||
===================================
|
||||
|
||||
The snippets have been collected from various other project which I want to
|
||||
express my gratitude for. My main source for inspiration where the following
|
||||
two projects:
|
||||
|
||||
TextMate: http://svn.textmate.org/trunk/Bundles/
|
||||
SnipMate: http://code.google.com/p/snipmate/
|
||||
|
||||
UltiSnips has seen contributions by many individuals. Those contributions have
|
||||
been merged into this collection seamlessly and without further comments.
|
||||
|
||||
-- vim:ft=rst:nospell:
|
123
bundle/vim-snippets/UltiSnips/all.snippets
Normal file
123
bundle/vim-snippets/UltiSnips/all.snippets
Normal file
@ -0,0 +1,123 @@
|
||||
# This file contains snippets that are always defined. I personally
|
||||
# have snippets for signatures and often needed texts
|
||||
|
||||
# sligthly lower priority than everything else since specialized versions
|
||||
# should overwrite. The user needs to adjust her priority in her snippets to
|
||||
# ~-55 so that other filetypes will still overwrite.
|
||||
priority -60
|
||||
|
||||
##############
|
||||
# NICE BOXES #
|
||||
##############
|
||||
global !p
|
||||
import string, vim
|
||||
|
||||
""" Maps a filetype to comment format used for boxes.
|
||||
Automatically filled during usage"""
|
||||
_commentDict = { }
|
||||
|
||||
def _parse_comments(s):
|
||||
""" Parses vim's comments option to extract comment format """
|
||||
i = iter(s.split(","))
|
||||
|
||||
rv = []
|
||||
try:
|
||||
while True:
|
||||
# get the flags and text of a comment part
|
||||
flags, text = next(i).split(':', 1)
|
||||
|
||||
if len(flags) == 0:
|
||||
rv.append((text, text, text, ""))
|
||||
# parse 3-part comment, but ignore those with O flag
|
||||
elif flags[0] == 's' and 'O' not in flags:
|
||||
ctriple = []
|
||||
indent = ""
|
||||
|
||||
if flags[-1] in string.digits:
|
||||
indent = " " * int(flags[-1])
|
||||
ctriple.append(text)
|
||||
|
||||
flags,text = next(i).split(':', 1)
|
||||
assert(flags[0] == 'm')
|
||||
ctriple.append(text)
|
||||
|
||||
flags,text = next(i).split(':', 1)
|
||||
assert(flags[0] == 'e')
|
||||
ctriple.append(text)
|
||||
ctriple.append(indent)
|
||||
|
||||
rv.append(ctriple)
|
||||
elif flags[0] == 'b':
|
||||
if len(text) == 1:
|
||||
rv.insert(0, (text,text,text, ""))
|
||||
except StopIteration:
|
||||
return rv
|
||||
|
||||
def _get_comment_format():
|
||||
""" Returns a 4-element tuple representing the comment format for
|
||||
the current file. """
|
||||
return _parse_comments(vim.eval("&comments"))[0]
|
||||
|
||||
|
||||
def make_box(twidth, bwidth=None):
|
||||
b, m, e, i = _get_comment_format()
|
||||
bwidth_inner = bwidth - 3 - max(len(b), len(i + e)) if bwidth else twidth + 2
|
||||
sline = b + m + bwidth_inner * m[0] + 2 * m[0]
|
||||
nspaces = (bwidth_inner - twidth) // 2
|
||||
mlines = i + m + " " + " " * nspaces
|
||||
mlinee = " " + " "*(bwidth_inner - twidth - nspaces) + m
|
||||
eline = i + m + bwidth_inner * m[0] + 2 * m[0] + e
|
||||
return sline, mlines, mlinee, eline
|
||||
|
||||
def foldmarker():
|
||||
"Return a tuple of (open fold marker, close fold marker)"
|
||||
return vim.eval("&foldmarker").split(",")
|
||||
|
||||
endglobal
|
||||
|
||||
snippet box "A nice box with the current comment symbol" b
|
||||
`!p
|
||||
box = make_box(len(t[1]))
|
||||
snip.rv = box[0] + '\n' + box[1]
|
||||
`${1:content}`!p
|
||||
box = make_box(len(t[1]))
|
||||
snip.rv = box[2] + '\n' + box[3]`
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet bbox "A nice box over the full width" b
|
||||
`!p
|
||||
width = int(vim.eval("&textwidth")) or 71
|
||||
box = make_box(len(t[1]), width)
|
||||
snip.rv = box[0] + '\n' + box[1]
|
||||
`${1:content}`!p
|
||||
box = make_box(len(t[1]), width)
|
||||
snip.rv = box[2] + '\n' + box[3]`
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet fold "Insert a vim fold marker" b
|
||||
`!p snip.rv = _get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]`${2:1} `!p snip.rv = _get_comment_format()[2]`
|
||||
endsnippet
|
||||
|
||||
snippet foldc "Insert a vim fold close marker" b
|
||||
`!p snip.rv = _get_comment_format()[0]` ${2:1}`!p snip.rv = foldmarker()[1]` `!p snip.rv = _get_comment_format()[2]`
|
||||
endsnippet
|
||||
|
||||
snippet foldp "Insert a vim fold marker pair" b
|
||||
`!p snip.rv = _get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]` `!p snip.rv = _get_comment_format()[2]`
|
||||
${2:${VISUAL:Content}}
|
||||
`!p snip.rv = _get_comment_format()[0]` `!p snip.rv = foldmarker()[1]` $1 `!p snip.rv = _get_comment_format()[2]`
|
||||
endsnippet
|
||||
|
||||
##########################
|
||||
# LOREM IPSUM GENERATORS #
|
||||
##########################
|
||||
snippet lorem "Lorem Ipsum - 50 Words" b
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
|
||||
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
|
||||
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
|
||||
no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
52
bundle/vim-snippets/UltiSnips/bib.snippets
Normal file
52
bundle/vim-snippets/UltiSnips/bib.snippets
Normal file
@ -0,0 +1,52 @@
|
||||
priority -50
|
||||
|
||||
snippet online "Online resource" b
|
||||
@online{${1:name},
|
||||
author={${2:author}},
|
||||
title={${3:title}},
|
||||
date={${4:date}},
|
||||
url={${5:url}}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet article "Article reference" b
|
||||
@article{${1:name},
|
||||
author={${2:author}},
|
||||
title={${3:title}},
|
||||
journaltitle={${4:journal}},
|
||||
volume={${5:NN}},
|
||||
number={${6:NN}},
|
||||
year={${7:YYYY}},
|
||||
pages={${8:NN}--${9:NN}}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet book "Book reference" b
|
||||
@book{${1:name},
|
||||
author={${2:author}},
|
||||
title={${3:title}},
|
||||
subtitle={${4:subtitle}},
|
||||
year={${5:YYYY}},
|
||||
location={${6:somewhere}},
|
||||
publisher={${7:publisher}},
|
||||
pages={${8:NN}--${9:NN}}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet inb "In Book reference" b
|
||||
@inbook{${1:name},
|
||||
author={${2:author}},
|
||||
title={${3:title}},
|
||||
subtitle={${4:subtitle}},
|
||||
booktitle={${5:book}},
|
||||
editor={${6:editor}},
|
||||
year={${7:YYYY}},
|
||||
location={${8:somewhere}},
|
||||
publisher={${9:publisher}},
|
||||
pages={${10:NN}--${11:NN}}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
29
bundle/vim-snippets/UltiSnips/bindzone.snippets
Normal file
29
bundle/vim-snippets/UltiSnips/bindzone.snippets
Normal file
@ -0,0 +1,29 @@
|
||||
priority -50
|
||||
|
||||
global !p
|
||||
def newsoa():
|
||||
import datetime
|
||||
now = datetime.datetime.now()
|
||||
# return standard SOA formatted serial for today
|
||||
return now.strftime("%Y%m%d00")
|
||||
endglobal
|
||||
|
||||
snippet zone "Bootstrap a new Bind zonefile" b
|
||||
$TTL 86400
|
||||
@ IN SOA ${1:example.net}. ${2:hostmaster.$1}.(
|
||||
`!p snip.rv = newsoa()`; serial
|
||||
21600; refresh every 6 hours
|
||||
3600; retry after one hour
|
||||
604800; expire after a week
|
||||
86400 ); minimum TTL of 1 day
|
||||
|
||||
IN NS ns01.$1.
|
||||
IN MX 10 mail.$1.
|
||||
|
||||
ns01.$1 IN A
|
||||
mail.$1 IN A
|
||||
endsnippet
|
||||
|
||||
snippet A "Insert A Record" b
|
||||
${1:hostname} IN A ${2:ip}
|
||||
endsnippet
|
155
bundle/vim-snippets/UltiSnips/c.snippets
Normal file
155
bundle/vim-snippets/UltiSnips/c.snippets
Normal file
@ -0,0 +1,155 @@
|
||||
###########################################################################
|
||||
# TextMate Snippets #
|
||||
###########################################################################
|
||||
|
||||
priority -50
|
||||
|
||||
snippet def "#define ..."
|
||||
#define ${1}
|
||||
endsnippet
|
||||
|
||||
snippet ifndef "#ifndef ... #define ... #endif"
|
||||
#ifndef ${1/([A-Za-z0-9_]+).*/$1/}
|
||||
#define ${1:SYMBOL} ${2:value}
|
||||
#endif
|
||||
endsnippet
|
||||
|
||||
snippet #if "#if #endif" b
|
||||
#if ${1:0}
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::code)/}}
|
||||
#endif
|
||||
endsnippet
|
||||
|
||||
snippet inc "#include local header (inc)"
|
||||
#include "${1:`!p snip.rv = snip.basename + '.h'`}"
|
||||
endsnippet
|
||||
|
||||
snippet Inc "#include <> (Inc)"
|
||||
#include <${1:.h}>
|
||||
endsnippet
|
||||
|
||||
snippet mark "#pragma mark (mark)"
|
||||
#if 0
|
||||
${1:#pragma mark -
|
||||
}#pragma mark $2
|
||||
#endif
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet main "main() (main)"
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
return 0;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet for "for loop (for)"
|
||||
for (${2:i} = 0; $2 < ${1:count}; ${3:++$2})
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fori "for int loop (fori)"
|
||||
for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2})
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet enum "Enumeration"
|
||||
enum ${1:name} { $0 };
|
||||
endsnippet
|
||||
|
||||
snippet once "Include header once only guard"
|
||||
#ifndef ${1:`!p
|
||||
if not snip.c:
|
||||
import random, string
|
||||
name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper()
|
||||
rand = ''.join(random.sample(string.ascii_letters+string.digits, 8))
|
||||
snip.rv = ('%s_%s' % (name,rand)).upper()
|
||||
else:
|
||||
snip.rv = snip.c`}
|
||||
#define $1
|
||||
|
||||
${0}
|
||||
|
||||
#endif /* end of include guard: $1 */
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet td "Typedef"
|
||||
typedef ${1:int} ${2:MyCustomType};
|
||||
endsnippet
|
||||
|
||||
snippet wh "while loop"
|
||||
while(${1:/* condition */}) {
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet do "do...while loop (do)"
|
||||
do {
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
} while(${1:/* condition */});
|
||||
endsnippet
|
||||
|
||||
snippet fprintf "fprintf ..."
|
||||
fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%%)*(%.)?.*/(?2:\);)/}
|
||||
endsnippet
|
||||
|
||||
snippet if "if .. (if)"
|
||||
if (${1:/* condition */})
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet el "else .. (else)"
|
||||
else {
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet eli "else if .. (eli)"
|
||||
else if (${1:/* condition */}) {
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ife "if .. else (ife)"
|
||||
if (${1:/* condition */})
|
||||
{
|
||||
${2:/* code */}
|
||||
}
|
||||
else
|
||||
{
|
||||
${3:/* else */}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet printf "printf .. (printf)"
|
||||
printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/}
|
||||
endsnippet
|
||||
|
||||
snippet st "struct"
|
||||
struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`}
|
||||
{
|
||||
${0:/* data */}
|
||||
};
|
||||
endsnippet
|
||||
|
||||
snippet fun "function" b
|
||||
${1:void} ${2:function_name}(${3})
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fund "function declaration" b
|
||||
${1:void} ${2:function_name}(${3});
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
96
bundle/vim-snippets/UltiSnips/coffee.snippets
Normal file
96
bundle/vim-snippets/UltiSnips/coffee.snippets
Normal file
@ -0,0 +1,96 @@
|
||||
priority -50
|
||||
|
||||
snippet fun "Function" b
|
||||
${1:name} = `!p snip.rv = "(" if t[2] else ""`${2:args}`!p snip.rv = ") " if t[2] else ""`->
|
||||
${0:# body...}
|
||||
endsnippet
|
||||
|
||||
snippet bfun "Function (bound)" i
|
||||
`!p snip.rv = "(" if t[1] else ""`${1:args}`!p snip.rv = ") " if t[1] else ""`=>`!p snip.rv = " " if t[2] and not t[2].startswith("\n") else ""`${2:expr}
|
||||
endsnippet
|
||||
|
||||
snippet if "If" b
|
||||
if ${1:condition}
|
||||
${0:# body...}
|
||||
endsnippet
|
||||
|
||||
snippet ife "If .. Else" b
|
||||
if ${1:condition}
|
||||
${2:# body...}
|
||||
else
|
||||
${3:# body...}
|
||||
endsnippet
|
||||
|
||||
snippet elif "Else if" b
|
||||
else if ${1:condition}
|
||||
${0:# body...}
|
||||
endsnippet
|
||||
|
||||
snippet ifte "Ternary if" b
|
||||
if ${1:condition} then ${2:value} else ${3:other}
|
||||
endsnippet
|
||||
|
||||
snippet unl "Unless" b
|
||||
${1:action} unless ${2:condition}
|
||||
endsnippet
|
||||
|
||||
snippet fora "Array Comprehension" b
|
||||
for ${1:name} in ${2:array}
|
||||
${0:# body...}
|
||||
endsnippet
|
||||
|
||||
snippet foro "Object Comprehension" b
|
||||
for ${1:key}, ${2:value} of ${3:Object}
|
||||
${0:# body...}
|
||||
endsnippet
|
||||
|
||||
snippet forr "Range Comprehension (inclusive)" b
|
||||
for ${1:name} in [${2:start}..${3:finish}]`!p snip.rv = " by " if t[4] else ""`${4:step}
|
||||
${0:# body...}
|
||||
endsnippet
|
||||
|
||||
snippet forrex "Range Comprehension (exclusive)" b
|
||||
for ${1:name} in [${2:start}...${3:finish}]`!p snip.rv = " by " if t[4] else ""`${4:step}
|
||||
${0:# body...}
|
||||
endsnippet
|
||||
|
||||
snippet swi "Switch" b
|
||||
switch ${1:object}
|
||||
when ${2:value}
|
||||
${3:# body...}
|
||||
else
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet swit "Switch when .. then" b
|
||||
switch ${1:object}
|
||||
when ${2:condition}`!p snip.rv = " then " if t[3] else ""`${3:value}
|
||||
else`!p snip.rv = " " if t[4] and not t[4].startswith("\n") else ""`${4:value}
|
||||
endsnippet
|
||||
|
||||
snippet cla "Class" b
|
||||
class ${1:ClassName}`!p snip.rv = " extends " if t[2] else ""`${2:Ancestor}
|
||||
|
||||
${3:constructor:`!p snip.rv = " (" if t[4] else ""`${4:args}`!p snip.rv = ")" if t[4] else ""` ->
|
||||
${5:# body...}}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet try "Try .. Catch" b
|
||||
try
|
||||
$1
|
||||
catch ${2:error}
|
||||
$3
|
||||
endsnippet
|
||||
|
||||
snippet req "Require" b
|
||||
${1/^'?(\w+)'?$/\L$1\E/} = require(${1:'${2:sys}'})
|
||||
endsnippet
|
||||
|
||||
snippet # "Interpolated Code" i
|
||||
#{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet log "Log" b
|
||||
console.log ${1:"${2:msg}"}
|
||||
endsnippet
|
166
bundle/vim-snippets/UltiSnips/coffee_jasmine.snippets
Normal file
166
bundle/vim-snippets/UltiSnips/coffee_jasmine.snippets
Normal file
@ -0,0 +1,166 @@
|
||||
#
|
||||
# CoffeeScript versions -- adapted from the JS TextMate bundle + additions
|
||||
# for some jasmine-jquery matchers
|
||||
#
|
||||
priority -50
|
||||
|
||||
extends coffee
|
||||
|
||||
priority -49
|
||||
|
||||
snippet des "Describe (coffee)" b
|
||||
describe '${1:description}', ->
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet it "it (coffee)" b
|
||||
it '${1:description}', ->
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet bef "before each (coffee)" b
|
||||
beforeEach ->
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet aft "after each (coffee)" b
|
||||
afterEach ->
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet any "any (coffee)" b
|
||||
jasmine.any($1)
|
||||
endsnippet
|
||||
|
||||
snippet ru "runs (coffee)" b
|
||||
runs ->
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet wa "waits (coffee)" b
|
||||
waits($1)
|
||||
endsnippet
|
||||
|
||||
snippet ex "expect (coffee)" b
|
||||
expect(${1:target})$0
|
||||
endsnippet
|
||||
|
||||
snippet ee "expect to equal (coffee)" b
|
||||
expect(${1:target}).toEqual(${2:value})
|
||||
endsnippet
|
||||
|
||||
snippet em "expect to match (coffee)" b
|
||||
expect(${1:target}).toMatch(${2:pattern})
|
||||
endsnippet
|
||||
|
||||
snippet eha "expect to have attribute (coffee)" b
|
||||
expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'})
|
||||
endsnippet
|
||||
|
||||
snippet et "expect to be truthy (coffee)" b
|
||||
expect(${1:target}).toBeTruthy()
|
||||
endsnippet
|
||||
|
||||
snippet ef "expect to be falsy (coffee)" b
|
||||
expect(${1:target}).toBeFalsy()
|
||||
endsnippet
|
||||
|
||||
snippet ed "expect to be defined (coffee)" b
|
||||
expect(${1:target}).toBeDefined()
|
||||
endsnippet
|
||||
|
||||
snippet en "expect to be null (coffee)" b
|
||||
expect(${1:target}).toBeNull()
|
||||
endsnippet
|
||||
|
||||
snippet ec "expect to contain (coffee)" b
|
||||
expect(${1:target}).toContain(${2:value})
|
||||
endsnippet
|
||||
|
||||
snippet ev "expect to be visible (coffee)" b
|
||||
expect(${1:target}).toBeVisible()
|
||||
endsnippet
|
||||
|
||||
snippet eh "expect to be hidden (coffee)" b
|
||||
expect(${1:target}).toBeHidden()
|
||||
endsnippet
|
||||
|
||||
snippet notx "expect not (coffee)" b
|
||||
expect(${1:target}).not$0
|
||||
endsnippet
|
||||
|
||||
snippet note "expect not to equal (coffee)" b
|
||||
expect(${1:target}).not.toEqual(${2:value})
|
||||
endsnippet
|
||||
|
||||
snippet notm "expect not to match (coffee)" b
|
||||
expect(${1:target}).not.toMatch(${2:pattern})
|
||||
endsnippet
|
||||
|
||||
snippet notha "expect to not have attribute (coffee)" b
|
||||
expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'})
|
||||
endsnippet
|
||||
|
||||
snippet nott "expect not to be truthy (coffee)" b
|
||||
expect(${1:target}).not.toBeTruthy()
|
||||
endsnippet
|
||||
|
||||
snippet notf "expect not to be falsy (coffee)" b
|
||||
expect(${1:target}).not.toBeFalsy()
|
||||
endsnippet
|
||||
|
||||
snippet notd "expect not to be defined (coffee)" b
|
||||
expect(${1:target}).not.toBeDefined()
|
||||
endsnippet
|
||||
|
||||
snippet notn "expect not to be null (coffee)" b
|
||||
expect(${1:target}).not.toBeNull()
|
||||
endsnippet
|
||||
|
||||
snippet notc "expect not to contain (coffee)" b
|
||||
expect(${1:target}).not.toContain(${2:value})
|
||||
endsnippet
|
||||
|
||||
snippet notv "expect not to be visible (coffee)" b
|
||||
expect(${1:target}).not.toBeVisible()
|
||||
endsnippet
|
||||
|
||||
snippet noth "expect not to be hidden (coffee)" b
|
||||
expect(${1:target}).not.toBeHidden()
|
||||
endsnippet
|
||||
|
||||
snippet s "spy on (coffee)" b
|
||||
spyOn(${1:object}, "${2:method}")$0
|
||||
endsnippet
|
||||
|
||||
snippet sr "spy on and return (coffee)" b
|
||||
spyOn(${1:object}, "${2:method}").andReturn(${3:arguments})
|
||||
endsnippet
|
||||
|
||||
snippet st "spy on and throw (coffee)" b
|
||||
spyOn(${1:object}, "${2:method}").andThrow(${3:exception})
|
||||
endsnippet
|
||||
|
||||
snippet sct "spy on and call through (coffee)" b
|
||||
spyOn(${1:object}, "${2:method}").andCallThrough()
|
||||
endsnippet
|
||||
|
||||
snippet scf "spy on and call fake (coffee)" b
|
||||
spyOn(${1:object}, "${2:method}").andCallFake(${3:function})
|
||||
endsnippet
|
||||
|
||||
snippet esc "expect was called (coffee)" b
|
||||
expect(${1:target}).wasCalled()
|
||||
endsnippet
|
||||
|
||||
snippet escw "expect was called with (coffee)" b
|
||||
expect(${1:target}).wasCalledWith(${2:arguments})
|
||||
endsnippet
|
||||
|
||||
snippet notsc "expect was not called (coffee)" b
|
||||
expect(${1:target}).wasNotCalled()
|
||||
endsnippet
|
||||
|
||||
snippet noscw "expect was not called with (coffee)" b
|
||||
expect(${1:target}).wasNotCalledWith(${2:arguments})
|
||||
endsnippet
|
57
bundle/vim-snippets/UltiSnips/cpp.snippets
Normal file
57
bundle/vim-snippets/UltiSnips/cpp.snippets
Normal file
@ -0,0 +1,57 @@
|
||||
priority -50
|
||||
|
||||
extends c
|
||||
|
||||
# We want to overwrite everything in parent ft.
|
||||
priority -49
|
||||
|
||||
###########################################################################
|
||||
# TextMate Snippets #
|
||||
###########################################################################
|
||||
snippet beginend "$1.begin(), $1.end() (beginend)"
|
||||
${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}begin(), $1${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}end()
|
||||
endsnippet
|
||||
|
||||
snippet cl "class .. (class)"
|
||||
class ${1:`!p snip.rv = snip.basename or "name"`}
|
||||
{
|
||||
public:
|
||||
${1/(\w+).*/$1/} (${2:arguments});
|
||||
virtual ~${1/(\w+).*/$1/} ();
|
||||
|
||||
private:
|
||||
${0:/* data */}
|
||||
};
|
||||
endsnippet
|
||||
|
||||
snippet ns "namespace .. (namespace)"
|
||||
namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`}
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}${1/.+/ \/* /m}$1${1/.+/ *\/ /m}
|
||||
endsnippet
|
||||
|
||||
snippet readfile "read file (readF)"
|
||||
std::vector<char> v;
|
||||
if (FILE *fp = fopen(${1:"filename"}, "r"))
|
||||
{
|
||||
char buf[1024];
|
||||
while(size_t len = fread(buf, 1, sizeof(buf), fp))
|
||||
v.insert(v.end(), buf, buf + len);
|
||||
fclose(fp);
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet map "std::map (map)"
|
||||
std::map<${1:key}, ${2:value}> map$0;
|
||||
endsnippet
|
||||
|
||||
snippet vector "std::vector (v)"
|
||||
std::vector<${1:char}> v$0;
|
||||
endsnippet
|
||||
|
||||
snippet tp "template <typename ..> (template)"
|
||||
template <typename ${1:_InputIter}>
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
328
bundle/vim-snippets/UltiSnips/cs.snippets
Normal file
328
bundle/vim-snippets/UltiSnips/cs.snippets
Normal file
@ -0,0 +1,328 @@
|
||||
#######################################################################
|
||||
# C# Snippets for UltiSnips #
|
||||
#######################################################################
|
||||
|
||||
priority -50
|
||||
|
||||
#########################
|
||||
# classes and structs #
|
||||
#########################
|
||||
|
||||
snippet namespace "namespace" b
|
||||
namespace ${1:MyNamespace}
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet class "class" w
|
||||
class ${1:MyClass}
|
||||
{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet struct "struct" w
|
||||
struct ${1:MyStruct}
|
||||
{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet interface "interface" w
|
||||
interface I${1:Interface}
|
||||
{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet enum "enumeration" b
|
||||
enum ${1:MyEnum} { ${2:Item} };
|
||||
endsnippet
|
||||
|
||||
|
||||
############
|
||||
# Main() #
|
||||
############
|
||||
|
||||
snippet sim "static int main" b
|
||||
static int Main(string[] args)
|
||||
{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet svm "static void main" b
|
||||
static void Main(string[] args)
|
||||
{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
################
|
||||
# properties #
|
||||
################
|
||||
|
||||
snippet prop "Simple property declaration" b
|
||||
public ${1:int} ${2:MyProperty} { get; set; }
|
||||
endsnippet
|
||||
|
||||
snippet propfull "Full property declaration" b
|
||||
private ${1:int} ${2:_myProperty};
|
||||
|
||||
public $1 ${3:MyProperty}
|
||||
{
|
||||
get { return $2; }
|
||||
set { $2 = value; }
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet propg "Property with a private setter" b
|
||||
public ${1:int} ${2:MyProperty} { get; private set; }
|
||||
endsnippet
|
||||
|
||||
|
||||
############
|
||||
# blocks #
|
||||
############
|
||||
|
||||
snippet #if "#if #endif" b
|
||||
#if ${1:DEBUG}
|
||||
${VISUAL}$0
|
||||
#endif
|
||||
endsnippet
|
||||
|
||||
snippet #region "#region #endregion" b
|
||||
#region ${1:Region}
|
||||
${VISUAL}$0
|
||||
#endregion
|
||||
endsnippet
|
||||
|
||||
|
||||
###########
|
||||
# loops #
|
||||
###########
|
||||
|
||||
snippet for "for loop" b
|
||||
for (int ${1:i} = 0; $1 < ${2:10}; $1++)
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet forr "for loop (reverse)" b
|
||||
for (int ${1:i} = ${2:10}; $1 >= 0; $1--)
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet foreach "foreach loop" b
|
||||
foreach (${3:var} ${2:item} in ${1:items})
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet while "while loop" b
|
||||
while (${1:true})
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet do "do loop" b
|
||||
do
|
||||
{
|
||||
${VISUAL}$0
|
||||
} while (${1:true});
|
||||
endsnippet
|
||||
|
||||
|
||||
###############
|
||||
# branching #
|
||||
###############
|
||||
|
||||
snippet if "if statement" b
|
||||
if ($1)
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ife "if else statement" b
|
||||
if ($1)
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet elif "else if" b
|
||||
else if ($1)
|
||||
{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet elseif "else if" b
|
||||
else if ($1)
|
||||
{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ifnn "if not null" b
|
||||
if ($1 != null)
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet switch "switch statement" b
|
||||
switch (${1:statement})
|
||||
{
|
||||
case ${2:value}:
|
||||
break;
|
||||
|
||||
default:
|
||||
$0break;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet case "case" b
|
||||
case ${1:value}:
|
||||
$2
|
||||
break;
|
||||
endsnippet
|
||||
|
||||
|
||||
##############
|
||||
# wrappers #
|
||||
##############
|
||||
|
||||
snippet using "using statement" b
|
||||
using (${1:resource})
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet unchecked "unchecked block" b
|
||||
unchecked
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet checked "checked block" b
|
||||
checked
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet unsafe "unsafe" b
|
||||
unsafe
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
########################
|
||||
# exception handling #
|
||||
########################
|
||||
|
||||
snippet try "try catch block" b
|
||||
try
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
catch (${1:Exception} ${2:e})
|
||||
{
|
||||
throw;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet tryf "try finally block" b
|
||||
try
|
||||
{
|
||||
${VISUAL}$0
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet throw "throw"
|
||||
throw new ${1}Exception("${2}");
|
||||
endsnippet
|
||||
|
||||
|
||||
##########
|
||||
# LINQ #
|
||||
##########
|
||||
|
||||
snippet from "LINQ syntax" b
|
||||
var ${1:seq} =
|
||||
from ${2:item1} in ${3:items1}
|
||||
join ${4:item2} in ${5:items2} on $2.${6:prop1} equals $4.${7:prop2}
|
||||
select ${8:$2.prop3}
|
||||
where ${9:clause}
|
||||
endsnippet
|
||||
|
||||
|
||||
############################
|
||||
# feedback and debugging #
|
||||
############################
|
||||
|
||||
snippet da "Debug.Assert" b
|
||||
Debug.Assert(${1:true});
|
||||
endsnippet
|
||||
|
||||
snippet cw "Console.WriteLine" b
|
||||
Console.WriteLine("$1");
|
||||
endsnippet
|
||||
|
||||
# as you first type comma-separated parameters on the right, {n} values appear in the format string
|
||||
snippet cwp "Console.WriteLine with parameters" b
|
||||
Console.WriteLine("${2:`!p
|
||||
snip.rv = ' '.join(['{' + str(i) + '}' for i in range(t[1].count(','))])
|
||||
`}"${1:, something});
|
||||
endsnippet
|
||||
|
||||
snippet mbox "Message box" b
|
||||
MessageBox.Show("${1:message}");
|
||||
endsnippet
|
||||
|
||||
|
||||
##################
|
||||
# full methods #
|
||||
##################
|
||||
|
||||
snippet equals "Equals method" b
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || GetType() != obj.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$0
|
||||
return base.Equals(obj);
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
##############
|
||||
# comments #
|
||||
##############
|
||||
|
||||
snippet /// "XML comment" b
|
||||
/// <summary>
|
||||
/// $1
|
||||
/// </summary>
|
||||
endsnippet
|
407
bundle/vim-snippets/UltiSnips/css.snippets
Normal file
407
bundle/vim-snippets/UltiSnips/css.snippets
Normal file
@ -0,0 +1,407 @@
|
||||
###########################################################################
|
||||
# Most of these came from TextMate #
|
||||
###########################################################################
|
||||
|
||||
priority -50
|
||||
|
||||
snippet ! "!important CSS (!)"
|
||||
${1:!important}
|
||||
endsnippet
|
||||
|
||||
snippet fixed "Fixed Position Bottom 100% wide IE6"
|
||||
${2:bottom: auto;}top: expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-${1:THE HEIGHT OF THIS THING IN PIXELS}));
|
||||
${3:left: expression(eval(document.documentElement.scrollLeft));
|
||||
}${4:width: expression(eval(document.documentElement.clientWidth));}$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background-attachment: scroll:fixed (background)"
|
||||
background-attachment: ${1:scroll/fixed};$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background-color: color-hex (background)"
|
||||
background-color: #${1:DDD};$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background-color: color-name (background)"
|
||||
background-color: ${1:red};$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background-color: color-rgb (background)"
|
||||
background-color: rgb(${1:255},${2:255},${3:255});$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background-color: transparent (background)"
|
||||
background-color: transparent;$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background-image: none (background)"
|
||||
background-image: none;$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background-image: url (background)"
|
||||
background-image: url($1);$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background-position: position (background)"
|
||||
background-position: ${1:top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x-% y-%/x-pos y-pos};$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background-repeat: r:r-x:r-y:n-r (background)"
|
||||
background-repeat: ${1:repeat/repeat-x/repeat-y/no-repeat};$0
|
||||
endsnippet
|
||||
|
||||
snippet background "background: color image repeat attachment position (background)"
|
||||
background:${6: #${1:DDD}} url($2) ${3:repeat/repeat-x/repeat-y/no-repeat} ${4:scroll/fixed} ${5:top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x-% y-%/x-pos y-pos};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-bottom-color: size style color (border)"
|
||||
border-bottom-color: #${1:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-bottom-style: size style color (border)"
|
||||
border-bottom-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-bottom-width: size style color (border)"
|
||||
border-bottom-width: ${1:1}px ${2:solid} #${3:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-bottom: size style color (border)"
|
||||
border-bottom: ${1:1}px ${2:solid} #${3:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-color: color (border)"
|
||||
border-color: ${1:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-left-color: color (border)"
|
||||
border-right-color: #${1:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-left-style: style (border)"
|
||||
border-left-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-left-width: size (border)"
|
||||
border-left-width: ${1:1}px
|
||||
endsnippet
|
||||
|
||||
snippet border "border-left: size style color (border)"
|
||||
border-left: ${1:1}px ${2:solid} #${3:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-right-color: color (border)"
|
||||
border-right-color: #${1:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-right-style: style (border)"
|
||||
border-right-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-right-width: size (border)"
|
||||
border-right-width: ${1:1}px
|
||||
endsnippet
|
||||
|
||||
snippet border "border-right: size style color (border)"
|
||||
border-right: ${1:1}px ${2:solid} #${3:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-style: style (border)"
|
||||
border-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-top-color: color (border)"
|
||||
border-top-color: #${1:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-top-style: style (border)"
|
||||
border-top-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-top-width: size (border)"
|
||||
border-top-width: ${1:1}px
|
||||
endsnippet
|
||||
|
||||
snippet border "border-top: size style color (border)"
|
||||
border-top: ${1:1}px ${2:solid} #${3:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border-width: width (border)"
|
||||
border-width: ${1:1px};$0
|
||||
endsnippet
|
||||
|
||||
snippet border "border: size style color (border)"
|
||||
border: ${1:1px} ${2:solid} #${3:999};$0
|
||||
endsnippet
|
||||
|
||||
snippet clear "clear: value (clear)"
|
||||
clear: ${1:left/right/both/none};$0
|
||||
endsnippet
|
||||
|
||||
snippet color "color: color-hex (color)"
|
||||
color: #${1:DDD};$0
|
||||
endsnippet
|
||||
|
||||
snippet color "color: color-name (color)"
|
||||
color: ${1:red};$0
|
||||
endsnippet
|
||||
|
||||
snippet color "color: color-rgb (color)"
|
||||
color: rgb(${1:255},${2:255},${3:255});$0
|
||||
endsnippet
|
||||
|
||||
snippet cursor "cursor: type (cursor)"
|
||||
cursor: ${1:default/auto/crosshair/pointer/move/*-resize/text/wait/help};$0
|
||||
endsnippet
|
||||
|
||||
snippet cursor "cursor: url (cursor)"
|
||||
cursor: url($1);$0
|
||||
endsnippet
|
||||
|
||||
snippet direction "direction: ltr|rtl (direction)"
|
||||
direction: ${1:ltr|rtl};$0
|
||||
endsnippet
|
||||
|
||||
snippet display "display: block (display)"
|
||||
display: block;$0
|
||||
endsnippet
|
||||
|
||||
snippet display "display: common-types (display)"
|
||||
display: ${1:none/inline/block/list-item/run-in/compact/marker};$0
|
||||
endsnippet
|
||||
|
||||
snippet display "display: inline (display)"
|
||||
display: inline;$0
|
||||
endsnippet
|
||||
|
||||
snippet display "display: table-types (display)"
|
||||
display: ${1:table/inline-table/table-row-group/table-header-group/table-footer-group/table-row/table-column-group/table-column/table-cell/table-caption};$0
|
||||
endsnippet
|
||||
|
||||
snippet float "float: left:right:none (float)"
|
||||
float: ${1:left/right/none};$0
|
||||
endsnippet
|
||||
|
||||
snippet font "font-family: family (font)"
|
||||
font-family: ${1:Arial, "MS Trebuchet"}, ${2:sans-}serif;$0
|
||||
endsnippet
|
||||
|
||||
snippet font "font-size: size (font)"
|
||||
font-size: ${1:100%};$0
|
||||
endsnippet
|
||||
|
||||
snippet font "font-style: normal:italic:oblique (font)"
|
||||
font-style: ${1:normal/italic/oblique};$0
|
||||
endsnippet
|
||||
|
||||
snippet font "font-variant: normal:small-caps (font)"
|
||||
font-variant: ${1:normal/small-caps};$0
|
||||
endsnippet
|
||||
|
||||
snippet font "font-weight: weight (font)"
|
||||
font-weight: ${1:normal/bold};$0
|
||||
endsnippet
|
||||
|
||||
snippet font "font: style variant weight size:line-height font -family (font)"
|
||||
font: ${1:normal/italic/oblique} ${2:normal/small-caps} ${3:normal/bold} ${4:1em/1.5em} ${5:Arial}, ${6:sans-}serif;$0
|
||||
endsnippet
|
||||
|
||||
snippet font "font: size font (font)"
|
||||
font: ${1:75%} ${2:"Lucida Grande", "Trebuchet MS", Verdana,} ${3:sans-}serif;$0
|
||||
endsnippet
|
||||
|
||||
snippet letter "letter-spacing: length-em (letter)"
|
||||
letter-spacing: $1em;$0
|
||||
endsnippet
|
||||
|
||||
snippet letter "letter-spacing: length-px (letter)"
|
||||
letter-spacing: $1px;$0
|
||||
endsnippet
|
||||
|
||||
snippet list "list-style-image: url (list)"
|
||||
list-style-image: url($1);$0
|
||||
endsnippet
|
||||
|
||||
snippet list "list-style-position: pos (list)"
|
||||
list-style-position: ${1:inside/outside};$0
|
||||
endsnippet
|
||||
|
||||
snippet list "list-style-type: asian (list)"
|
||||
list-style-type: ${1:cjk-ideographic/hiragana/katakana/hiragana-iroha/katakana-iroha};$0
|
||||
endsnippet
|
||||
|
||||
snippet list "list-style-type: marker(list)"
|
||||
list-style-type: ${1:none/disc/circle/square};$0
|
||||
endsnippet
|
||||
|
||||
snippet list "list-style-type: numeric (list)"
|
||||
list-style-type: ${1:decimal/decimal-leading-zero/zero};$0
|
||||
endsnippet
|
||||
|
||||
snippet list "list-style-type: other (list)"
|
||||
list-style-type: ${1:hebrew/armenian/georgian};$0
|
||||
endsnippet
|
||||
|
||||
snippet list "list-style-type: roman-alpha-greek (list)"
|
||||
list-style-type: ${1:lower-roman/upper-roman/lower-alpha/upper-alpha/lower-greek/lower-latin/upper-latin};$0
|
||||
endsnippet
|
||||
|
||||
snippet list "list-style: type position image (list)"
|
||||
list-style: ${1:none/disc/circle/square/decimal/zero} ${2:inside/outside} url($3);$0
|
||||
endsnippet
|
||||
|
||||
snippet margin "margin-bottom: length (margin)"
|
||||
margin-bottom: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet margin "margin-left: length (margin)"
|
||||
margin-left: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet margin "margin-right: length (margin)"
|
||||
margin-right: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet margin "margin-top: length (margin)"
|
||||
margin-top: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet margin "margin: all (margin)"
|
||||
margin: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet margin "margin: T R B L (margin)"
|
||||
margin: ${1:20px} ${2:0px} ${3:40px} ${4:0px};$0
|
||||
endsnippet
|
||||
|
||||
snippet margin "margin: V H (margin)"
|
||||
margin: ${1:20px} ${2:0px};$0
|
||||
endsnippet
|
||||
|
||||
snippet marker "marker-offset: auto (marker)"
|
||||
marker-offset: auto;$0
|
||||
endsnippet
|
||||
|
||||
snippet marker "marker-offset: length (marker)"
|
||||
marker-offset: ${1:10px};$0
|
||||
endsnippet
|
||||
|
||||
snippet overflow "overflow: type (overflow)"
|
||||
overflow: ${1:visible/hidden/scroll/auto};$0
|
||||
endsnippet
|
||||
|
||||
snippet padding "padding-bottom: length (margin)"
|
||||
padding-bottom: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet padding "padding-left: length (margin)"
|
||||
padding-left: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet padding "padding-right: length (margin)"
|
||||
padding-right: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet padding "padding-top: length (margin)"
|
||||
padding-top: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet padding "padding: T R B L (padding)"
|
||||
padding: ${1:20px} ${2:0px} ${3:40px} ${4:0px};$0
|
||||
endsnippet
|
||||
|
||||
snippet padding "padding: V H (padding)"
|
||||
padding: ${1:20px} ${2:0px};$0
|
||||
endsnippet
|
||||
|
||||
snippet padding "padding: all (padding)"
|
||||
padding: ${1:20px};$0
|
||||
endsnippet
|
||||
|
||||
snippet position "position: type (position)"
|
||||
position: ${1:static/relative/absolute/fixed};$0
|
||||
endsnippet
|
||||
|
||||
snippet { "properties { } ( } )"
|
||||
{
|
||||
/* $1 */
|
||||
$0
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet scrollbar "scrollbar"
|
||||
scrollbar-base-color: ${1:#CCCCCC};${2:
|
||||
scrollbar-arrow-color: ${3:#000000};
|
||||
scrollbar-track-color: ${4:#999999};
|
||||
scrollbar-3dlight-color: ${5:#EEEEEE};
|
||||
scrollbar-highlight-color: ${6:#FFFFFF};
|
||||
scrollbar-face-color: ${7:#CCCCCC};
|
||||
scrollbar-shadow-color: ${9:#999999};
|
||||
scrollbar-darkshadow-color: ${8:#666666};}
|
||||
endsnippet
|
||||
|
||||
snippet selection "selection"
|
||||
$1::-moz-selection,
|
||||
$1::selection {
|
||||
color: ${2:inherit};
|
||||
background: ${3:inherit};
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet text "text-align: left:center:right (txt)"
|
||||
text-align: ${1:left/right/center/justify};$0
|
||||
endsnippet
|
||||
|
||||
snippet text "text-decoration: none:underline:overline:line-through:blink (text)"
|
||||
text-decoration: ${1:none/underline/overline/line-through/blink};$0
|
||||
endsnippet
|
||||
|
||||
snippet text "text-indent: length (text)"
|
||||
text-indent: ${1:10}px;$0
|
||||
endsnippet
|
||||
|
||||
snippet text "text-shadow: color-hex x y blur (text)"
|
||||
text-shadow: #${1:DDD} ${2:10px} ${3:10px} ${4:2px};$0
|
||||
endsnippet
|
||||
|
||||
snippet text "text-shadow: color-rgb x y blur (text)"
|
||||
text-shadow: rgb(${1:255},${2:255},${3:255}) ${4:10px} ${5:10px} ${6:2px};$0
|
||||
endsnippet
|
||||
|
||||
snippet text "text-shadow: none (text)"
|
||||
text-shadow: none;$0
|
||||
endsnippet
|
||||
|
||||
snippet text "text-transform: capitalize:upper:lower (text)"
|
||||
text-transform: ${1:capitalize/uppercase/lowercase};$0
|
||||
endsnippet
|
||||
|
||||
snippet text "text-transform: none (text)"
|
||||
text-transform: none;$0
|
||||
endsnippet
|
||||
|
||||
snippet vertical "vertical-align: type (vertical)"
|
||||
vertical-align: ${1:baseline/sub/super/top/text-top/middle/bottom/text-bottom/length/%};$0
|
||||
endsnippet
|
||||
|
||||
snippet visibility "visibility: type (visibility)"
|
||||
visibility: ${1:visible/hidden/collapse};$0
|
||||
endsnippet
|
||||
|
||||
snippet white "white-space: normal:pre:nowrap (white)"
|
||||
white-space: ${1:normal/pre/nowrap};$0
|
||||
endsnippet
|
||||
|
||||
snippet word "word-spacing: length (word)"
|
||||
word-spacing: ${1:10px};$0
|
||||
endsnippet
|
||||
|
||||
snippet word "word-spacing: normal (word)"
|
||||
word-spacing: normal;$0
|
||||
endsnippet
|
||||
|
||||
snippet z "z-index: index (z)"
|
||||
z-index: $1;$0
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
584
bundle/vim-snippets/UltiSnips/d.snippets
Normal file
584
bundle/vim-snippets/UltiSnips/d.snippets
Normal file
@ -0,0 +1,584 @@
|
||||
# Simple shortcuts
|
||||
|
||||
priority -50
|
||||
|
||||
snippet imp "import (imp)" b
|
||||
import ${1:std.stdio};
|
||||
endsnippet
|
||||
|
||||
snippet pimp "public import (pimp)" b
|
||||
public import ${1:/*module*/};
|
||||
endsnippet
|
||||
|
||||
snippet over "override (over)" b
|
||||
override ${1:/*function*/}
|
||||
endsnippet
|
||||
|
||||
snippet al "alias (al)"
|
||||
alias ${1:/*orig*/} ${2:/*alias*/};
|
||||
endsnippet
|
||||
|
||||
snippet mixin "mixin (mixin)" b
|
||||
mixin ${1:/*mixed_in*/} ${2:/*name*/};
|
||||
endsnippet
|
||||
|
||||
snippet new "new (new)"
|
||||
new ${1}(${2});
|
||||
endsnippet
|
||||
|
||||
snippet scpn "@safe const pure nothrow (scpn)"
|
||||
@safe const pure nothrow
|
||||
endsnippet
|
||||
|
||||
snippet spn "@safe pure nothrow (spn)"
|
||||
@safe pure nothrow
|
||||
endsnippet
|
||||
|
||||
snippet cont "continue (cont)"
|
||||
continue;
|
||||
endsnippet
|
||||
|
||||
snippet dis "@disable (dis)" b
|
||||
@disable ${1:/*method*/};
|
||||
endsnippet
|
||||
|
||||
snippet pub "public (pub)" b
|
||||
public:
|
||||
${1:/*members*/}
|
||||
endsnippet
|
||||
|
||||
snippet priv "private (priv)" b
|
||||
private:
|
||||
${1:/*members*/}
|
||||
endsnippet
|
||||
|
||||
snippet prot "protected (prot)" b
|
||||
protected:
|
||||
${1:/*members*/}
|
||||
endsnippet
|
||||
|
||||
snippet pack "package (pack)" b
|
||||
package:
|
||||
${1:/*members*/}
|
||||
endsnippet
|
||||
|
||||
snippet ret "return (ret)"
|
||||
return ${1:/*value to return*/};
|
||||
endsnippet
|
||||
|
||||
snippet auto "auto (auto)" b
|
||||
auto ${1:/*variable*/} = ${2:/*value*/};
|
||||
endsnippet
|
||||
|
||||
snippet con "const (con)" b
|
||||
const ${1:/*variable*/} = ${2:/*value*/};
|
||||
endsnippet
|
||||
|
||||
snippet siz "size_t (siz)" b
|
||||
size_t ${1:/*variable*/} = ${2:/*value*/};
|
||||
endsnippet
|
||||
|
||||
snippet sup "super (sup)" b
|
||||
super(${1:/*args*/});
|
||||
endsnippet
|
||||
|
||||
# Phobos
|
||||
|
||||
snippet tup "tuple (tup)"
|
||||
tuple(${1:/*args*/})
|
||||
endsnippet
|
||||
|
||||
snippet wr "writeln (wr)"
|
||||
writeln(${1:/*args*/});
|
||||
endsnippet
|
||||
|
||||
snippet to "to (to)"
|
||||
to!(${1:/*type*/})(${2:/*arg*/})
|
||||
endsnippet
|
||||
|
||||
snippet enf "enforce (enf)" b
|
||||
enforce(${1:/*condition*/},
|
||||
new ${2}Exception(${3:/*args*/}));
|
||||
endsnippet
|
||||
|
||||
# Branches
|
||||
|
||||
snippet if "if .. (if)"
|
||||
if(${1:/*condition*/})
|
||||
{
|
||||
${VISUAL}${0:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ife "if .. else (ife)" b
|
||||
if(${1:/*condition*/})
|
||||
{
|
||||
${2:/*code*/}
|
||||
}
|
||||
else
|
||||
{
|
||||
${3:/*else*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet el "else (el)" b
|
||||
else
|
||||
{
|
||||
${VISUAL}${1:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet elif "else if (elif)" b
|
||||
else if(${1:/*condition*/})
|
||||
{
|
||||
${VISUAL}${0:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet sw "switch (sw)"
|
||||
switch(${1:/*var*/})
|
||||
{
|
||||
case ${2:/*value*/}:
|
||||
${3:/*code*/}
|
||||
break;
|
||||
case ${4:/*value*/}:
|
||||
${5:/*code*/}
|
||||
break;
|
||||
${7:/*more cases*/}
|
||||
default:
|
||||
${6:assert(false);}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fsw "final switch (fsw)"
|
||||
switch(${1:/*var*/})
|
||||
{
|
||||
case ${2:/*value*/}:
|
||||
${3:/*code*/}
|
||||
break;
|
||||
case ${4:/*value*/}:
|
||||
${5:/*code*/}
|
||||
break;
|
||||
${7:/*more cases*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet case "case (case)" b
|
||||
case ${1:/*value*/}:
|
||||
${2:/*code*/}
|
||||
break;
|
||||
endsnippet
|
||||
|
||||
snippet ?: "ternary operator (?:)"
|
||||
${1:/*condition*/} ? ${2:/*then*/} : ${3:/*else*/}$4
|
||||
endsnippet
|
||||
|
||||
# Loops
|
||||
|
||||
snippet do "do while (do)" b
|
||||
do
|
||||
{
|
||||
${VISUAL}${2:/*code*/}
|
||||
} while(${1:/*condition*/});
|
||||
endsnippet
|
||||
|
||||
snippet wh "while (wh)" b
|
||||
while(${1:/*condition*/})
|
||||
{
|
||||
${VISUAL}${2:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet for "for (for)" b
|
||||
for (${4:size_t} ${2:i} = 0; $2 < ${1:count}; ${3:++$2})
|
||||
{
|
||||
${VISUAL}${0:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet forever "forever (forever)" b
|
||||
for(;;)
|
||||
{
|
||||
${VISUAL}${0:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fore "foreach (fore)"
|
||||
foreach(${1:/*elem*/}; ${2:/*range*/})
|
||||
{
|
||||
${VISUAL}${3:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet forif "foreach if (forif)" b
|
||||
foreach(${1:/*elem*/}; ${2:/*range*/}) if(${3:/*condition*/})
|
||||
{
|
||||
${VISUAL}${4:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# Contracts
|
||||
snippet in "in contract (in)" b
|
||||
in
|
||||
{
|
||||
assert(${1:/*condition*/}, "${2:error message}");
|
||||
${3}
|
||||
}
|
||||
body
|
||||
endsnippet
|
||||
|
||||
snippet out "out contract (out)" b
|
||||
out${1:(result)}
|
||||
{
|
||||
assert(${2:/*condition*/}, "${3:error message}");
|
||||
${4}
|
||||
}
|
||||
body
|
||||
endsnippet
|
||||
|
||||
snippet inv "invariant (inv)" b
|
||||
invariant()
|
||||
{
|
||||
assert(${1:/*condition*/}, "${2:error message}");
|
||||
${3}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# Functions (generic)
|
||||
|
||||
snippet fun "function definition (fun)"
|
||||
${1:void} ${2:/*function name*/}(${3:/*args*/}) ${4:@safe pure nothrow}
|
||||
{
|
||||
${VISUAL}${5:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet void "void function definition (void)"
|
||||
void ${1:/*function name*/}(${2:/*args*/}) ${3:@safe pure nothrow}
|
||||
{
|
||||
${VISUAL}${4:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet this "ctor (this)" w
|
||||
this(${1:/*args*/})
|
||||
{
|
||||
${VISUAL}${2:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet get "getter property (get)"
|
||||
@property ${1:/*type*/} ${2:/*member_name*/}() const pure nothrow {return ${3:$2_};}
|
||||
endsnippet
|
||||
|
||||
snippet set "setter property (set)"
|
||||
@property void ${1:/*member_name*/}(${2:/*type*/} rhs) pure nothrow {${3:$1_} = rhs;}
|
||||
endsnippet
|
||||
|
||||
# Functions (concrete)
|
||||
|
||||
snippet main "Main" b
|
||||
void main(string[] args)
|
||||
{
|
||||
${VISUAL}${0: /*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# Mixins
|
||||
|
||||
snippet signal "signal (signal)" b
|
||||
mixin Signal!(${1:/*args*/}) ${2:/*name*/};
|
||||
endsnippet
|
||||
|
||||
# Scope
|
||||
|
||||
snippet scope "scope (scope)" b
|
||||
scope(${1:exit})
|
||||
{
|
||||
${VISUAL}${2:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# With
|
||||
|
||||
snippet with "with (with)"
|
||||
with(${1})
|
||||
{
|
||||
${VISUAL}${2:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# Exception handling
|
||||
|
||||
snippet try "try/catch (try)" b
|
||||
try
|
||||
{
|
||||
${VISUAL}${1:/*code to try*/}
|
||||
}
|
||||
catch(${2}Exception e)
|
||||
{
|
||||
${3:/*handle exception*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet tryf "try/catch/finally (tryf)" b
|
||||
try
|
||||
{
|
||||
${VISUAL}${1:/*code to try*/}
|
||||
}
|
||||
catch(${2}Exception e)
|
||||
{
|
||||
${3:/*handle exception*/}
|
||||
}
|
||||
finally
|
||||
{
|
||||
${4:/*cleanup*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet catch "catch (catch)" b
|
||||
catch(${1}Exception e)
|
||||
{
|
||||
${2:/*handle exception*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet thr "throw (thr)"
|
||||
throw new ${1}Exception("${2}");
|
||||
endsnippet
|
||||
|
||||
|
||||
# Type declarations
|
||||
|
||||
snippet struct "struct (struct)"
|
||||
struct ${1:`!p snip.rv = (snip.basename or "name")`}
|
||||
{
|
||||
${2}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet union "union (union)"
|
||||
union ${1:`!p snip.rv = (snip.basename or "name")`}
|
||||
{
|
||||
${2}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet class "class (class)"
|
||||
class ${1:`!p snip.rv = (snip.basename or "name")`}
|
||||
{
|
||||
${2}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet inter "interface (inter)"
|
||||
interface ${1:`!p snip.rv = (snip.basename or "name")`}
|
||||
{
|
||||
${2}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet enum "enum (enum)"
|
||||
enum ${1:`!p snip.rv = (snip.basename or "name")`}
|
||||
{
|
||||
${2}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
# Exception declarations
|
||||
|
||||
snippet exc "exception declaration (exc)" b
|
||||
/// ${3:/*documentation*/}
|
||||
class ${1}Exception : ${2}Exception
|
||||
{
|
||||
public this(string msg, string file = __FILE__, int line = __LINE__)
|
||||
{
|
||||
super(msg, file, line);
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
# Conditional compilation
|
||||
|
||||
snippet version "version (version)" b
|
||||
version(${1:/*version name*/})
|
||||
{
|
||||
${VISUAL}${2:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet debug "debug" b
|
||||
debug
|
||||
{
|
||||
${VISUAL}${1:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
# Templates
|
||||
|
||||
snippet temp "template (temp)" b
|
||||
template ${2:/*name*/}(${1:/*args*/})
|
||||
{
|
||||
${3:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
# Asserts
|
||||
|
||||
snippet ass "assert (ass)" b
|
||||
assert(${1:false}, "${2:TODO}");
|
||||
|
||||
endsnippet
|
||||
|
||||
|
||||
# Unittests
|
||||
|
||||
snippet unittest "unittest (unittest)" b
|
||||
unittest
|
||||
{
|
||||
${1:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
# Common member functions
|
||||
|
||||
snippet opDis "opDispatch (opDis)" b
|
||||
${1:/*return type*/} opDispatch(string s)()
|
||||
{
|
||||
${2:/*code*/};
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet op= "opAssign (op=)" b
|
||||
void opAssign(${1} rhs) ${2:@safe pure nothrow}
|
||||
{
|
||||
${2:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet opCmp "opCmp (opCmp)" b
|
||||
int opCmp(${1} rhs) @safe const pure nothrow
|
||||
{
|
||||
${2:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet opApply "opApply (opApply)" b
|
||||
int opApply(int delegate(ref ${1:/*iterated type/s*/}) dg)
|
||||
{
|
||||
int result = 0;
|
||||
${2:/*loop*/}
|
||||
{
|
||||
result = dg(${3:/*arg/s*/});
|
||||
if(result){break;}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet toString "toString (toString)" b
|
||||
string toString() @safe const pure nothrow
|
||||
{
|
||||
${1:/*code*/}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
# Comments
|
||||
|
||||
|
||||
snippet todo "TODO (todo)"
|
||||
// TODO: ${1}
|
||||
endsnippet
|
||||
|
||||
|
||||
# DDoc
|
||||
|
||||
snippet doc "generic ddoc block (doc)" b
|
||||
/// ${1:description}
|
||||
///
|
||||
/// ${2:details}
|
||||
endsnippet
|
||||
|
||||
snippet fdoc "function ddoc block (fdoc)" b
|
||||
/// ${1:description}
|
||||
///
|
||||
/// ${2:Params: ${3:param} = ${4:param description}
|
||||
/// ${5}}
|
||||
///
|
||||
/// ${6:Returns: ${7:return value}}
|
||||
///
|
||||
/// ${8:Throws: ${9}Exception ${10}}
|
||||
endsnippet
|
||||
|
||||
snippet Par "Params (Par)"
|
||||
Params: ${1:param} = ${2:param description}
|
||||
/// ${3}
|
||||
endsnippet
|
||||
|
||||
snippet Ret "Returns (Ret)"
|
||||
Returns: ${1:return value/s}
|
||||
endsnippet
|
||||
|
||||
snippet Thr "Throws (Thr)"
|
||||
Throws: ${1}Exception ${2}
|
||||
endsnippet
|
||||
|
||||
snippet Example "Examples (Example)"
|
||||
Examples:
|
||||
/// --------------------
|
||||
/// ${1:example code}
|
||||
/// --------------------
|
||||
endsnippet
|
||||
|
||||
|
||||
# License blocks
|
||||
|
||||
snippet gpl "GPL (gpl)" b
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// Copyright (C) ${1:Author}, `!v strftime("%Y")`
|
||||
|
||||
${2}
|
||||
endsnippet
|
||||
|
||||
snippet boost "Boost (boost)" b
|
||||
// Copyright ${1:Author} `!v strftime("%Y")`.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
${2}
|
||||
endsnippet
|
||||
|
||||
|
||||
# New module
|
||||
|
||||
snippet module "New module (module)" b
|
||||
// Copyright ${1:Author} `!v strftime("%Y")`.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
module ${2}.`!v vim_snippets#Filename('$1', 'name')`;
|
||||
|
||||
|
||||
${3}
|
||||
endsnippet
|
238
bundle/vim-snippets/UltiSnips/django.snippets
Normal file
238
bundle/vim-snippets/UltiSnips/django.snippets
Normal file
@ -0,0 +1,238 @@
|
||||
priority -50
|
||||
|
||||
# Generic Tags
|
||||
snippet %
|
||||
{% ${1} %}${2}
|
||||
endsnippet
|
||||
|
||||
snippet %%
|
||||
{% ${1:tag_name} %}
|
||||
${2}
|
||||
{% end$1 %}
|
||||
endsnippet
|
||||
|
||||
snippet {
|
||||
{{ ${1} }}${2}
|
||||
endsnippet
|
||||
|
||||
# Template Tags
|
||||
|
||||
snippet autoescape
|
||||
{% autoescape ${1:off} %}
|
||||
${2}
|
||||
{% endautoescape %}
|
||||
endsnippet
|
||||
|
||||
snippet block
|
||||
{% block ${1} %}
|
||||
${2}
|
||||
{% endblock $1 %}
|
||||
endsnippet
|
||||
|
||||
snippet #
|
||||
{# ${1:comment} #}
|
||||
endsnippet
|
||||
|
||||
snippet comment
|
||||
{% comment %}
|
||||
${1}
|
||||
{% endcomment %}
|
||||
endsnippet
|
||||
|
||||
snippet cycle
|
||||
{% cycle ${1:val1} ${2:val2} ${3:as ${4}} %}
|
||||
endsnippet
|
||||
|
||||
snippet debug
|
||||
{% debug %}
|
||||
endsnippet
|
||||
|
||||
snippet extends
|
||||
{% extends "${1:base.html}" %}
|
||||
endsnippet
|
||||
|
||||
snippet filter
|
||||
{% filter ${1} %}
|
||||
${2}
|
||||
{% endfilter %}
|
||||
endsnippet
|
||||
|
||||
snippet firstof
|
||||
{% firstof ${1} %}
|
||||
endsnippet
|
||||
|
||||
snippet for
|
||||
{% for ${1} in ${2} %}
|
||||
${3}
|
||||
{% endfor %}
|
||||
endsnippet
|
||||
|
||||
snippet empty
|
||||
{% empty %}
|
||||
${1}
|
||||
endsnippet
|
||||
|
||||
snippet if
|
||||
{% if ${1} %}
|
||||
${2}
|
||||
{% endif %}
|
||||
endsnippet
|
||||
|
||||
snippet else
|
||||
{% else %}
|
||||
${1}
|
||||
endsnippet
|
||||
|
||||
snippet ifchanged
|
||||
{% ifchanged %}${1}{% endifchanged %}
|
||||
endsnippet
|
||||
|
||||
snippet ifequal
|
||||
{% ifequal ${1} ${2} %}
|
||||
${3}
|
||||
{% endifequal %}
|
||||
endsnippet
|
||||
|
||||
snippet ifnotequal
|
||||
{% ifnotequal ${1} ${2} %}
|
||||
${3}
|
||||
{% endifnotequal %}
|
||||
endsnippet
|
||||
|
||||
snippet include
|
||||
{% include "${1}" %}
|
||||
endsnippet
|
||||
|
||||
snippet load
|
||||
{% load ${1} %}
|
||||
endsnippet
|
||||
|
||||
snippet now
|
||||
{% now "${1:jS F Y H:i}" %}
|
||||
endsnippet
|
||||
|
||||
snippet regroup
|
||||
{% regroup ${1} by ${2} as ${3} %}
|
||||
endsnippet
|
||||
|
||||
snippet spaceless
|
||||
{% spaceless %}${1}{% endspaceless %}
|
||||
endsnippet
|
||||
|
||||
snippet ssi
|
||||
{% ssi ${1} %}
|
||||
endsnippet
|
||||
|
||||
snippet trans
|
||||
{% trans "${1:string}" %}
|
||||
endsnippet
|
||||
|
||||
snippet url
|
||||
{% url ${1} as ${2} %}
|
||||
endsnippet
|
||||
|
||||
snippet widthratio
|
||||
{% widthratio ${1:this_value} ${2:max_value} ${3:100} %}
|
||||
endsnippet
|
||||
|
||||
snippet with
|
||||
{% with ${1} as ${2} %}
|
||||
endsnippet
|
||||
|
||||
# Template Filters
|
||||
|
||||
# Note: Since SnipMate can't determine which template filter you are
|
||||
# expanding without the "|" character, these do not add the "|"
|
||||
# character. These save a few keystrokes still.
|
||||
|
||||
# Note: Template tags that take no arguments are not implemented.
|
||||
|
||||
snippet add
|
||||
add:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet center
|
||||
center:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet cut
|
||||
cut:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet date
|
||||
date:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet default
|
||||
default:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet defaultifnone
|
||||
default_if_none:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet dictsort
|
||||
dictsort:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet dictsortrev
|
||||
dictsortreversed:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet divisibleby
|
||||
divisibleby:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet floatformat
|
||||
floatformat:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet getdigit
|
||||
get_digit:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet join
|
||||
join:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet lengthis
|
||||
length_is:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet pluralize
|
||||
pluralize:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet removetags
|
||||
removetags:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet slice
|
||||
slice:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet stringformat
|
||||
stringformat:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet time
|
||||
time:"${1}"
|
||||
endsnippet
|
||||
|
||||
snippet truncatewords
|
||||
truncatewords:${1}
|
||||
endsnippet
|
||||
|
||||
snippet truncatewordshtml
|
||||
truncatewords_html:${1}
|
||||
endsnippet
|
||||
|
||||
snippet urlizetrunc
|
||||
urlizetrunc:${1}
|
||||
endsnippet
|
||||
|
||||
snippet wordwrap
|
||||
wordwrap:${1}
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
168
bundle/vim-snippets/UltiSnips/elixir.snippets
Normal file
168
bundle/vim-snippets/UltiSnips/elixir.snippets
Normal file
@ -0,0 +1,168 @@
|
||||
priority -50
|
||||
|
||||
snippet do
|
||||
do
|
||||
${1}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet if "if .. do .. end"
|
||||
if ${1:condition} do
|
||||
${2:expression}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet if "if .. do: .."
|
||||
if ${1:condition}, do: ${2:expression}
|
||||
endsnippet
|
||||
|
||||
snippet ife "if .. do .. else .. end"
|
||||
if ${1:condition} do
|
||||
${2:expression}
|
||||
else
|
||||
${3:expression}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet ife "if .. do: .. else:"
|
||||
if ${1:condition}, do: ${2}, else: ${3}
|
||||
endsnippet
|
||||
|
||||
snippet unless "unless .. do .. end"
|
||||
unless ${1} do
|
||||
${2}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet unless "unless .. do: .."
|
||||
unless ${1:condition}, do: ${2}
|
||||
endsnippet
|
||||
|
||||
snippet unlesse "unless .. do .. else .. end"
|
||||
unless ${1:condition} do
|
||||
${2}
|
||||
else
|
||||
${3}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet unlesse "unless .. do: .. else:"
|
||||
unless ${1:condition}, do: ${2}, else: ${3}
|
||||
endsnippet
|
||||
|
||||
snippet cond
|
||||
"cond do"
|
||||
${1} ->
|
||||
${2}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet case
|
||||
case ${1} do
|
||||
${2} ->
|
||||
${3}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet def
|
||||
def ${1:name} do
|
||||
${2}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet defin "def function(n), do: n"
|
||||
def ${1:name}, do: ${2}
|
||||
endsnippet
|
||||
|
||||
snippet defg
|
||||
def ${1:name} when ${2:guard-condition} do
|
||||
${3}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet defim
|
||||
defimpl ${1:protocol_name}, for: ${2:data_type} do
|
||||
${3}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet defma
|
||||
defmacro ${1:name} do
|
||||
${2}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet defmo
|
||||
defmodule ${1:module_name} do
|
||||
${2}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet defp
|
||||
defp ${1:name} do
|
||||
${2}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet defpr
|
||||
defprotocol ${1:name}, [${2:function}]
|
||||
endsnippet
|
||||
|
||||
snippet defr
|
||||
defrecord ${1:record_name}, ${2:fields}
|
||||
endsnippet
|
||||
|
||||
snippet doc
|
||||
@doc """
|
||||
${1}
|
||||
"""
|
||||
endsnippet
|
||||
|
||||
snippet fn
|
||||
fn(${1:args}) -> ${2} end
|
||||
endsnippet
|
||||
|
||||
snippet fun
|
||||
function do
|
||||
${1}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet mdoc
|
||||
@moduledoc """
|
||||
${1}
|
||||
"""
|
||||
endsnippet
|
||||
|
||||
snippet rec
|
||||
receive do
|
||||
${1} ->
|
||||
${2}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet req
|
||||
require ${1:module_name}
|
||||
endsnippet
|
||||
|
||||
snippet imp
|
||||
import ${1:module_name}
|
||||
endsnippet
|
||||
|
||||
snippet ali "alias old-module to shorthand"
|
||||
alias ${1:module_name}
|
||||
endsnippet
|
||||
|
||||
snippet test
|
||||
test "${1:test_name}" do
|
||||
${2}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet try "try .. rescue .. end"
|
||||
try do
|
||||
${1}
|
||||
rescue
|
||||
${2} -> ${3}
|
||||
end
|
||||
endsnippet
|
100
bundle/vim-snippets/UltiSnips/erlang.snippets
Normal file
100
bundle/vim-snippets/UltiSnips/erlang.snippets
Normal file
@ -0,0 +1,100 @@
|
||||
###########################################################################
|
||||
# TEXTMATE SNIPPETS #
|
||||
###########################################################################
|
||||
|
||||
priority -50
|
||||
|
||||
snippet pat "Case:Receive:Try Clause"
|
||||
${1:pattern}${2: when ${3:guard}} ->;
|
||||
${4:body}
|
||||
endsnippet
|
||||
|
||||
snippet beh "Behaviour Directive"
|
||||
-behaviour (${1:behaviour}).
|
||||
endsnippet
|
||||
|
||||
snippet case "Case Expression"
|
||||
case ${1:expression} of
|
||||
${2:pattern}${3: when ${4:guard}} ->
|
||||
${5:body}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet def "Define Directive"
|
||||
-define (${1:macro}${2: (${3:param})}, ${4:body}).
|
||||
endsnippet
|
||||
|
||||
snippet exp "Export Directive"
|
||||
-export ([${1:function}/${2:arity}]).
|
||||
endsnippet
|
||||
|
||||
snippet fun "Fun Expression"
|
||||
fun
|
||||
(${1:pattern})${2: when ${3:guard}} ->
|
||||
${4:body}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet fu "Function"
|
||||
${1:function} (${2:param})${3: when ${4:guard}} ->
|
||||
${5:body}
|
||||
endsnippet
|
||||
|
||||
snippet if "If Expression"
|
||||
if
|
||||
${1:guard} ->
|
||||
${2:body}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet ifdef "Ifdef Directive"
|
||||
-ifdef (${1:macro}).
|
||||
endsnippet
|
||||
|
||||
snippet ifndef "Ifndef Directive"
|
||||
-ifndef (${1:macro}).
|
||||
endsnippet
|
||||
|
||||
snippet imp "Import Directive"
|
||||
-import (${1:module}, [${2:function}/${3:arity}]).
|
||||
endsnippet
|
||||
|
||||
snippet inc "Include Directive"
|
||||
-include ("${1:file}").
|
||||
endsnippet
|
||||
|
||||
snippet mod "Module Directive"
|
||||
-module (${1:`!p snip.rv = snip.basename or "module"`}).
|
||||
endsnippet
|
||||
|
||||
snippet rcv "Receive Expression"
|
||||
receive
|
||||
${1: ${2:pattern}${3: when ${4:guard}} ->
|
||||
${5:body}}
|
||||
${6:after
|
||||
${7:expression} ->
|
||||
${8:body}}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet rec "Record Directive"
|
||||
-record (${1:record}, {${2:field}${3: = ${4:value}}}).
|
||||
endsnippet
|
||||
|
||||
snippet try "Try Expression"
|
||||
try${1: ${2:expression}${3: of
|
||||
${4:pattern}${5: when ${6:guard}} ->
|
||||
${7:body}}}
|
||||
${8:catch
|
||||
${9:pattern}${10: when ${11:guard}} ->
|
||||
${12:body}}
|
||||
${13:after
|
||||
${14:body}}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet undef "Undef Directive"
|
||||
-undef (${1:macro}).
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
288
bundle/vim-snippets/UltiSnips/eruby.snippets
Normal file
288
bundle/vim-snippets/UltiSnips/eruby.snippets
Normal file
@ -0,0 +1,288 @@
|
||||
priority -50
|
||||
|
||||
# TextMate added these variables to cope with changes in ERB handling
|
||||
# in different versions of Rails -- for instance, Rails 3 automatically
|
||||
# strips whitespace so that it's no longer necessary to use a form like
|
||||
# <% end -%>, but if you're still maintaining Rails 2 projects, you
|
||||
# can't omit the minus sign and get the same behavior.
|
||||
#
|
||||
# The following regex replace substitutes the function below for the
|
||||
# TextMate variable references after the snippets are converted:
|
||||
#
|
||||
# /\v\$\{(TM_RAILS_TEMPLATE_([^_]+)_RUBY_([^_\s]+))\}/`!p textmate_var('\1', snip)`/g
|
||||
#
|
||||
global !p
|
||||
def textmate_var(var, snip):
|
||||
lookup = dict(
|
||||
TM_RAILS_TEMPLATE_START_RUBY_EXPR = snip.opt('g:tm_rails_template_start_ruby_expr', '<%= '),
|
||||
TM_RAILS_TEMPLATE_END_RUBY_EXPR = snip.opt('g:tm_rails_template_end_ruby_expr', ' %>'),
|
||||
TM_RAILS_TEMPLATE_START_RUBY_INLINE = snip.opt('g:tm_rails_template_start_ruby_inline', '<% '),
|
||||
TM_RAILS_TEMPLATE_END_RUBY_INLINE = snip.opt('g:tm_rails_template_end_ruby_inline', ' %>'),
|
||||
TM_RAILS_TEMPLATE_END_RUBY_BLOCK = '<% end %>'
|
||||
)
|
||||
snip.rv = lookup[var]
|
||||
return
|
||||
endglobal
|
||||
|
||||
|
||||
snippet % "<% ${0} %>"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet = "<%= ${0} %>"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
###########################################################################
|
||||
# GENERATED FROM get_tm_snippets.py + REGEX REPLACE #
|
||||
###########################################################################
|
||||
|
||||
snippet fi "<%= Fixtures.identify(:symbol) %>"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`Fixtures.identify(:${1:name})`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`$0
|
||||
endsnippet
|
||||
|
||||
snippet ft "form_tag"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_tag(${1::action => "${5:update}"}${6:, {:${8:class} => "${9:form}"\}}) do`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
$0
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet end "end (ERB)"
|
||||
<% end -%>
|
||||
endsnippet
|
||||
|
||||
snippet for "for loop (ERB)"
|
||||
<% if !${1:list}.blank? %>
|
||||
<% for ${2:item} in ${1} %>
|
||||
$3
|
||||
<% end %>
|
||||
<% else %>
|
||||
$4
|
||||
<% end %>
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet ffcb "form_for check_box"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.check_box :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ffff "form_for file_field 2"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.file_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ffhf "form_for hidden_field 2"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.hidden_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ffl "form_for label 2"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.label :${1:attribute}${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ffpf "form_for password_field 2"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.password_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ffrb "form_for radio_box 2"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_box :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ffs "form_for submit 2"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.submit "${1:Submit}"${2:, :disable_with => '${3:$1ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ffta "form_for text_area 2"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_area :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet fftf "form_for text_field 2"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet fields "fields_for"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`fields_for :${1:model}, @${2:$1} do |$1|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)`
|
||||
$0
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f_fields_for (nff)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`f.fields_for :${1:attribute} do |${2:f}|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)`
|
||||
$0
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f.checkbox"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.check_box :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f.file_field"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.file_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f.hidden_field"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.hidden_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f.label"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.label :${1:attribute}${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f.password_field"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.password_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f.radio_box"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_box :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f.submit"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.submit "${1:Submit}"${2:, :disable_with => '${3:$1ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f.text_area"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_area :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet f. "f.text_field"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ffe "form_for with errors"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`error_messages_for :${1:model}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`form_for @${2:$1} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
$0
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ff "form_for"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`form_for @${1:model} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
$0
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet ist "image_submit_tag"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`image_submit_tag("${1:agree.png}"${2:${3:, :id => "${4:${1/^(\w+)(\.\w*)?$/$1/}}"}${5:, :name => "${6:${1/^(\w+)(\.\w*)?$/$1/}}"}${7:, :class => "${8:${1/^(\w+)(\.\w*)?$/$1/}-button}"}${9:, :disabled => ${10:false}}})`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet it "image_tag"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`image_tag "$1${2:.png}"${3:${4:, :title => "${5:title}"}${6:, :class => "${7:class}"}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet layout "layout"
|
||||
layout "${1:template_name}"${2:${3:, :only => ${4:[:${5:action}, :${6:action}]}}${7:, :except => ${8:[:${9:action}, :${10:action}]}}}
|
||||
endsnippet
|
||||
|
||||
snippet jit "javascript_include_tag"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`javascript_include_tag ${1::all}${2:, :cache => ${3:true}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet lia "link_to (action)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :action => "${2:index}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet liai "link_to (action, id)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :action => "${2:edit}", :id => ${3:@item}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet lic "link_to (controller)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet lica "link_to (controller, action)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}", :action => "${3:index}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet licai "link_to (controller, action, id)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}", :action => "${3:edit}", :id => ${4:@item}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet linpp "link_to (nested path plural)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${10:parent}_${11:child}_path(${12:@}${13:${10}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet linp "link_to (nested path)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet lipp "link_to (path plural)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${4:model}s_path}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet lip "link_to (path)"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:model}_path(${13:@}${14:${12}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet lim "link_to model"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:model}.${2:name}, ${3:${4:$1}_path(${14:$1})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet hide "page.hide (*ids)"
|
||||
page.hide ${1:"${2:id(s)}"}
|
||||
endsnippet
|
||||
|
||||
snippet ins "page.insert_html (position, id, partial)"
|
||||
page.insert_html :${1:top}, ${2:"${3:id}"}, :${4:partial => "${5:template}"}
|
||||
endsnippet
|
||||
|
||||
snippet rep "page.replace (id, partial)"
|
||||
page.replace ${1:"${2:id}"}, :${3:partial => "${4:template}"}
|
||||
endsnippet
|
||||
|
||||
snippet reph "page.replace_html (id, partial)"
|
||||
page.replace_html ${1:"${2:id}"}, :${3:partial => "${4:template}"}
|
||||
endsnippet
|
||||
|
||||
snippet show "page.show (*ids)"
|
||||
page.show ${1:"${2:id(s)}"}
|
||||
endsnippet
|
||||
|
||||
snippet tog "page.toggle (*ids)"
|
||||
page.toggle ${1:"${2:id(s)}"}
|
||||
endsnippet
|
||||
|
||||
snippet vis "page.visual_effect (effect, id)"
|
||||
page.visual_effect :${1:toggle_slide}, ${2:"${3:DOM ID}"}
|
||||
endsnippet
|
||||
|
||||
snippet rp "render (partial) (rp)"
|
||||
render :partial => "${1:item}"
|
||||
endsnippet
|
||||
|
||||
snippet rpc "render (partial,collection) (rpc)"
|
||||
render :partial => "${1:item}", :collection => ${2:@$1s}
|
||||
endsnippet
|
||||
|
||||
snippet rpl "render (partial,locals) (rpl)"
|
||||
render :partial => "${1:item}", :locals => { :${2:$1} => ${3:@$1}$0 }
|
||||
endsnippet
|
||||
|
||||
snippet rpo "render (partial,object) (rpo)"
|
||||
render :partial => "${1:item}", :object => ${2:@$1}
|
||||
endsnippet
|
||||
|
||||
snippet rps "render (partial,status) (rps)"
|
||||
render :partial => "${1:item}", :status => ${2:500}
|
||||
endsnippet
|
||||
|
||||
snippet slt "stylesheet_link_tag"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`stylesheet_link_tag ${1::all}${2:, :cache => ${3:true}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet st "submit_tag"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`submit_tag "${1:Save changes}"${2:, :id => "${3:submit}"}${4:, :name => "${5:$3}"}${6:, :class => "${7:form_$3}"}${8:, :disabled => ${9:false}}${10:, :disable_with => "${11:Please wait...}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
snippet else "else (ERB)"
|
||||
<% else %>
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet if "if (ERB)"
|
||||
<% if ${1:condition} %>$0
|
||||
endsnippet
|
||||
|
||||
snippet lf "link_to_function"
|
||||
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to_function ${1:"${2:Greeting}"}, "${3:alert('Hello world!')}"$4`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
131
bundle/vim-snippets/UltiSnips/go.snippets
Normal file
131
bundle/vim-snippets/UltiSnips/go.snippets
Normal file
@ -0,0 +1,131 @@
|
||||
# Snippets for Go
|
||||
|
||||
priority -50
|
||||
|
||||
# when to abbriviate and when not?
|
||||
# b doesn't work here, because it ignores whitespace
|
||||
# optional local name?
|
||||
snippet /^import/ "Import declaration" r
|
||||
import (
|
||||
"${1:package}"
|
||||
)
|
||||
endsnippet
|
||||
|
||||
snippet /^package/ "Package declaration" r
|
||||
// Package $1 provides ...
|
||||
package ${1:main}
|
||||
endsnippet
|
||||
|
||||
# Mostly converted from: https://github.com/AlanQuatermain/go-tmbundle
|
||||
snippet /^cons/ "Constants declaration" r
|
||||
const (
|
||||
${1:constant}${2/(.+)/ /}${2:type} = ${0:value}
|
||||
)
|
||||
endsnippet
|
||||
|
||||
snippet /^con/ "Constant declaration" r
|
||||
const ${1:name}${2/(.+)/ /}${2:type} = ${0:value}
|
||||
endsnippet
|
||||
|
||||
snippet iota "Iota constant generator" b
|
||||
const (
|
||||
${1:constant}${2/(.+)/ /}${2:type} = iota
|
||||
)
|
||||
endsnippet
|
||||
|
||||
snippet struct "Struct declaration" b
|
||||
type ${1:Struct} struct {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet interface "Interface declaration" b
|
||||
type ${1:Interface} interface {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# statements
|
||||
snippet for "For loop" b
|
||||
for ${1:condition}${1/(.+)/ /}{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet forr "For range loop" b
|
||||
for ${2:name} := range ${1:collection} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet if "If statement" b
|
||||
if ${1:condition}${1/(.+)/ /}{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet switch "Switch statement" b
|
||||
switch ${1:expression}${1/(.+)/ /}{
|
||||
case${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet select "Select statement" b
|
||||
select {
|
||||
case${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet case "Case clause" b
|
||||
case ${1:condition}:
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet default "Default clause" b
|
||||
default:
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
# functions
|
||||
snippet /^main/ "Main function" r
|
||||
func main() {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /^meth/ "Method" r
|
||||
func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}${5:type} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet func "Function" b
|
||||
func ${1:name}(${2:params})${3/(.+)/ /}${3:type} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# types and variables
|
||||
snippet map "Map type" b
|
||||
map[${1:keytype}]${2:valtype}
|
||||
endsnippet
|
||||
|
||||
snippet : "Variable declaration :=" b
|
||||
${1:name} := ${0:value}
|
||||
endsnippet
|
||||
|
||||
snippet var "Variable declaration" b
|
||||
var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}}
|
||||
endsnippet
|
||||
|
||||
snippet vars "Variables declaration" b
|
||||
var (
|
||||
${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} }
|
||||
)
|
||||
endsnippet
|
||||
|
||||
snippet json "JSON field"
|
||||
\`json:"${1:displayName}"\`
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
63
bundle/vim-snippets/UltiSnips/haskell.snippets
Normal file
63
bundle/vim-snippets/UltiSnips/haskell.snippets
Normal file
@ -0,0 +1,63 @@
|
||||
priority -50
|
||||
|
||||
snippet if "if ... then ... else ..."
|
||||
if ${1:condition}
|
||||
then ${2:expression}
|
||||
else ${3:expression}
|
||||
endsnippet
|
||||
|
||||
snippet case "case ... of ..."
|
||||
case ${1:expression} of
|
||||
${2:pattern} -> ${3:expression}
|
||||
${4:pattern} -> ${5:expression}
|
||||
endsnippet
|
||||
|
||||
snippet :: "Type signature"
|
||||
${1:name} :: ${2:Type} -> ${3:Type}
|
||||
endsnippet
|
||||
|
||||
snippet => "Type constraint"
|
||||
(${1:Class} ${2:Type var}) => ${3:$2}
|
||||
endsnippet
|
||||
|
||||
snippet def "Function definition"
|
||||
${1:name} :: ${2:Type} -> ${3:Type}
|
||||
endsnippet
|
||||
|
||||
snippet def[] "Function definition for list patterns"
|
||||
${1:name} :: [${2:Type}] -> ${3:Type}
|
||||
$1 [] = ${4:undefined}
|
||||
$1 ${5:(x:xs)} = ${6:undefined}
|
||||
endsnippet
|
||||
|
||||
snippet = "Function clause"
|
||||
${1:name} ${2:pattern} = ${3:undefined}
|
||||
endsnippet
|
||||
|
||||
snippet 2= "Function clause"
|
||||
${1:name} ${2:pattern} = ${3:undefined}
|
||||
$1 ${4:pattern} = ${5:undefined}
|
||||
endsnippet
|
||||
|
||||
snippet 3= "Function clause"
|
||||
${1:name} ${2:pattern} = ${3:undefined}
|
||||
$1 ${4:pattern} = ${5:undefined}
|
||||
$1 ${6:pattern} = ${7:undefined}
|
||||
endsnippet
|
||||
|
||||
snippet | "Guard"
|
||||
| ${1:predicate} = ${2:undefined}
|
||||
endsnippet
|
||||
|
||||
snippet \ "Lambda expression"
|
||||
\ ${1:pattern} -> ${2:expression}
|
||||
endsnippet
|
||||
|
||||
snippet [|] "List comprehension"
|
||||
[${3:foo }$1 | ${1:x} <- ${2:xs} ]
|
||||
endsnippet
|
||||
|
||||
snippet let "let ... in ..."
|
||||
let ${1:name} = ${2:expression}
|
||||
in ${3:expression}
|
||||
endsnippet
|
32
bundle/vim-snippets/UltiSnips/help.snippets
Normal file
32
bundle/vim-snippets/UltiSnips/help.snippets
Normal file
@ -0,0 +1,32 @@
|
||||
# Snippets for VIM Help Files
|
||||
|
||||
priority -50
|
||||
|
||||
global !p
|
||||
def sec_title(snip, t):
|
||||
file_start = snip.fn.split('.')[0]
|
||||
sec_name = t[1].strip("1234567890. ").lower().replace(' ', '-')
|
||||
return ("*%s-%s*" % (file_start, sec_name)).rjust(78-len(t[1]))
|
||||
endglobal
|
||||
|
||||
snippet sec "Section marker" b
|
||||
==============================================================================
|
||||
${1:SECTION}`!p snip.rv = sec_title(snip, t)`
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ssec "Sub section marker" b
|
||||
${1:Subsection}`!p snip.rv = sec_title(snip, t)
|
||||
snip += "-"*len(t[1])`
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet sssec "Subsub Section marker" b
|
||||
${1:SubSubsection}:`!p snip.rv = sec_title(snip, t)`
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
302
bundle/vim-snippets/UltiSnips/html.snippets
Normal file
302
bundle/vim-snippets/UltiSnips/html.snippets
Normal file
@ -0,0 +1,302 @@
|
||||
priority -50
|
||||
|
||||
###########################################################################
|
||||
# TextMate Snippets #
|
||||
###########################################################################
|
||||
|
||||
global !p
|
||||
def x(snip):
|
||||
if snip.ft.startswith("x"):
|
||||
snip.rv = '/'
|
||||
else:
|
||||
snip.rv = ""
|
||||
endglobal
|
||||
|
||||
############
|
||||
# Doctypes #
|
||||
############
|
||||
snippet doctype "DocType XHTML 1.0 Strict" b
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet doctype "DocType XHTML 1.0 Transitional" b
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet doctype "DocType XHTML 1.1" b
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet doctype "HTML - 4.0 Transitional (doctype)" b
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet doctype "HTML - 5.0 (doctype)" b
|
||||
<!DOCTYPE html>
|
||||
|
||||
endsnippet
|
||||
|
||||
#############
|
||||
# Shortcuts #
|
||||
#############
|
||||
snippet down "Down (down)"
|
||||
↓
|
||||
endsnippet
|
||||
|
||||
snippet enter "Enter (enter)"
|
||||
⌅
|
||||
endsnippet
|
||||
|
||||
snippet escape "Escape (escape)"
|
||||
⎋
|
||||
endsnippet
|
||||
|
||||
snippet shift "Shift (shift)"
|
||||
⇧
|
||||
endsnippet
|
||||
|
||||
snippet tab "Tab (tab)"
|
||||
⇥
|
||||
endsnippet
|
||||
|
||||
snippet up "Up (up)"
|
||||
↑
|
||||
endsnippet
|
||||
|
||||
snippet return "Return (return)"
|
||||
↩
|
||||
endsnippet
|
||||
|
||||
snippet right "Right (right)"
|
||||
→
|
||||
endsnippet
|
||||
|
||||
snippet left "Left (left)"
|
||||
←
|
||||
endsnippet
|
||||
|
||||
snippet option "Option (option)"
|
||||
⌥
|
||||
endsnippet
|
||||
|
||||
#######################
|
||||
# Conditional inserts #
|
||||
#######################
|
||||
snippet ! "IE Conditional Comment: Internet Explorer 5_0 only"
|
||||
<!--[if IE 5.0]>${1:IE Conditional Comment: Internet Explorer 5.0 only }<![endif]-->$0
|
||||
endsnippet
|
||||
|
||||
snippet ! "IE Conditional Comment: Internet Explorer 5_5 only"
|
||||
<!--[if IE 5.5000]>${1:IE Conditional Comment: Internet Explorer 5.5 only }<![endif]-->$0
|
||||
endsnippet
|
||||
|
||||
snippet ! "IE Conditional Comment: Internet Explorer 5_x"
|
||||
<!--[if lt IE 6]>${1:IE Conditional Comment: Internet Explorer 5.x }<![endif]-->$0
|
||||
endsnippet
|
||||
|
||||
snippet ! "IE Conditional Comment: Internet Explorer 6 and below"
|
||||
<!--[if lte IE 6]>${1:IE Conditional Comment: Internet Explorer 6 and below }<![endif]-->$0
|
||||
endsnippet
|
||||
|
||||
snippet ! "IE Conditional Comment: Internet Explorer 6 only"
|
||||
<!--[if IE 6]>${1:IE Conditional Comment: Internet Explorer 6 only }<![endif]-->$0
|
||||
endsnippet
|
||||
|
||||
snippet ! "IE Conditional Comment: Internet Explorer 7+"
|
||||
<!--[if gte IE 7]>${1:IE Conditional Comment: Internet Explorer 7 and above }<![endif]-->$0
|
||||
endsnippet
|
||||
|
||||
snippet ! "IE Conditional Comment: Internet Explorer"
|
||||
<!--[if IE]>${1: IE Conditional Comment: Internet Explorer }<![endif]-->$0
|
||||
endsnippet
|
||||
|
||||
snippet ! "IE Conditional Comment: NOT Internet Explorer"
|
||||
<!--[if !IE]><!-->${1: IE Conditional Comment: NOT Internet Explorer }<!-- <![endif]-->$0
|
||||
endsnippet
|
||||
|
||||
#############
|
||||
# HTML TAGS #
|
||||
#############
|
||||
snippet input "Input with Label" w
|
||||
<label for="${2:${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}}">$1</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="$5"${6: id="${7:$2}"}`!p x(snip)`>
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet input "XHTML <input>" w
|
||||
<input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="$3"${4: id="${5:$2}"}`!p x(snip)`>
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet opt "Option" w
|
||||
<option${1: value="${2:option}"}>${3:$2}</option>
|
||||
endsnippet
|
||||
|
||||
snippet select "Select Box" w
|
||||
<select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: onchange="${6:}"}${7: size="${8:1}"}}>
|
||||
<option${9: value="${10:option1}"}>${11:$10}</option>
|
||||
<option${12: value="${13:option2}"}>${14:$13}</option>${15:}
|
||||
$0
|
||||
</select>
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet textarea "XHTML <textarea>" w
|
||||
<textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">$0</textarea>
|
||||
endsnippet
|
||||
|
||||
snippet mailto "XHTML <a mailto: >" w
|
||||
<a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a>
|
||||
endsnippet
|
||||
|
||||
snippet base "XHTML <base>" w
|
||||
<base href="$1"${2: target="$3"}`!p x(snip)`>
|
||||
endsnippet
|
||||
|
||||
snippet img "XHTML <img>" w
|
||||
<img src="${1:imgsrc}">
|
||||
endsnippet
|
||||
|
||||
snippet body "XHTML <body>"
|
||||
<body id="${1:`!p
|
||||
snip.rv = snip.fn and 'Hallo' or 'Nothin'
|
||||
`}"${2: onload="$3"}>
|
||||
$0
|
||||
</body>
|
||||
endsnippet
|
||||
|
||||
snippet div "XHTML <div>" w
|
||||
<div`!p snip.rv=' id="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""``!p snip.rv=' class="' if t[2] else ""`${2:name}`!p snip.rv = '"' if t[2] else ""`>
|
||||
$0
|
||||
</div>
|
||||
endsnippet
|
||||
|
||||
snippet form "XHTML <form>" w
|
||||
<form action="${1:`!p
|
||||
snip.rv = (snip.basename or 'unnamed') + '_submit'
|
||||
`}" method="${2:get}" accept-charset="utf-8">
|
||||
$0
|
||||
|
||||
<p><input type="submit" value="Continue →"`!p x(snip)`></p>
|
||||
</form>
|
||||
endsnippet
|
||||
|
||||
snippet h1 "XHTML <h1>" w
|
||||
<h1 id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}">${1}</h1>
|
||||
endsnippet
|
||||
|
||||
snippet head "XHTML <head>"
|
||||
<head>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8"`!p x(snip)`>
|
||||
<title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title>
|
||||
$0
|
||||
</head>
|
||||
endsnippet
|
||||
|
||||
snippet link "XHTML <link>" w
|
||||
<link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" title="${4:no title}" charset="${5:utf-8}"`!p x(snip)`>
|
||||
endsnippet
|
||||
|
||||
snippet meta "XHTML <meta>" w
|
||||
<meta name="${1:name}" content="${2:content}"`!p x(snip)`>
|
||||
endsnippet
|
||||
|
||||
snippet scriptsrc "XHTML <script src...>" w
|
||||
<script src="$1" type="text/javascript" charset="${3:utf-8}"></script>
|
||||
endsnippet
|
||||
|
||||
snippet script "XHTML <script>" w
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$0
|
||||
</script>
|
||||
endsnippet
|
||||
|
||||
snippet style "XHTML <style>" w
|
||||
<style type="text/css" media="screen">
|
||||
$0
|
||||
</style>
|
||||
endsnippet
|
||||
|
||||
snippet table "XHTML <table>" w
|
||||
<table border="${1:0}"${2: cellspacing="${3:5}" cellpadding="${4:5}"}>
|
||||
<tr><th>${5:Header}</th></tr>
|
||||
<tr><td>${0:Data}</td></tr>
|
||||
</table>
|
||||
endsnippet
|
||||
|
||||
snippet a "Link" w
|
||||
<a href="${1:http://www.${2:url.com}}"${3: target="_blank"}>${4:Anchor Text}</a>
|
||||
endsnippet
|
||||
|
||||
snippet p "paragraph" w
|
||||
<p>$0</p>
|
||||
endsnippet
|
||||
|
||||
snippet li "list item" w
|
||||
<li>$0</li>
|
||||
endsnippet
|
||||
|
||||
snippet ul "unordered list" w
|
||||
<ul>
|
||||
$0
|
||||
</ul>
|
||||
endsnippet
|
||||
|
||||
snippet td "table cell" w
|
||||
<td>$0</td>
|
||||
endsnippet
|
||||
|
||||
snippet tr "table row" w
|
||||
<tr>$0</tr>
|
||||
endsnippet
|
||||
|
||||
snippet title "XHTML <title>" w
|
||||
<title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title>
|
||||
endsnippet
|
||||
|
||||
snippet fieldset "Fieldset" w
|
||||
<fieldset id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}" ${2:class="${3:}"}>
|
||||
<legend>$1</legend>
|
||||
$0
|
||||
</fieldset>
|
||||
endsnippet
|
||||
|
||||
snippet movie "Embed QT movie (movie)" b
|
||||
<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
|
||||
<param name="src" value="$1"`!p x(snip)`>
|
||||
<param name="controller" value="$4"`!p x(snip)`>
|
||||
<param name="autoplay" value="$5"`!p x(snip)`>
|
||||
<embed src="${1:movie.mov}"
|
||||
width="${2:320}" height="${3:240}"
|
||||
controller="${4:true}" autoplay="${5:true}"
|
||||
scale="tofit" cache="true"
|
||||
pluginspage="http://www.apple.com/quicktime/download/"
|
||||
`!p x(snip)`>
|
||||
</object>
|
||||
endsnippet
|
||||
|
||||
snippet html5 "HTML5 Template"
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${1}</title>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
${2}
|
||||
</header>
|
||||
<footer>
|
||||
${4}
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
endsnippet
|
||||
# vim:ft=snippets:
|
33
bundle/vim-snippets/UltiSnips/html_minimal.snippets
Normal file
33
bundle/vim-snippets/UltiSnips/html_minimal.snippets
Normal file
@ -0,0 +1,33 @@
|
||||
# more can be found in snippets/html_minimal.snippets
|
||||
# these UltiSnips override snippets because nested placeholders are being used
|
||||
|
||||
priority -50
|
||||
|
||||
snippet id
|
||||
id="${1}"${2}
|
||||
endsnippet
|
||||
|
||||
snippet idn
|
||||
id="${1}" name="${2:$1}"
|
||||
endsnippet
|
||||
|
||||
snippet label_and_input
|
||||
<label for="${2:$1}">${1}</label>
|
||||
<input type="${3:text}" name="${4:$2}"${5: id="${6:$2}"} value="${7}" />${8}
|
||||
endsnippet
|
||||
|
||||
snippet input
|
||||
<input type="${1:text}" value="${2}" name="${3}"${4: id="${5:$3}}/>${7}
|
||||
endsnippet
|
||||
|
||||
snippet submit
|
||||
<input type="submit" value="${2}" ${3}/>${7}
|
||||
endsnippet
|
||||
|
||||
snippet textarea
|
||||
<textarea name="$2"${3: id="$4"}>$5</textarea>
|
||||
endsnippet
|
||||
|
||||
snippet img
|
||||
<img src="$1"${2: alt="$3"}/>
|
||||
endsnippet
|
3
bundle/vim-snippets/UltiSnips/htmldjango.snippets
Normal file
3
bundle/vim-snippets/UltiSnips/htmldjango.snippets
Normal file
@ -0,0 +1,3 @@
|
||||
priority -50
|
||||
|
||||
extends html, django
|
3
bundle/vim-snippets/UltiSnips/htmljinja.snippets
Normal file
3
bundle/vim-snippets/UltiSnips/htmljinja.snippets
Normal file
@ -0,0 +1,3 @@
|
||||
priority -50
|
||||
|
||||
extends html, jinja2
|
431
bundle/vim-snippets/UltiSnips/java.snippets
Normal file
431
bundle/vim-snippets/UltiSnips/java.snippets
Normal file
@ -0,0 +1,431 @@
|
||||
priority -50
|
||||
|
||||
# Many of the snippets here use a global option called
|
||||
# "g:ultisnips_java_brace_style" which, if set to "nl" will put a newline
|
||||
# before '{' braces.
|
||||
# Setting "g:ultisnips_java_junit" will change how the test method snippet
|
||||
# looks, it is defaulted to junit4, setting this option to 3 will remove the
|
||||
# @Test annotation from the method
|
||||
|
||||
global !p
|
||||
def junit(snip):
|
||||
if snip.opt("g:ultisnips_java_junit", "") == "3":
|
||||
snip += ""
|
||||
else:
|
||||
snip.rv += "@Test\n\t"
|
||||
|
||||
def nl(snip):
|
||||
if snip.opt("g:ultisnips_java_brace_style", "") == "nl":
|
||||
snip += ""
|
||||
else:
|
||||
snip.rv += " "
|
||||
def getArgs(group):
|
||||
import re
|
||||
word = re.compile('[a-zA-Z><.]+ \w+')
|
||||
return [i.split(" ") for i in word.findall(group) ]
|
||||
|
||||
def camel(word):
|
||||
return word[0].upper() + word[1:]
|
||||
|
||||
endglobal
|
||||
|
||||
snippet sleep "try sleep catch" b
|
||||
try {
|
||||
Thread.sleep(${1:1000});
|
||||
} catch (InterruptedException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /i|n/ "new primitive or int" br
|
||||
${1:int} ${2:i} = ${3:1};
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet /o|v/ "new Object or variable" br
|
||||
${1:Object} ${2:var} = new $1(${3});
|
||||
endsnippet
|
||||
|
||||
snippet f "field" b
|
||||
${1:private} ${2:String} ${3:`!p snip.rv = t[2].lower()`};
|
||||
endsnippet
|
||||
|
||||
snippet ab "abstract" b
|
||||
abstract $0
|
||||
endsnippet
|
||||
|
||||
snippet as "assert" b
|
||||
assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};$0
|
||||
endsnippet
|
||||
|
||||
snippet at "assert true" b
|
||||
assertTrue(${1:actual});
|
||||
endsnippet
|
||||
|
||||
snippet af "assert false" b
|
||||
assertFalse(${1:actual});$0
|
||||
endsnippet
|
||||
|
||||
snippet ae "assert equals" b
|
||||
assertEquals(${1:expected}, ${2:actual});
|
||||
endsnippet
|
||||
|
||||
snippet br "break"
|
||||
break;
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet cs "case" b
|
||||
case $1:
|
||||
$2
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ca "catch" b
|
||||
catch (${1:Exception} ${2:e})`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet cle "class extends" b
|
||||
public class ${1:`!p
|
||||
snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent} }${4:implements ${5:Interface} }{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet clc "class with constructor, fields, setter and getters" b
|
||||
public class `!p
|
||||
snip.rv = snip.basename or "untitled"` {
|
||||
`!p
|
||||
args = getArgs(t[1])
|
||||
if len(args) == 0: snip.rv = ""
|
||||
for i in args:
|
||||
snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";"
|
||||
if len(args) > 0:
|
||||
snip.rv += "\n"`
|
||||
public `!p snip.rv = snip.basename or "unknown"`($1) { `!p
|
||||
args = getArgs(t[1])
|
||||
for i in args:
|
||||
snip.rv += "\n\t\tthis." + i[1] + " = " + i[1] + ";"
|
||||
if len(args) == 0:
|
||||
snip.rv += "\n"`
|
||||
}$0
|
||||
`!p
|
||||
args = getArgs(t[1])
|
||||
if len(args) == 0: snip.rv = ""
|
||||
for i in args:
|
||||
snip.rv += "\n\tpublic void set" + camel(i[1]) + "(" + i[0] + " " + i[1] + ") {\n" + "\
|
||||
\tthis." + i[1] + " = " + i[1] + ";\n\t}\n"
|
||||
|
||||
snip.rv += "\n\tpublic " + i[0] + " get" + camel(i[1]) + "() {\
|
||||
\n\t\treturn " + i[1] + ";\n\t}\n"
|
||||
`
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet clc "class with constructor, with field names" b
|
||||
public class `!p
|
||||
snip.rv = snip.basename or "untitled"` {
|
||||
`!p
|
||||
args = getArgs(t[1])
|
||||
for i in args:
|
||||
snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";"
|
||||
if len(args) > 0:
|
||||
snip.rv += "\n"`
|
||||
public `!p snip.rv = snip.basename or "unknown"`($1) { `!p
|
||||
args = getArgs(t[1])
|
||||
for i in args:
|
||||
snip.rv += "\n\t\tthis." + i[1] + " = " + i[1]
|
||||
if len(args) == 0:
|
||||
snip.rv += "\n"`
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet clc "class and constructor" b
|
||||
public class `!p
|
||||
snip.rv = snip.basename or "untitled"` {
|
||||
|
||||
public `!p snip.rv = snip.basename or "untitled"`($2) {
|
||||
$0
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet cl "class" b
|
||||
public class ${1:`!p
|
||||
snip.rv = snip.basename or "untitled"`} {
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet cos "constant string" b
|
||||
public static final String ${1:var} = "$2";$0
|
||||
endsnippet
|
||||
|
||||
snippet co "constant" b
|
||||
public static final ${1:String} ${2:var} = $3;$0
|
||||
endsnippet
|
||||
|
||||
snippet de "default" b
|
||||
default:
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet elif "else if" b
|
||||
else if ($1)`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /el(se)?/ "else" br
|
||||
else`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fi "final" b
|
||||
final $0
|
||||
endsnippet
|
||||
|
||||
snippet fore "for (each)" b
|
||||
for ($1 : $2)`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fori "for" b
|
||||
for (int ${1:i} = 0; $1 < ${2:10}; $1++)`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet for "for" b
|
||||
for ($1; $2; $3)`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet if "if" b
|
||||
if ($1)`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet imt "import junit_framework_TestCase;" b
|
||||
import junit.framework.TestCase;
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet im "import" b
|
||||
import ${1:java}.${2:util}.$0
|
||||
endsnippet
|
||||
|
||||
snippet in "interface" b
|
||||
interface ${1:`!p snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent} }{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet cc "constructor call or setter body"
|
||||
this.${1:var} = $1;
|
||||
endsnippet
|
||||
|
||||
snippet list "Collections List" b
|
||||
List<${1:String}> ${2:list} = new ${3:Array}List<$1>();
|
||||
endsnippet
|
||||
|
||||
snippet map "Collections Map" b
|
||||
Map<${1:String}, ${2:String}> ${3:map} = new ${4:Hash}Map<$1, $2>();
|
||||
endsnippet
|
||||
|
||||
snippet set "Collections Set" b
|
||||
Set<${1:String}> ${2:set} = new ${3:Hash}Set<$1>();
|
||||
endsnippet
|
||||
|
||||
snippet /Str?|str/ "String" br
|
||||
String $0
|
||||
endsnippet
|
||||
|
||||
snippet cn "Constructor" b
|
||||
public `!p snip.rv = snip.basename or "untitled"`(${1:}) {
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet cn "constructor, \w fields + assigments" b
|
||||
`!p
|
||||
args = getArgs(t[1])
|
||||
for i in args:
|
||||
snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";"
|
||||
if len(args) > 0:
|
||||
snip.rv += "\n"`
|
||||
public `!p snip.rv = snip.basename or "unknown"`($1) { `!p
|
||||
args = getArgs(t[1])
|
||||
for i in args:
|
||||
snip.rv += "\n\t\tthis." + i[1] + " = " + i[1]
|
||||
if len(args) == 0:
|
||||
snip.rv += "\n"`
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet j.b "java_beans_" i
|
||||
java.beans.
|
||||
endsnippet
|
||||
|
||||
snippet j.i "java_io" i
|
||||
java.io.
|
||||
endsnippet
|
||||
|
||||
snippet j.m "java_math" i
|
||||
java.math.
|
||||
endsnippet
|
||||
|
||||
snippet j.n "java_net_" i
|
||||
java.net.
|
||||
endsnippet
|
||||
|
||||
snippet j.u "java_util_" i
|
||||
java.util.
|
||||
endsnippet
|
||||
|
||||
snippet main "method (main)" b
|
||||
public static void main(String[] args)`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet try "try/catch" b
|
||||
try {
|
||||
$1
|
||||
} catch(${2:Exception} ${3:e}){
|
||||
${4:e.printStackTrace();}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet mt "method throws" b
|
||||
${1:private} ${2:void} ${3:method}(${4}) ${5:throws $6 }{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet m "method" b
|
||||
${1:private} ${2:void} ${3:method}(${4}) {
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet md "Method With javadoc" b
|
||||
/**
|
||||
* ${7:Short Description}`!p
|
||||
for i in getArgs(t[4]):
|
||||
snip.rv += "\n\t * @param " + i[1] + " usage..."`
|
||||
* `!p
|
||||
if "throws" in t[5]:
|
||||
snip.rv = "\n\t * @throws " + t[6]
|
||||
else:
|
||||
snip.rv = ""` `!p
|
||||
if not "void" in t[2]:
|
||||
snip.rv = "\n\t * @return object"
|
||||
else:
|
||||
snip.rv = ""`
|
||||
**/
|
||||
${1:public} ${2:void} ${3:method}($4) ${5:throws $6 }{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /get(ter)?/ "getter" br
|
||||
public ${1:String} get${2:Name}() {
|
||||
return `!p snip.rv = t[2].lower()`;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /set(ter)?/ "setter" br
|
||||
public void set${1:Name}(${2:String} $1) {
|
||||
return this.`!p snip.rv = t[1].lower()` = `!p snip.rv = t[1].lower()`;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /se?tge?t|ge?tse?t|gs/ "setter and getter" br
|
||||
public void set${1:Name}(${2:String} `!p snip.rv = t[1].lower()`) {
|
||||
this.`!p snip.rv = t[1].lower()` = `!p snip.rv = t[1].lower()`;
|
||||
}
|
||||
|
||||
public $2 get$1() {
|
||||
return `!p snip.rv = t[1].lower()`;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet pa "package" b
|
||||
package $0
|
||||
endsnippet
|
||||
|
||||
snippet p "print" b
|
||||
System.out.print($1);$0
|
||||
endsnippet
|
||||
|
||||
snippet pl "println" b
|
||||
System.out.println($1);$0
|
||||
endsnippet
|
||||
|
||||
snippet pr "private" b
|
||||
private $0
|
||||
endsnippet
|
||||
|
||||
snippet po "protected" b
|
||||
protected $0
|
||||
endsnippet
|
||||
|
||||
snippet pu "public" b
|
||||
public $0
|
||||
endsnippet
|
||||
|
||||
snippet re "return" b
|
||||
return $0
|
||||
endsnippet
|
||||
|
||||
snippet st "static"
|
||||
static $0
|
||||
endsnippet
|
||||
|
||||
snippet sw "switch" b
|
||||
switch ($1)`!p nl(snip)`{
|
||||
case $2: $0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet sy "synchronized"
|
||||
synchronized $0
|
||||
endsnippet
|
||||
|
||||
snippet tc "test case"
|
||||
public class ${1:`!p snip.rv = snip.basename or "untitled"`} extends ${2:TestCase}`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet t "test" b
|
||||
`!p junit(snip)`public void test${1:Name}() {
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet tt "test throws" b
|
||||
`!p junit(snip)`public void test${1:Name}() ${2:throws Exception }{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet th "throw" b
|
||||
throw new $0
|
||||
endsnippet
|
||||
|
||||
snippet wh "while" b
|
||||
while ($1)`!p nl(snip)`{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
162
bundle/vim-snippets/UltiSnips/javascript.snippets
Normal file
162
bundle/vim-snippets/UltiSnips/javascript.snippets
Normal file
@ -0,0 +1,162 @@
|
||||
priority -50
|
||||
|
||||
###########################################################################
|
||||
# TextMate Snippets #
|
||||
###########################################################################
|
||||
snippet get "Get Elements"
|
||||
getElement${1/(T)|.*/(?1:s)/}By${1:T}${1/(T)|(I)|.*/(?1:agName)(?2:d)/}('$2')
|
||||
endsnippet
|
||||
|
||||
snippet '':f "object method string"
|
||||
'${1:${2:#thing}:${3:click}}': function(element) {
|
||||
${VISUAL}$0
|
||||
}${10:,}
|
||||
endsnippet
|
||||
|
||||
snippet :f "Object Method"
|
||||
${1:method_name}: function(${3:attribute}) {
|
||||
${VISUAL}$0
|
||||
}${10:,}
|
||||
endsnippet
|
||||
|
||||
snippet :, "Object Value JS"
|
||||
${1:value_name}: ${0:value},
|
||||
endsnippet
|
||||
|
||||
snippet : "Object key key: 'value'"
|
||||
${1:key}: ${2:"${3:value}"}${4:, }
|
||||
endsnippet
|
||||
|
||||
snippet proto "Prototype (proto)"
|
||||
${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {
|
||||
${VISUAL}$0
|
||||
};
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet for "for (...) {...} (counting up)" b
|
||||
for (var ${1:i} = 0, ${2:len} = ${3:Things.length}; $1 < $2; $1++) {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ford "for (...) {...} (counting down, faster)" b
|
||||
for (var ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fun "function (fun)"
|
||||
function ${1:function_name}(${2:argument}) {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet iife "Immediately-Invoked Function Expression (iife)"
|
||||
(function (${1:argument}) {
|
||||
${VISUAL}$0
|
||||
}(${2:$1}));
|
||||
endsnippet
|
||||
|
||||
snippet ife "if ___ else"
|
||||
if (${1:condition}) {
|
||||
${2://code}
|
||||
}
|
||||
else {
|
||||
${3://code}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet if "if"
|
||||
if (${1:condition}) {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet timeout "setTimeout function"
|
||||
setTimeout(function() {
|
||||
${VISUAL}$0
|
||||
}${2:.bind(${3:this})}, ${1:10});
|
||||
endsnippet
|
||||
|
||||
# Snippets for Console Debug Output
|
||||
|
||||
snippet ca "console.assert" b
|
||||
console.assert(${1:assertion}, ${2:"${3:message}"});
|
||||
endsnippet
|
||||
|
||||
snippet cclear "console.clear" b
|
||||
console.clear();
|
||||
endsnippet
|
||||
|
||||
snippet cdir "console.dir" b
|
||||
console.dir(${1:object});
|
||||
endsnippet
|
||||
|
||||
snippet cdirx "console.dirxml" b
|
||||
console.dirxml(${1:object});
|
||||
endsnippet
|
||||
|
||||
snippet ce "console.error" b
|
||||
console.error(${1:"${2:value}"});
|
||||
endsnippet
|
||||
|
||||
snippet cgroup "console.group" b
|
||||
console.group("${1:label}");
|
||||
${VISUAL}$0
|
||||
console.groupEnd();
|
||||
endsnippet
|
||||
|
||||
snippet cgroupc "console.groupCollapsed" b
|
||||
console.groupCollapsed("${1:label}");
|
||||
${VISUAL}$0
|
||||
console.groupEnd();
|
||||
endsnippet
|
||||
|
||||
snippet ci "console.info" b
|
||||
console.info(${1:"${2:value}"});
|
||||
endsnippet
|
||||
|
||||
snippet cl "console.log" b
|
||||
console.log(${1:"${2:value}"});
|
||||
endsnippet
|
||||
|
||||
snippet cprof "console.profile" b
|
||||
console.profile("${1:label}");
|
||||
${VISUAL}$0
|
||||
console.profileEnd();
|
||||
endsnippet
|
||||
|
||||
snippet ctable "console.table" b
|
||||
console.table(${1:"${2:value}"});
|
||||
endsnippet
|
||||
|
||||
snippet ctime "console.time" b
|
||||
console.time("${1:label}");
|
||||
${VISUAL}$0
|
||||
console.timeEnd("$1");
|
||||
endsnippet
|
||||
|
||||
snippet ctimestamp "console.timeStamp" b
|
||||
console.timeStamp("${1:label}");
|
||||
endsnippet
|
||||
|
||||
snippet ctrace "console.trace" b
|
||||
console.trace();
|
||||
endsnippet
|
||||
|
||||
snippet cw "console.warn" b
|
||||
console.warn(${1:"${2:value}"});
|
||||
endsnippet
|
||||
|
||||
# AMD (Asynchronous Module Definition) snippets
|
||||
|
||||
snippet def "define an AMD module"
|
||||
define(${1:optional_name, }[${2:'jquery'}], ${3:callback});
|
||||
endsnippet
|
||||
|
||||
snippet req "require an AMD module"
|
||||
require([${1:'dependencies'}], ${2:callback});
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
90
bundle/vim-snippets/UltiSnips/javascript_ember.snippets
Normal file
90
bundle/vim-snippets/UltiSnips/javascript_ember.snippets
Normal file
@ -0,0 +1,90 @@
|
||||
###################################################################
|
||||
# Ember snippets #
|
||||
###################################################################
|
||||
|
||||
priority -50
|
||||
|
||||
# Application
|
||||
snippet eapp "App.Name = Ember.Application.create({});"
|
||||
${1:App.Name} = Ember.Application.create({});
|
||||
endsnippet
|
||||
|
||||
# Models
|
||||
snippet emod "App.ModelName = Ember.Model.extend({...});"
|
||||
${1:model_name} = Ember.Model.extend({
|
||||
${0://Properties here...}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
# View
|
||||
snippet eview "App.ViewName = Ember.Model.extend({...});"
|
||||
${1:view_name} = Ember.View.extend({
|
||||
${0://Properties here...}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
# Controller
|
||||
snippet econtroller "App.ControllerName = Ember.Model.extend({...});"
|
||||
${1:controller_name} = Ember.ObjectController.extend({
|
||||
${0://Properties here...}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
# Route
|
||||
snippet eroute "App.RouteName = Ember.Route.extend({...});"
|
||||
${1:route_name} = Ember.Route.extend({
|
||||
${0://Properties here...}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet eview "App.ViewName = Ember.Model.create({...});"
|
||||
${1:view_name} = Ember.View.create({
|
||||
${0://Properties here...}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
# Object
|
||||
snippet eobj "App.ObjectName = Ember.Object.extend({...});"
|
||||
${1:object_name} = Ember.Object.create({
|
||||
${0://Properties here...}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
# Mixin
|
||||
snippet emix "App.MixinName = Ember.Model.extend({...});"
|
||||
${1:view_name} = Ember.Mixin.create({
|
||||
${0://Properties here...}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
# Ember getter and setter
|
||||
snippet eget "this.get('property');"
|
||||
${1:this}.get('${2:property}');
|
||||
endsnippet
|
||||
|
||||
snippet eset "this.set('property', value);"
|
||||
${1:this}.set('${2:property}', ${3:value});
|
||||
endsnippet
|
||||
|
||||
# Computer properties
|
||||
snippet cpro "property_name: function() {...}.property(),"
|
||||
${1:property_name}: function() {
|
||||
${0://body...}
|
||||
}.property('${3:argumenet}'),
|
||||
endsnippet
|
||||
|
||||
snippet cpro ": function() {...}.property('property'),"
|
||||
${1:property_name}: function() {
|
||||
${0://body...}
|
||||
}.property(),
|
||||
endsnippet
|
||||
|
||||
|
||||
# Observes
|
||||
snippet proo "property_name: function() {...}.property()"
|
||||
${1:property_name}: function() {
|
||||
${0://body...}
|
||||
}.observes('${3:property}'),
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
167
bundle/vim-snippets/UltiSnips/javascript_jasmine.snippets
Normal file
167
bundle/vim-snippets/UltiSnips/javascript_jasmine.snippets
Normal file
@ -0,0 +1,167 @@
|
||||
priority -50
|
||||
|
||||
# JavaScript versions -- from the TextMate bundle + some additions
|
||||
# for jasmine-jquery matchers
|
||||
#
|
||||
|
||||
snippet des "Describe (js)" b
|
||||
describe('${1:description}', function() {
|
||||
$0
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet it "it (js)" b
|
||||
it('${1:description}', function() {
|
||||
$0
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet bef "before each (js)" b
|
||||
beforeEach(function() {
|
||||
$0
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet aft "after each (js)" b
|
||||
afterEach(function() {
|
||||
$0
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet any "any (js)" b
|
||||
jasmine.any($1)
|
||||
endsnippet
|
||||
|
||||
snippet ru "runs (js)" b
|
||||
runs(function() {
|
||||
$0
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet wa "waits (js)" b
|
||||
waits($1);
|
||||
endsnippet
|
||||
|
||||
snippet ex "expect (js)" b
|
||||
expect(${1:target})$0;
|
||||
endsnippet
|
||||
|
||||
snippet ee "expect to equal (js)" b
|
||||
expect(${1:target}).toEqual(${2:value});
|
||||
endsnippet
|
||||
|
||||
snippet em "expect to match (js)" b
|
||||
expect(${1:target}).toMatch(${2:pattern});
|
||||
endsnippet
|
||||
|
||||
snippet eha "expect to have attribute (js)" b
|
||||
expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'});
|
||||
endsnippet
|
||||
|
||||
snippet et "expect to be truthy (js)" b
|
||||
expect(${1:target}).toBeTruthy();
|
||||
endsnippet
|
||||
|
||||
snippet ef "expect to be falsy (js)" b
|
||||
expect(${1:target}).toBeFalsy();
|
||||
endsnippet
|
||||
|
||||
snippet ed "expect to be defined (js)" b
|
||||
expect(${1:target}).toBeDefined();
|
||||
endsnippet
|
||||
|
||||
snippet en "expect to be null (js)" b
|
||||
expect(${1:target}).toBeNull();
|
||||
endsnippet
|
||||
|
||||
snippet ec "expect to contain (js)" b
|
||||
expect(${1:target}).toContain(${2:value});
|
||||
endsnippet
|
||||
|
||||
snippet ev "expect to be visible (js)" b
|
||||
expect(${1:target}).toBeVisible();
|
||||
endsnippet
|
||||
|
||||
snippet eh "expect to be hidden (js)" b
|
||||
expect(${1:target}).toBeHidden();
|
||||
endsnippet
|
||||
|
||||
snippet notx "expect not (js)" b
|
||||
expect(${1:target}).not$0;
|
||||
endsnippet
|
||||
|
||||
snippet note "expect not to equal (js)" b
|
||||
expect(${1:target}).not.toEqual(${2:value});
|
||||
endsnippet
|
||||
|
||||
snippet notm "expect not to match (js)" b
|
||||
expect(${1:target}).not.toMatch(${2:pattern});
|
||||
endsnippet
|
||||
|
||||
snippet notha "expect to not have attribute (js)" b
|
||||
expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'});
|
||||
endsnippet
|
||||
|
||||
snippet nott "expect not to be truthy (js)" b
|
||||
expect(${1:target}).not.toBeTruthy();
|
||||
endsnippet
|
||||
|
||||
snippet notf "expect not to be falsy (js)" b
|
||||
expect(${1:target}).not.toBeFalsy();
|
||||
endsnippet
|
||||
|
||||
snippet notd "expect not to be defined (js)" b
|
||||
expect(${1:target}).not.toBeDefined();
|
||||
endsnippet
|
||||
|
||||
snippet notn "expect not to be null (js)" b
|
||||
expect(${1:target}).not.toBeNull();
|
||||
endsnippet
|
||||
|
||||
snippet notc "expect not to contain (js)" b
|
||||
expect(${1:target}).not.toContain(${2:value});
|
||||
endsnippet
|
||||
|
||||
snippet notv "expect not to be visible (js)" b
|
||||
expect(${1:target}).not.toBeVisible();
|
||||
endsnippet
|
||||
|
||||
snippet noth "expect not to be hidden (js)" b
|
||||
expect(${1:target}).not.toBeHidden();
|
||||
endsnippet
|
||||
|
||||
snippet s "spy on (js)" b
|
||||
spyOn(${1:object}, '${2:method}')$0;
|
||||
endsnippet
|
||||
|
||||
snippet sr "spy on and return (js)" b
|
||||
spyOn(${1:object}, '${2:method}').andReturn(${3:arguments});
|
||||
endsnippet
|
||||
|
||||
snippet st "spy on and throw (js)" b
|
||||
spyOn(${1:object}, '${2:method}').andThrow(${3:exception});
|
||||
endsnippet
|
||||
|
||||
snippet sct "spy on and call through (js)" b
|
||||
spyOn(${1:object}, '${2:method}').andCallThrough();
|
||||
endsnippet
|
||||
|
||||
snippet scf "spy on and call fake (js)" b
|
||||
spyOn(${1:object}, '${2:method}').andCallFake(${3:function});
|
||||
endsnippet
|
||||
|
||||
snippet esc "expect was called (js)" b
|
||||
expect(${1:target}).wasCalled();
|
||||
endsnippet
|
||||
|
||||
snippet escw "expect was called with (js)" b
|
||||
expect(${1:target}).wasCalledWith(${2:arguments});
|
||||
endsnippet
|
||||
|
||||
snippet notsc "expect was not called (js)" b
|
||||
expect(${1:target}).wasNotCalled();
|
||||
endsnippet
|
||||
|
||||
snippet noscw "expect was not called with (js)" b
|
||||
expect(${1:target}).wasNotCalledWith(${2:arguments});
|
||||
endsnippet
|
51
bundle/vim-snippets/UltiSnips/javascript_jsdoc.snippets
Normal file
51
bundle/vim-snippets/UltiSnips/javascript_jsdoc.snippets
Normal file
@ -0,0 +1,51 @@
|
||||
priority -50
|
||||
|
||||
# JSDoc snippets
|
||||
|
||||
snippet /* "A JSDoc comment" b
|
||||
/**
|
||||
* ${1:${VISUAL}}$0
|
||||
*/
|
||||
endsnippet
|
||||
|
||||
snippet @au "@author email (First Last)"
|
||||
@author ${1:`!v g:snips_author_email`} (${2:`!v g:snips_author`})
|
||||
endsnippet
|
||||
|
||||
snippet @li "@license Description"
|
||||
@license ${1:MIT}$0
|
||||
endsnippet
|
||||
|
||||
snippet @ver "@version Semantic version"
|
||||
@version ${1:0.1.0}$0
|
||||
endsnippet
|
||||
|
||||
snippet @fileo "@fileoverview Description" b
|
||||
/**
|
||||
* @fileoverview ${1:${VISUAL:A description of the file}}$0
|
||||
*/
|
||||
endsnippet
|
||||
|
||||
snippet @constr "@constructor"
|
||||
@constructor
|
||||
endsnippet
|
||||
|
||||
snippet @p "@param {Type} varname Description"
|
||||
@param {${1:Type}} ${2:varname} ${3:Description}
|
||||
endsnippet
|
||||
|
||||
snippet @ret "@return {Type} Description"
|
||||
@return {${1:Type}} ${2:Description}
|
||||
endsnippet
|
||||
|
||||
snippet @pri "@private"
|
||||
@private
|
||||
endsnippet
|
||||
|
||||
snippet @over "@override"
|
||||
@override
|
||||
endsnippet
|
||||
|
||||
snippet @pro "@protected"
|
||||
@protected
|
||||
endsnippet
|
209
bundle/vim-snippets/UltiSnips/jinja2.snippets
Normal file
209
bundle/vim-snippets/UltiSnips/jinja2.snippets
Normal file
@ -0,0 +1,209 @@
|
||||
priority -50
|
||||
|
||||
# http://jinja.pocoo.org/
|
||||
|
||||
# jinja2 is a full featured template engine for Python. It has full
|
||||
# unicode support, an optional integrated sandboxed execution
|
||||
# environment, widely used and BSD licensed.
|
||||
|
||||
# possible extends:
|
||||
#extends html
|
||||
|
||||
|
||||
snippet block "block" b
|
||||
{% block ${1:name} %}
|
||||
$2
|
||||
{% endblock $1 %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet {{ "variable" b
|
||||
{{ $1 }}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet {# "comment" b
|
||||
{# $1 #}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet # "comment" b
|
||||
{# $1 #}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet raw "escaped block" b
|
||||
{% raw %}
|
||||
$1
|
||||
{% endraw %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet extends "extends" b
|
||||
{% extends "${1:template}" %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet include "include" b
|
||||
{% include "${1:template}" %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet import "import" b
|
||||
{% import "${1:template}" %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet from "from/import/as" b
|
||||
{% from "${1:template}" import ${2:name}${3: as ${4:$2}} %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet filter "filter" b
|
||||
{% filter ${1:filter} %}
|
||||
$2
|
||||
{% endfilter %}
|
||||
endsnippet
|
||||
|
||||
|
||||
# Being able to quickly remove the whole 'else' block seems faster to me than
|
||||
# choosing between 'for' and 'for/else' snippets from the menu.
|
||||
# snippet for "for" b
|
||||
# {% for ${1:item} in ${2:sequence} %}
|
||||
# $3${4:
|
||||
# {% else %}
|
||||
# $5}
|
||||
# {% endfor %}
|
||||
# endsnippet
|
||||
|
||||
|
||||
snippet for "for" b
|
||||
{% for ${1:item} in ${2:sequence} %}
|
||||
$3
|
||||
{% endfor %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet for "for/else" b
|
||||
{% for ${1:item} in ${2:sequence} %}
|
||||
$3
|
||||
{% else %}
|
||||
$4
|
||||
{% endfor %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet if "if" b
|
||||
{% if ${1:expr} %}
|
||||
$2
|
||||
{% endif %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet if "if/else" b
|
||||
{% if ${1:expr} %}
|
||||
$2
|
||||
{% else %}
|
||||
$3
|
||||
{% endif %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet if "if/elif/else" b
|
||||
{% if ${1:expr} %}
|
||||
$2
|
||||
{% elif %}
|
||||
$3
|
||||
{% else %}
|
||||
$4
|
||||
{% endif %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet macro "macro" b
|
||||
{% macro ${1:name}(${2:args}) %}
|
||||
$3
|
||||
{% endmacro %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet call "call" b
|
||||
{% call ${1:name}(${2:args}) %}
|
||||
$3
|
||||
{% endcall %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet set "set" b
|
||||
{% set ${1:name} = ${2:'value'} %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet trans "translation" b
|
||||
{% trans %}
|
||||
$1
|
||||
{% endtrans %}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet with "with" b
|
||||
{% with %}
|
||||
$1
|
||||
{% endwith %}
|
||||
endsnippet
|
||||
|
||||
snippet autoescape "autoescape" b
|
||||
{% autoescape ${1:true} %}
|
||||
$2
|
||||
{% endautoescape %}
|
||||
endsnippet
|
||||
|
||||
# Filters
|
||||
# @todo: expand only when snippet is preceeded by a |
|
||||
|
||||
snippet batch "batch items" w
|
||||
batch(linecount=$1, fill_with=${2:None})
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet dictsort "sort and yield (key, value) pairs" w
|
||||
dictsort(case_sensitive=${1:False}, by=${2:'key'})
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet round "round number" w
|
||||
round(precision=${1:0}, method=${2:'common|ceil|floor'})
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet urlize "convert plain-text url to <a/>" w
|
||||
urlize(trim_url_limit=${1:None}, nofollow=${2:False})
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet wordwrap "wordwrap" w
|
||||
wordwrap(width=${1:79}, break_long_words=${2:True})
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet truncate "truncate" w
|
||||
truncate(lenght=${1:79}, killwords=${2:False}, end=${3:'...''})
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet sum "sum of sequence of numbers + start" w
|
||||
sum(attribute=${1:None}, start=${2:0})
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet sort "sort an iterable" w
|
||||
sort(reverse=${1:False}, case_sensitive=${2:False}, attribute=${3:None})
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet indent "indent" w
|
||||
indent(width=${1:4}, indentfirst=${2:False})
|
||||
endsnippet
|
||||
|
||||
|
||||
# vim:ft=snippets:
|
20
bundle/vim-snippets/UltiSnips/json.snippets
Normal file
20
bundle/vim-snippets/UltiSnips/json.snippets
Normal file
@ -0,0 +1,20 @@
|
||||
priority -50
|
||||
|
||||
snippet s "String" b
|
||||
"${1:key}": "${0:value}",
|
||||
endsnippet
|
||||
|
||||
snippet n "number" b
|
||||
"${1:key}": ${0:value},
|
||||
endsnippet
|
||||
|
||||
snippet a "Array" b
|
||||
[
|
||||
${VISUAL}$0
|
||||
],
|
||||
endsnippet
|
||||
snippet o "Object" b
|
||||
{
|
||||
${VISUAL}$0
|
||||
},
|
||||
endsnippet
|
8
bundle/vim-snippets/UltiSnips/ledger.snippets
Normal file
8
bundle/vim-snippets/UltiSnips/ledger.snippets
Normal file
@ -0,0 +1,8 @@
|
||||
priority -50
|
||||
|
||||
snippet t "Transaction" b
|
||||
${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} ${4:*} ${5:Payee}
|
||||
${6:Expenses} \$${7:0.00}
|
||||
${8:Assets:Checking}
|
||||
$0
|
||||
endsnippet
|
3
bundle/vim-snippets/UltiSnips/lhaskell.snippets
Normal file
3
bundle/vim-snippets/UltiSnips/lhaskell.snippets
Normal file
@ -0,0 +1,3 @@
|
||||
priority -50
|
||||
|
||||
extends haskell
|
39
bundle/vim-snippets/UltiSnips/lua.snippets
Normal file
39
bundle/vim-snippets/UltiSnips/lua.snippets
Normal file
@ -0,0 +1,39 @@
|
||||
priority -50
|
||||
|
||||
#################################
|
||||
# Snippets for the Lua language #
|
||||
#################################
|
||||
snippet #! "Shebang header" b
|
||||
#!/usr/bin/env lua
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet !fun(ction)?! "New function" br
|
||||
function ${1:new_function}(${2:args})
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet forp "pair for loop" b
|
||||
for ${1:name},${2:val} in pairs(${3:table_name}) do
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet fori "ipair for foop" b
|
||||
for ${1:idx},${2:val} in ipairs(${3:table_name}) do
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet for "numeric for loop" b
|
||||
for ${1:i}=${2:first},${3:last}${4/^..*/(?0:,:)/}${4:step} do
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet local "local x = 1"
|
||||
local ${1:x} = ${0:1}
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
92
bundle/vim-snippets/UltiSnips/mako.snippets
Normal file
92
bundle/vim-snippets/UltiSnips/mako.snippets
Normal file
@ -0,0 +1,92 @@
|
||||
priority -50
|
||||
|
||||
#################
|
||||
# From snipmate #
|
||||
#################
|
||||
snippet def "definition" b
|
||||
<%def name="${1:name}">
|
||||
${2:}
|
||||
</%def>
|
||||
endsnippet
|
||||
|
||||
snippet call "call" b
|
||||
<%call expr="${1:name}">
|
||||
${2:}
|
||||
</%call>
|
||||
endsnippet
|
||||
|
||||
snippet doc "doc" b
|
||||
<%doc>
|
||||
${1:}
|
||||
</%doc>
|
||||
endsnippet
|
||||
|
||||
snippet text "text" b
|
||||
<%text>
|
||||
${1:}
|
||||
</%text>
|
||||
endsnippet
|
||||
|
||||
snippet for "for" b
|
||||
% for ${1:i} in ${2:iter}:
|
||||
${3:}
|
||||
% endfor
|
||||
endsnippet
|
||||
|
||||
snippet if "if " b
|
||||
% if ${1:condition}:
|
||||
${2:}
|
||||
% endif
|
||||
endsnippet
|
||||
|
||||
snippet if "if/else" b
|
||||
% if ${1:condition}:
|
||||
${2:}
|
||||
% else:
|
||||
${3:}
|
||||
% endif
|
||||
endsnippet
|
||||
|
||||
snippet try "try" b
|
||||
% try:
|
||||
${1:}
|
||||
% except${2:}:
|
||||
${3:pass}
|
||||
% endtry
|
||||
endsnippet
|
||||
|
||||
snippet wh "wh" b
|
||||
% while ${1:}:
|
||||
${2:}
|
||||
% endwhile
|
||||
endsnippet
|
||||
|
||||
snippet $ "$" i
|
||||
${${1:}}
|
||||
endsnippet
|
||||
|
||||
snippet <% "<%" b
|
||||
<% ${1:} %>
|
||||
endsnippet
|
||||
|
||||
snippet <!% "<!%" b
|
||||
<!% ${1:} %>
|
||||
endsnippet
|
||||
|
||||
snippet inherit "inherit" b
|
||||
<%inherit file="${1:filename}" />
|
||||
endsnippet
|
||||
|
||||
snippet include "include" b
|
||||
<%include file="${1:filename}" />
|
||||
endsnippet
|
||||
|
||||
snippet namespace "namespace" b
|
||||
<%namespace file="${1:name}" />
|
||||
endsnippet
|
||||
|
||||
snippet page "page" b
|
||||
<%page args="${1:}" />
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
42
bundle/vim-snippets/UltiSnips/markdown.snippets
Normal file
42
bundle/vim-snippets/UltiSnips/markdown.snippets
Normal file
@ -0,0 +1,42 @@
|
||||
priority -50
|
||||
|
||||
###########################
|
||||
# Sections and Paragraphs #
|
||||
###########################
|
||||
snippet sec "Section" b
|
||||
# ${1:Section Name} #
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ssec "Sub Section" b
|
||||
## ${1:Section Name} ##
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet sssec "SubSub Section" b
|
||||
### ${1:Section Name} ###
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet par "Paragraph" b
|
||||
#### ${1:Paragraph Name} ####
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet spar "Paragraph" b
|
||||
##### ${1:Paragraph Name} #####
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
################
|
||||
# Common stuff #
|
||||
################
|
||||
snippet link "Link to something"
|
||||
[${1:${VISUAL:Text}}](${3:http://${2:www.url.com}})$0
|
||||
endsnippet
|
||||
|
||||
snippet img "Image"
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
272
bundle/vim-snippets/UltiSnips/objc.snippets
Normal file
272
bundle/vim-snippets/UltiSnips/objc.snippets
Normal file
@ -0,0 +1,272 @@
|
||||
priority -50
|
||||
|
||||
###########################################################################
|
||||
# TextMate Snippets #
|
||||
###########################################################################
|
||||
|
||||
snippet imp "#import (imp)" b
|
||||
#import "${1:`!p snip.rv = re.sub(r'\..*$', '.h', fn)`}"
|
||||
endsnippet
|
||||
|
||||
snippet Imp "#import <> (Imp)"
|
||||
#import <${1:Cocoa/Cocoa.h}>
|
||||
endsnippet
|
||||
|
||||
snippet cl "020 Class (objc)"
|
||||
@interface ${1:`!p
|
||||
if len(fn):
|
||||
snip.rv = re.sub(r'\..*$', '', fn)
|
||||
else:
|
||||
snip.rv = "object"
|
||||
`} : ${2:NSObject}
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation $1
|
||||
- (id)init
|
||||
{
|
||||
if((self = [super init]))
|
||||
{$0
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
endsnippet
|
||||
|
||||
snippet array "NSArray (array)"
|
||||
NSMutableArray *${1:array} = [NSMutableArray array];
|
||||
endsnippet
|
||||
|
||||
snippet dict "NSDictionary (dict)"
|
||||
NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];
|
||||
endsnippet
|
||||
|
||||
snippet forarray "for NSArray loop (forarray)"
|
||||
unsigned int ${1:object}Count = [${2:array} count];
|
||||
|
||||
for(unsigned int index = 0; index < $1Count; index += 1)
|
||||
{
|
||||
${3:id} $1 = [$2 objectAtIndex:index];
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet objacc "Object Accessors (objacc)"
|
||||
- (${1:id})${2:thing}
|
||||
{
|
||||
return $2;
|
||||
}
|
||||
|
||||
- (void)set${2/./\u$0/}:($1)aValue
|
||||
{
|
||||
$0${1/( \*)?$/(?1:$1: )/}old${2/./\u$0/} = $2;
|
||||
$2 = [aValue retain];
|
||||
[old${2/./\u$0/} release];
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet sel "@selector"
|
||||
@selector(${1:method}:)
|
||||
endsnippet
|
||||
|
||||
snippet cdacc "CoreData Accessors Implementation"
|
||||
- (${1:id})${2:attribute}
|
||||
{
|
||||
[self willAccessValueForKey:@"$2"];
|
||||
$1 value = [self primitiveValueForKey:@"$2"];
|
||||
[self didAccessValueForKey:@"$2"];
|
||||
return value;
|
||||
}
|
||||
|
||||
- (void)set${2/./\u$0/}:($1)aValue
|
||||
{
|
||||
[self willChangeValueForKey:@"$2"];
|
||||
[self setPrimitiveValue:aValue forKey:@"$2"];
|
||||
[self didChangeValueForKey:@"$2"];
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet delegate "Delegate Responds to Selector"
|
||||
if([${1:[self delegate]} respondsToSelector:@selector(${2:selfDidSomething:})])
|
||||
[$1 ${3:${2/((^\s*([A-Za-z0-9_]*:)\s*)|(:\s*$)|(:\s*))/(?2:$2self :\:<>)(?4::)(?5: :)/g}}];
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet thread "Detach New NSThread"
|
||||
[NSThread detachNewThreadSelector:@selector(${1:method}:) toTarget:${2:aTarget} withObject:${3:anArgument}]
|
||||
endsnippet
|
||||
|
||||
snippet ibo "IBOutlet (ibo)"
|
||||
IBOutlet ${1:NSSomeClass} *${2:${1/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}};
|
||||
endsnippet
|
||||
|
||||
snippet I "Initialize Implementation (I)"
|
||||
+ (void)initialize
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
$0@"value", @"key",
|
||||
nil]];
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet bind "Key:value binding (bind)"
|
||||
bind:@"${1:binding}" toObject:${2:observableController} withKeyPath:@"${3:keyPath}" options:${4:nil}
|
||||
endsnippet
|
||||
|
||||
snippet arracc "LoD array (arracc)"
|
||||
- (void)addObjectTo${1:Things}:(${2:id})anObject
|
||||
{
|
||||
[${3:${1/./\l$0/}} addObject:anObject];
|
||||
}
|
||||
|
||||
- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i
|
||||
{
|
||||
[$3 insertObject:anObject atIndex:i];
|
||||
}
|
||||
|
||||
- ($2)objectIn$1AtIndex:(unsigned int)i
|
||||
{
|
||||
return [$3 objectAtIndex:i];
|
||||
}
|
||||
|
||||
- (unsigned int)indexOfObjectIn$1:($2)anObject
|
||||
{
|
||||
return [$3 indexOfObject:anObject];
|
||||
}
|
||||
|
||||
- (void)removeObjectFrom$1AtIndex:(unsigned int)i
|
||||
{
|
||||
[$3 removeObjectAtIndex:i];
|
||||
}
|
||||
|
||||
- (unsigned int)countOf$1
|
||||
{
|
||||
return [$3 count];
|
||||
}
|
||||
|
||||
- (NSArray *${1/./\l$0/}
|
||||
{
|
||||
return $3;
|
||||
}
|
||||
|
||||
- (void)set$1:(NSArray *)new$1
|
||||
{
|
||||
[$3 setArray:new$1];
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet arracc "LoD array interface (arracc)"
|
||||
- (void)addObjectTo${1:Things}:(${2:id})anObject;
|
||||
- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i;
|
||||
- ($2)objectIn$1AtIndex:(unsigned int)i;
|
||||
- (unsigned int)indexOfObjectIn$1:($2)anObject;
|
||||
- (void)removeObjectFrom$1AtIndex:(unsigned int)i;
|
||||
- (unsigned int)countOf$1;
|
||||
- (NSArray *)${1/./\l$0/};
|
||||
- (void)set$1:(NSArray *)new$1;
|
||||
endsnippet
|
||||
|
||||
snippet focus "Lock Focus"
|
||||
[self lockFocus];
|
||||
$0
|
||||
[self unlockFocus];
|
||||
endsnippet
|
||||
|
||||
snippet pool "NSAutoreleasePool (pool)"
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
$0
|
||||
[pool drain];
|
||||
endsnippet
|
||||
|
||||
snippet log "NSLog (log) 2"
|
||||
NSLog(@"$1"${1/[^%]*(%)?.*/(?1:, :\);)/}$2${1/[^%]*(%)?.*/(?1:\);)/}
|
||||
endsnippet
|
||||
|
||||
snippet alert "NSRunAlertPanel (alert)"
|
||||
int choice = NSRunAlertPanel(@"${1:Something important!}", @"${2:Something important just happend, and now I need to ask you, do you want to continue?}", @"${3:Continue}", @"${4:Cancel}", nil);
|
||||
if(choice == NSAlertDefaultReturn) // "$3"
|
||||
{
|
||||
$0;
|
||||
}
|
||||
else if(choice == NSAlertAlternateReturn) // "$4"
|
||||
{
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet format "NSString stringWithFormat (format)"
|
||||
[NSString stringWithFormat:@"$1", $2]$0
|
||||
endsnippet
|
||||
|
||||
snippet objacc "Object Accessors Interface (objacc)"
|
||||
- (${1:id})${2:thing};
|
||||
- (void)set${2/./\u$0/}:($1)aValue;
|
||||
endsnippet
|
||||
|
||||
snippet prop "Property"
|
||||
@property (${1/^(e)$|.*/(?1:r)/}${1:r}${1/^(?:(r)|(e)|(c)|(a))$|.*/(?1:etain)(?2:adonly)(?3:opy)(?4:ssign)/}) ${2:NSSomeClass}$ *${3:${2/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}};
|
||||
endsnippet
|
||||
|
||||
snippet getprefs "Read from defaults (getprefs)"
|
||||
[[NSUserDefaults standardUserDefaults] objectForKey:${1:key}];
|
||||
endsnippet
|
||||
|
||||
snippet obs "Register for Notification"
|
||||
[[NSNotificationCenter defaultCenter] addObserver:${1:self} selector:@selector(${3:${2/^([A-Z]{2})?(.+?)(Notification)?$/\l$2/}}:) name:${2:NSWindowDidBecomeMainNotification} object:${4:nil}];
|
||||
endsnippet
|
||||
|
||||
snippet responds "Responds to Selector"
|
||||
if ([${1:self} respondsToSelector:@selector(${2:someSelector:})])
|
||||
{
|
||||
[$1 ${3:${2/((:\s*$)|(:\s*))/:<>(?3: )/g}}];
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet gsave "Save and Restore Graphics Context (gsave)"
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
$0
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet acc "Scalar Accessors (acc)"
|
||||
- (${1:unsigned int})${2:thing}
|
||||
{
|
||||
return ${3:$2};
|
||||
}
|
||||
|
||||
- (void)set${2/./\u$0/}:(${1:unsigned int})new${2/./\u$0/}
|
||||
{
|
||||
$3 = new${2/./\u$0/};
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet acc "Scalar Accessors Interface (acc)"
|
||||
- (${1:unsigned int})${2:thing};
|
||||
- (void)set${2/./\u$0/}:($1)new${2/./\u$0/};
|
||||
endsnippet
|
||||
|
||||
snippet stracc "String Accessors (stracc)"
|
||||
- (NSString *)${1:thing}
|
||||
{
|
||||
return ${2:$1};
|
||||
}
|
||||
|
||||
- (void)set${1/.*/\u$0/}:(NSString *)/})${3:a${1/.*/\u$0/}}
|
||||
{
|
||||
$3 = [$3 copy];
|
||||
[$2 release];
|
||||
$2 = $3;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet syn "Synthesize"
|
||||
@synthesize ${1:property};
|
||||
endsnippet
|
||||
|
||||
snippet setprefs "Write to defaults (setprefs)"
|
||||
[[NSUserDefaults standardUserDefaults] setObject:${1:object} forKey:${2:key}];
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
174
bundle/vim-snippets/UltiSnips/ocaml.snippets
Normal file
174
bundle/vim-snippets/UltiSnips/ocaml.snippets
Normal file
@ -0,0 +1,174 @@
|
||||
priority -50
|
||||
|
||||
snippet rs "raise" b
|
||||
raise (${1:Not_found})
|
||||
endsnippet
|
||||
|
||||
snippet open "open"
|
||||
let open ${1:module} in
|
||||
${2:e}
|
||||
endsnippet
|
||||
|
||||
snippet try "try"
|
||||
try ${1:e}
|
||||
with ${2:Not_found} -> ${3:()}
|
||||
endsnippet
|
||||
|
||||
snippet ref "ref"
|
||||
let ${1:name} = ref ${2:val} in
|
||||
${3:e}
|
||||
endsnippet
|
||||
|
||||
snippet matchl "pattern match on a list"
|
||||
match ${1:list} with
|
||||
| [] -> ${2:()}
|
||||
| x::xs -> ${3:()}
|
||||
endsnippet
|
||||
|
||||
snippet matcho "pattern match on an option type"
|
||||
match ${1:x} with
|
||||
| Some(${2:y}) -> ${3:()}
|
||||
| None -> ${4:()}
|
||||
endsnippet
|
||||
|
||||
snippet fun "anonymous function"
|
||||
(fun ${1:x} -> ${2:x})
|
||||
endsnippet
|
||||
|
||||
snippet cc "commment"
|
||||
(* ${1:comment} *)
|
||||
endsnippet
|
||||
|
||||
snippet let "let .. in binding"
|
||||
let ${1:x} = ${2:v} in
|
||||
${3:e}
|
||||
endsnippet
|
||||
|
||||
snippet lr "let rec"
|
||||
let rec ${1:f} =
|
||||
${2:expr}
|
||||
endsnippet
|
||||
|
||||
snippet if "if"
|
||||
if ${1:(* condition *)} then
|
||||
${2:(* A *)}
|
||||
else
|
||||
${3:(* B *)}
|
||||
endsnippet
|
||||
|
||||
snippet If "If"
|
||||
if ${1:(* condition *)} then
|
||||
${2:(* A *)}
|
||||
endsnippet
|
||||
|
||||
snippet while "while"
|
||||
while ${1:(* condition *)} do
|
||||
${2:(* A *)}
|
||||
done
|
||||
endsnippet
|
||||
|
||||
snippet for "for"
|
||||
for ${1:i} = ${2:1} to ${3:10} do
|
||||
${4:(* BODY *)}
|
||||
done
|
||||
endsnippet
|
||||
|
||||
snippet match "match"
|
||||
match ${1:(* e1 *)} with
|
||||
| ${2:p} -> ${3:e2}
|
||||
endsnippet
|
||||
|
||||
snippet Match "match"
|
||||
match ${1:(* e1 *)} with
|
||||
| ${2:p} -> ${3:e2}
|
||||
endsnippet
|
||||
|
||||
snippet class "class"
|
||||
class ${1:name} = object
|
||||
${2:methods}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet obj "obj"
|
||||
object
|
||||
${2:methods}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet Obj "object"
|
||||
object (self)
|
||||
${2:methods}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet {{ "object functional update"
|
||||
{< ${1:x} = ${2:y} >}
|
||||
endsnippet
|
||||
|
||||
snippet beg "beg"
|
||||
begin
|
||||
${1:block}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet ml "module instantiantion with functor"
|
||||
module ${1:Mod} = ${2:Functor}(${3:Arg})
|
||||
endsnippet
|
||||
|
||||
snippet mod "module - no signature"
|
||||
module ${1:(* Name *)} = struct
|
||||
${2:(* BODY *)}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet Mod "module with signature"
|
||||
module ${1:(* Name *)} : ${2:(* SIG *)} = struct
|
||||
${3:(* BODY *)}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet sig "anonymous signature"
|
||||
sig
|
||||
${2:(* BODY *)}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet sigf "functor signature or anonymous functor"
|
||||
functor (${1:Arg} : ${2:ARG}) -> ${3:(* BODY *)}
|
||||
endsnippet
|
||||
|
||||
snippet func "define functor - no signature"
|
||||
module ${1:M} (${2:Arg} : ${3:ARG}) = struct
|
||||
${4:(* BODY *)}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet Func "define functor - with signature"
|
||||
module ${1:M} (${2:Arg} : ${3:ARG}) : ${4:SIG} = struct
|
||||
${5:(* BODY *)}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet mot "Declare module signature"
|
||||
module type ${1:(* Name *)} = sig
|
||||
${2:(* BODY *)}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet module "Module with anonymous signature"
|
||||
module ${1:(* Name *)} : sig
|
||||
${2:(* SIGNATURE *)}
|
||||
end = struct
|
||||
${3:(* BODY *)}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet oo "odoc"
|
||||
(** ${1:odoc} *)
|
||||
endsnippet
|
||||
|
||||
snippet qt "inline qtest"
|
||||
(*$T ${1:name}
|
||||
${2:test}
|
||||
*)
|
||||
endsnippet
|
132
bundle/vim-snippets/UltiSnips/perl.snippets
Normal file
132
bundle/vim-snippets/UltiSnips/perl.snippets
Normal file
@ -0,0 +1,132 @@
|
||||
priority -50
|
||||
|
||||
###########################################################################
|
||||
# TextMate Snippets #
|
||||
###########################################################################
|
||||
snippet ife "Conditional if..else (ife)"
|
||||
if ($1) {
|
||||
${2:# body...}
|
||||
}
|
||||
else {
|
||||
${3:# else...}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet ifee "Conditional if..elsif..else (ifee)"
|
||||
if ($1) {
|
||||
${2:# body...}
|
||||
}
|
||||
elsif ($3) {
|
||||
${4:# elsif...}
|
||||
}
|
||||
else {
|
||||
${5:# else...}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet xunless "Conditional one-line (unless)"
|
||||
${1:expression} unless ${2:condition};
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet xif "Conditional one-line (xif)"
|
||||
${1:expression} if ${2:condition};
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet sub "Function (sub)"
|
||||
sub ${1:function_name} {
|
||||
${2:# body...}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet xfore "Loop one-line (xforeach)"
|
||||
${1:expression} foreach @${2:array};
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet xwhile "Loop one-line (xwhile)"
|
||||
${1:expression} while ${2:condition};
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet test "Test"
|
||||
#!/usr/bin/env perl -w
|
||||
|
||||
use strict;
|
||||
use Test::More tests => ${1:1};
|
||||
use ${2:ModuleName};
|
||||
|
||||
ok(${3:assertion});
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet class "class"
|
||||
package ${1:ClassName};
|
||||
|
||||
${2:use parent qw(${3:ParentClass});}${2/.+/\n\n/}sub new {
|
||||
my $class = shift;
|
||||
$class = ref $class if ref $class;
|
||||
my $self = bless {}, $class;
|
||||
$self;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet eval "eval"
|
||||
local $@;
|
||||
eval {
|
||||
${1:# do something risky...}
|
||||
};
|
||||
if (my $${2:exception} = $@) {
|
||||
${3:# handle failure...}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet for "for"
|
||||
for (my $${1:var} = 0; $$1 < ${2:expression}; $$1++) {
|
||||
${3:# body...}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet fore "foreach"
|
||||
foreach ${1:my $${2:x}} (@${3:array}) {
|
||||
${4:# body...}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet if "if"
|
||||
if ($1) {
|
||||
${2:# body...}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet slurp "slurp"
|
||||
my $${1:var} = do { local $/ = undef; open my $fh, '<', ${2:$file}; <$fh> };
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet unless "unless"
|
||||
unless ($1) {
|
||||
${2:# body...}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet while "while"
|
||||
while ($1) {
|
||||
${2:# body...}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
264
bundle/vim-snippets/UltiSnips/php.snippets
Normal file
264
bundle/vim-snippets/UltiSnips/php.snippets
Normal file
@ -0,0 +1,264 @@
|
||||
priority -50
|
||||
|
||||
## Snippets from SnipMate, taken from
|
||||
## https://github.com/scrooloose/snipmate-snippets.git
|
||||
|
||||
snippet array "array"
|
||||
$${1:arrayName} = array('${2}' => ${3});${4}
|
||||
endsnippet
|
||||
|
||||
snippet def "def"
|
||||
define('${1}'${2});${3}
|
||||
endsnippet
|
||||
|
||||
snippet do "do"
|
||||
do {
|
||||
${2:// code... }
|
||||
} while (${1:/* condition */});"
|
||||
endsnippet
|
||||
|
||||
snippet doc_f "doc_f"
|
||||
/**
|
||||
* $2
|
||||
* @return ${4:void}
|
||||
* @author ${5:`!v g:snips_author`}
|
||||
**/
|
||||
${1:public }function ${2:someFunc}(${3})
|
||||
{${6}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet doc_i "doc_i"
|
||||
/**
|
||||
* $1
|
||||
* @package ${2:default}
|
||||
* @author ${3:`!v g:snips_author`}
|
||||
**/
|
||||
interface ${1:someClass}
|
||||
{${4}
|
||||
} // END interface $1"
|
||||
endsnippet
|
||||
|
||||
snippet else "else"
|
||||
else {
|
||||
${1:// code...}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet for "for"
|
||||
for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
|
||||
${4:// code...}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet foreachk "foreachk"
|
||||
foreach ($${1:variable} as $${2:key} => $${3:value}){
|
||||
${4:// code...}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet get "get"
|
||||
$_GET['${1}']${2}
|
||||
endsnippet
|
||||
|
||||
snippet if "if"
|
||||
if (${1:/* condition */}) {
|
||||
${2:// code...}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet inc "inc"
|
||||
include '${1:file}';${2}
|
||||
endsnippet
|
||||
|
||||
snippet log "log"
|
||||
error_log(var_export(${1}, true));${2}
|
||||
endsnippet
|
||||
|
||||
snippet post "post"
|
||||
$_POST['${1}']${2}
|
||||
endsnippet
|
||||
|
||||
snippet req1 "req1"
|
||||
require_once '${1:file}';${2}
|
||||
endsnippet
|
||||
|
||||
snippet session "session"
|
||||
$_SESSION['${1}']${2}
|
||||
endsnippet
|
||||
|
||||
snippet t "t"
|
||||
$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5}
|
||||
endsnippet
|
||||
|
||||
snippet var "var"
|
||||
var_export(${1});${2}
|
||||
endsnippet
|
||||
|
||||
snippet getter "PHP Class Getter" b
|
||||
/*
|
||||
* Getter for $1
|
||||
*/
|
||||
public function get${1/\w+\s*/\u$0/}()
|
||||
{
|
||||
return $this->$1;$2
|
||||
}
|
||||
$4
|
||||
endsnippet
|
||||
|
||||
snippet setter "PHP Class Setter" b
|
||||
/*
|
||||
* Setter for $1
|
||||
*/
|
||||
public function set${1/\w+\s*/\u$0/}($$1)
|
||||
{
|
||||
$this->$1 = $$1;$3
|
||||
${4:return $this;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet gs "PHP Class Getter Setter" b
|
||||
/*
|
||||
* Getter for ${1/(\w+)\s*;/$1/}
|
||||
*/
|
||||
public function get${1/(\w+)\s*;/\u$1/}()
|
||||
{
|
||||
return $this->${1/(\w+)\s*;/$1/};$2
|
||||
}
|
||||
|
||||
/*
|
||||
* Setter for ${1/(\w+)\s*;/$1/}
|
||||
*/
|
||||
public function set${1/(\w+)\s*;/\u$1/}($${1/(\w+)\s*;/$1/})
|
||||
{
|
||||
$this->${1/(\w+)\s*;/$1/} = $${1/(\w+)\s*;/$1/};$3
|
||||
${4:return $this;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet pub "Public function" b
|
||||
public function ${1:name}(${2:$param})
|
||||
{
|
||||
${VISUAL}${3:return null;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet pro "Protected function" b
|
||||
protected function ${1:name}(${2:$param})
|
||||
{
|
||||
${VISUAL}${3:return null;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet pri "Private function" b
|
||||
private function ${1:name}(${2:$param})
|
||||
{
|
||||
${VISUAL}${3:return null;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet pubs "Public static function" b
|
||||
public static function ${1:name}(${2:$param})
|
||||
{
|
||||
${VISUAL}${3:return null;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet pros "Protected static function" b
|
||||
protected static function ${1:name}(${2:$param})
|
||||
{
|
||||
${VISUAL}${3:return null;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet pris "Private static function" b
|
||||
private static function ${1:name}(${2:$param})
|
||||
{
|
||||
${VISUAL}${3:return null;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet fu "Function snip" b
|
||||
function ${1:name}(${2:$param})
|
||||
{
|
||||
${VISUAL}${3:return null;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet fore "Foreach loop"
|
||||
foreach ($${1:variable} as $${3:value}){
|
||||
${VISUAL}${4}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet new "New class instance" b
|
||||
$$1 = new $1($2);
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ife "if else"
|
||||
if (${1:/* condition */}) {
|
||||
${2:// code...}
|
||||
} else {
|
||||
${3:// code...}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet class "Class declaration template" b
|
||||
/**
|
||||
* Class ${1:`!p snip.rv=snip.fn.split('.')[0]`}
|
||||
* @author ${2:`!v g:snips_author`}
|
||||
*/
|
||||
class $1
|
||||
{
|
||||
public function ${3:__construct}(${4:$options})
|
||||
{
|
||||
${4:// code}
|
||||
}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet construct "__construct()" b
|
||||
/**
|
||||
* @param $2mixed ${1/, /\n * \@param mixed /g}
|
||||
*/
|
||||
public function __construct(${1:$dependencies})
|
||||
{${1/\$(\w+)(, )*/\n $this->$1 = $$1;/g}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet pr "Dumb debug helper in HTML"
|
||||
echo '<pre>' . var_export($1, 1) . '</pre>';$0
|
||||
endsnippet
|
||||
|
||||
snippet pc "Dumb debug helper in cli"
|
||||
var_export($1);$0
|
||||
endsnippet
|
||||
|
||||
# Symfony 2 based snippets
|
||||
snippet sfa "Symfony 2 Controller action"
|
||||
/**
|
||||
* @Route("/${1:route_name}", name="$1")
|
||||
* @Template()
|
||||
*/
|
||||
public function $1Action($2)
|
||||
{
|
||||
$3
|
||||
return ${4:array();}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# :vim:ft=snippets:
|
32
bundle/vim-snippets/UltiSnips/php_phpunit.snippets
Normal file
32
bundle/vim-snippets/UltiSnips/php_phpunit.snippets
Normal file
@ -0,0 +1,32 @@
|
||||
# suggestion? report bugs?
|
||||
# please go to https://github.com/chrisyue/vim-snippets/issues
|
||||
priority -50
|
||||
|
||||
snippet test "phpunit test class" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
/**
|
||||
* @author `whoami`
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function test${1}()
|
||||
{
|
||||
${2}
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet exp "phpunit expects" i
|
||||
expects($this->${1:once}())
|
||||
->method('${2}')
|
||||
->with($this->equalTo(${3})${4})
|
||||
->will($this->returnValue(${5}));
|
||||
endsnippet
|
261
bundle/vim-snippets/UltiSnips/php_symfony2.snippets
Normal file
261
bundle/vim-snippets/UltiSnips/php_symfony2.snippets
Normal file
@ -0,0 +1,261 @@
|
||||
# sugguestion? report bugs?
|
||||
# go to https://github.com/chrisyue/vim-snippets/issues
|
||||
|
||||
priority -50
|
||||
|
||||
snippet contr "Symfony2 controller" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* ${1:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` extends Controller
|
||||
{
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet act "Symfony2 action" b
|
||||
/**
|
||||
* @Route("${3}", name="${4}")
|
||||
* @Method({${5:"POST"}})
|
||||
* @Template()
|
||||
*/
|
||||
public function ${1}Action(${2})
|
||||
{
|
||||
${6}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet actt "Symfony2 action and template" b
|
||||
/**
|
||||
* @Route("${3}", name="${4}")
|
||||
* @Method({${5:"GET"}})
|
||||
* @Template()
|
||||
*/
|
||||
public function ${1}Action(${2})
|
||||
{
|
||||
${6}
|
||||
return [];
|
||||
}`!p
|
||||
abspath = os.path.abspath(path)`
|
||||
endsnippet
|
||||
|
||||
snippet comm "Symfony2 command" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
* ${3:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` extends ContainerAwareCommand
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('${1}')
|
||||
->setDescription('${2}')
|
||||
->setDefinition([
|
||||
new InputArgument('', InputArgument::REQUIRED, ''),
|
||||
new InputOption('', null, InputOption::VALUE_NONE, ''),
|
||||
]);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet subs "Symfony2 subscriber" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
|
||||
/**
|
||||
* ${1:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` implements EventSubscriberInterface
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet transf "Symfony2 form data transformer" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Symfony\Component\Form\DataTransformerInterface;
|
||||
use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||
|
||||
/**
|
||||
* ${3:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` implements DataTransformerInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function transform(${1})
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function reverseTransform(${2})
|
||||
{
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ent "Symfony2 doctrine entity" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* ${3:@author `whoami`}
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="`!p
|
||||
tmp = re.match(r'.*(?=\.)', fn).group()
|
||||
tmp = re.sub(r'\B([A-Z])', r'_\1', tmp)
|
||||
snip.rv = tmp.lower()
|
||||
`")
|
||||
*/
|
||||
`!p
|
||||
m = re.search(r'Abstract', path)
|
||||
if m:
|
||||
snip.rv = 'abstract '
|
||||
`class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
`
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Id
|
||||
*/
|
||||
private $id;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet form "Symfony2 form type" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
|
||||
/**
|
||||
* ${2:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setDefaults();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return '${1}';
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ev "Symfony2 event" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* ${2:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` extends Event
|
||||
{
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet redir "Symfony2 redirect"
|
||||
$this->redirect($this->generateUrl('${1}', ${2}));
|
||||
endsnippet
|
235
bundle/vim-snippets/UltiSnips/puppet.snippets
Normal file
235
bundle/vim-snippets/UltiSnips/puppet.snippets
Normal file
@ -0,0 +1,235 @@
|
||||
priority -50
|
||||
|
||||
#########################################################################
|
||||
# Python helper code #
|
||||
#########################################################################
|
||||
|
||||
global !p
|
||||
import vim
|
||||
import os.path
|
||||
def get_module_namespace_and_basename():
|
||||
"""This function will try to guess the current class or define name you are
|
||||
trying to create. Note that for this to work you should be using the module
|
||||
structure as per the style guide. Examples inputs and it's output
|
||||
* /home/nikolavp/puppet/modules/collectd/manifests/init.pp -> collectd
|
||||
* /home/nikolavp/puppet/modules/collectd/manfistes/mysql.pp -> collectd::mysql
|
||||
"""
|
||||
first_time = True
|
||||
current_file_path_without_ext = vim.eval('expand("%:p:r")') or ""
|
||||
if not current_file_path_without_ext:
|
||||
return "name"
|
||||
parts = os.path.split(current_file_path_without_ext)
|
||||
namespace = ''
|
||||
while parts[0] and parts[0] != '/':
|
||||
if parts[1] == 'init' and first_time and not namespace:
|
||||
first_time = False
|
||||
parts = os.path.split(parts[0])
|
||||
continue
|
||||
if parts[1] == 'manifests':
|
||||
return os.path.split(parts[0])[1] + ('::' + namespace).rstrip(':')
|
||||
else:
|
||||
namespace = parts[1] + '::' + namespace
|
||||
parts = os.path.split(parts[0])
|
||||
# couldn't guess the namespace. The user is editing a raw file in no module like the site.pp file
|
||||
return "name"
|
||||
endglobal
|
||||
|
||||
###############################################################################
|
||||
# Puppet Language Constructs #
|
||||
# See http://docs.puppetlabs.com/puppet/latest/reference/lang_summary.html #
|
||||
###############################################################################
|
||||
|
||||
snippet class "Class declaration" b
|
||||
class ${1:`!p snip.rv = get_module_namespace_and_basename()`} {
|
||||
${0:# body}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet define "Definition" b
|
||||
define ${1:`!p snip.rv = get_module_namespace_and_basename()`} {
|
||||
${0:# body}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
#################################################################
|
||||
# Puppet Types #
|
||||
# See http://docs.puppetlabs.com/references/latest/type.html #
|
||||
#################################################################
|
||||
|
||||
snippet cron "Cron resource type" b
|
||||
cron { '${1:name}':
|
||||
user => ${2:user},
|
||||
command => '${3:command}',
|
||||
minute => ${3:minute},
|
||||
hour => ${4:hour},
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet exec "Exec resource type" b
|
||||
exec { '${1:command}':
|
||||
refreshonly => true,
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet file "File resource type" b
|
||||
file { '${1:name}':
|
||||
source => "puppet://${2:path}",
|
||||
mode => ${3:mode},
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet File "Defaults for file" b
|
||||
File {
|
||||
owner => ${1:username},
|
||||
group => ${2:groupname},
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet group "Group resource type" b
|
||||
group { '${1:groupname}':
|
||||
ensure => ${3:present},
|
||||
gid => ${2:gid},
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet mount "Mount resource type" b
|
||||
mount { '${1:path}':
|
||||
device => '${2:/dev}',
|
||||
fstype => '${3:filesystem}',
|
||||
ensure => mounted,
|
||||
options => 'rw,errors=remount-ro',
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet package "Package resource type" b
|
||||
package { '${1:name}':
|
||||
ensure => ${2:installed},
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet user "user resource type" b
|
||||
user { '${1:username}':
|
||||
ensure => ${2:present},
|
||||
uid => ${3:uid},
|
||||
gid => ${4:gid},
|
||||
comment => ${5:gecos},
|
||||
home => ${6:homedirectory},
|
||||
managehome => false,
|
||||
require => Group['${7:group'}],
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet service "Service resource type" b
|
||||
service { '${1:name}':
|
||||
hasstatus => true,
|
||||
enable => true,
|
||||
ensure => running,
|
||||
}
|
||||
endsnippet
|
||||
|
||||
########################################################################
|
||||
# Puppet Functions #
|
||||
# See http://docs.puppetlabs.com/references/latest/function.html #
|
||||
########################################################################
|
||||
|
||||
snippet alert "Alert Function" b
|
||||
alert("${1:message}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet crit "Crit Function" b
|
||||
crit("${1:message}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet debug "Debug Function" b
|
||||
debug("${1:message}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet defined "Defined Function" b
|
||||
defined(${1:Resource}["${2:name}"])${0}
|
||||
endsnippet
|
||||
|
||||
snippet emerg "Emerg Function" b
|
||||
emerg("${1:message}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet extlookup "Simple Extlookup" b
|
||||
$${1:Variable} = extlookup("${2:Lookup}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet extlookup "Extlookup with defaults" b
|
||||
$${1:Variable} = extlookup("${2:Lookup}", ${3:Default})${0}
|
||||
endsnippet
|
||||
|
||||
snippet extlookup "Extlookup with defaults and custom data file" b
|
||||
$${1:Variable} = extlookup("${2:Lookup}", ${3:Default}, ${4:Data Source})${0}
|
||||
endsnippet
|
||||
|
||||
snippet fail "Fail Function" b
|
||||
fail("${1:message}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet hiera "Hiera Function" b
|
||||
$${1:Variable} = hiera("${2:Lookup}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet hiera "Hiera with defaults" b
|
||||
$${1:Variable} = hiera("${2:Lookup}", ${3:Default})${0}
|
||||
endsnippet
|
||||
|
||||
snippet hiera "Hiera with defaults and override" b
|
||||
$${1:Variable} = hiera("${2:Lookup}", ${3:Default}, ${4:Override})${0}
|
||||
endsnippet
|
||||
|
||||
snippet hiera_hash "Hiera Hash Function" b
|
||||
$${1:Variable} = hiera_hash("${2:Lookup}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet hiera_hash "Hiera Hash with defaults" b
|
||||
$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default})${0}
|
||||
endsnippet
|
||||
|
||||
snippet hiera_hash "Hiera Hash with defaults and override" b
|
||||
$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default}, ${4:Override})${0}
|
||||
endsnippet
|
||||
|
||||
snippet hiera_include "Hiera Include Function" b
|
||||
hiera_include("${1:Lookup}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet include "Include Function" b
|
||||
include ${1:classname}${0}
|
||||
endsnippet
|
||||
|
||||
snippet info "Info Function" b
|
||||
info("${1:message}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet inline_template "Inline Template Function" b
|
||||
inline_template("<%= ${1:template} %>")${0}
|
||||
endsnippet
|
||||
|
||||
snippet notice "Notice Function" b
|
||||
notice("${1:message}")${0}
|
||||
endsnippet
|
||||
|
||||
snippet realize "Realize Function" b
|
||||
realize(${1:Resource}["${2:name}"])${0}
|
||||
endsnippet
|
||||
|
||||
snippet regsubst "Regsubst Function" b
|
||||
regsubst($${1:Target}, '${2:regexp}', '${3:replacement}')${0}
|
||||
endsnippet
|
||||
|
||||
snippet split "Split Function" b
|
||||
$${1:Variable} = split($${1:Target}, '${2:regexp}')${0}
|
||||
endsnippet
|
||||
|
||||
snippet versioncmp "Version Compare Function" b
|
||||
$${1:Variable} = versioncmp('${1:version}', '${2:version}')${0}
|
||||
endsnippet
|
||||
|
||||
snippet warning "Warning Function" b
|
||||
warning("${1:message}")${0}
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
533
bundle/vim-snippets/UltiSnips/python.snippets
Normal file
533
bundle/vim-snippets/UltiSnips/python.snippets
Normal file
@ -0,0 +1,533 @@
|
||||
priority -50
|
||||
|
||||
###########################################################################
|
||||
# TEXTMATE SNIPPETS #
|
||||
###########################################################################
|
||||
|
||||
#! header
|
||||
snippet #! "Shebang header for python scripts" b
|
||||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ifmain "ifmain" b
|
||||
if __name__ == '__main__':
|
||||
${1:main()}$0
|
||||
endsnippet
|
||||
|
||||
snippet for "for loop" b
|
||||
for ${1:item} in ${2:iterable}:
|
||||
${3:pass}
|
||||
endsnippet
|
||||
|
||||
##########
|
||||
# COMMON #
|
||||
##########
|
||||
|
||||
# The smart def and smart class snippets use a global option called
|
||||
# "g:ultisnips_python_style" which, if set to "doxygen" will use doxygen
|
||||
# style comments in docstrings.
|
||||
|
||||
global !p
|
||||
|
||||
NORMAL = 0x1
|
||||
DOXYGEN = 0x2
|
||||
SPHINX = 0x3
|
||||
|
||||
SINGLE_QUOTES = 0x1
|
||||
DOUBLE_QUOTES = 0x2
|
||||
|
||||
def get_args(arglist):
|
||||
args = [arg.split('=')[0].strip() for arg in arglist.split(',') if arg]
|
||||
args = [arg for arg in args if arg and arg != "self"]
|
||||
|
||||
return args
|
||||
|
||||
|
||||
def get_quoting_style(snip):
|
||||
style = snip.opt("g:ultisnips_python_quoting_style", "double")
|
||||
if style == 'single':
|
||||
return SINGLE_QUOTES
|
||||
return DOUBLE_QUOTES
|
||||
|
||||
def tripple_quotes(snip):
|
||||
if get_quoting_style(snip) == SINGLE_QUOTES:
|
||||
return "'''"
|
||||
return '"""'
|
||||
|
||||
def get_style(snip):
|
||||
style = snip.opt("g:ultisnips_python_style", "normal")
|
||||
|
||||
if style == "doxygen": return DOXYGEN
|
||||
elif style == "sphinx": return SPHINX
|
||||
else: return NORMAL
|
||||
|
||||
|
||||
def format_arg(arg, style):
|
||||
if style == DOXYGEN:
|
||||
return "@param %s @todo" % arg
|
||||
elif style == SPHINX:
|
||||
return ":param %s: @todo" % arg
|
||||
elif style == NORMAL:
|
||||
return ":%s: @todo" % arg
|
||||
|
||||
|
||||
def format_return(style):
|
||||
if style == DOXYGEN:
|
||||
return "@return: @todo"
|
||||
elif style in (NORMAL, SPHINX):
|
||||
return ":returns: @todo"
|
||||
|
||||
|
||||
def write_docstring_args(args, snip):
|
||||
if not args:
|
||||
snip.rv += ' {0}'.format(tripple_quotes(snip))
|
||||
return
|
||||
|
||||
snip.rv += '\n' + snip.mkline('', indent='')
|
||||
|
||||
style = get_style(snip)
|
||||
|
||||
for arg in args:
|
||||
snip += format_arg(arg, style)
|
||||
|
||||
|
||||
def write_init_body(args, parents, snip):
|
||||
parents = [p.strip() for p in parents.split(",")]
|
||||
parents = [p for p in parents if p != 'object']
|
||||
|
||||
for p in parents:
|
||||
snip += p + ".__init__(self)"
|
||||
|
||||
if parents:
|
||||
snip.rv += '\n' + snip.mkline('', indent='')
|
||||
|
||||
for arg in args:
|
||||
snip += "self._%s = %s" % (arg, arg)
|
||||
|
||||
|
||||
def write_slots_args(args, snip):
|
||||
args = ['"_%s"' % arg for arg in args]
|
||||
snip += '__slots__ = (%s,)' % ', '.join(args)
|
||||
|
||||
endglobal
|
||||
|
||||
########################################
|
||||
# Class & Special Method Name Snippets #
|
||||
########################################
|
||||
|
||||
snippet class "class with docstrings" b
|
||||
class ${1:MyClass}(${2:object}):
|
||||
|
||||
`!p snip.rv = tripple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = tripple_quotes(snip)`
|
||||
|
||||
def __init__(self$4):
|
||||
`!p snip.rv = tripple_quotes(snip)`${5:@todo: to be defined1.}`!p
|
||||
snip.rv = ""
|
||||
snip >> 2
|
||||
|
||||
args = get_args(t[4])
|
||||
|
||||
write_docstring_args(args, snip)
|
||||
if args:
|
||||
snip.rv += '\n' + snip.mkline('', indent='')
|
||||
snip += '{0}'.format(tripple_quotes(snip))
|
||||
|
||||
write_init_body(args, t[2], snip)
|
||||
`
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet slotclass "class with slots and docstrings" b
|
||||
class ${1:MyClass}(${2:object}):
|
||||
|
||||
`!p snip.rv = tripple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = tripple_quotes(snip)`
|
||||
`!p
|
||||
snip >> 1
|
||||
args = get_args(t[4])
|
||||
write_slots_args(args, snip)
|
||||
`
|
||||
|
||||
def __init__(self$4):
|
||||
`!p snip.rv = tripple_quotes(snip)`${5:@todo: to be defined.}`!p
|
||||
snip.rv = ""
|
||||
snip >> 2
|
||||
|
||||
args = get_args(t[4])
|
||||
|
||||
write_docstring_args(args, snip)
|
||||
if args:
|
||||
snip.rv += '\n' + snip.mkline('', indent='')
|
||||
snip += tripple_quotes(snip)
|
||||
|
||||
write_init_body(args, t[2], snip)
|
||||
`
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet contain "methods for emulating a container type" b
|
||||
def __len__(self):
|
||||
${1:pass}
|
||||
|
||||
def __getitem__(self, key):
|
||||
${2:pass}
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
${3:pass}
|
||||
|
||||
def __delitem__(self, key):
|
||||
${4:pass}
|
||||
|
||||
def __iter__(self):
|
||||
${5:pass}
|
||||
|
||||
def __reversed__(self):
|
||||
${6:pass}
|
||||
|
||||
def __contains__(self, item):
|
||||
${7:pass}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet context "context manager methods" b
|
||||
def __enter__(self):
|
||||
${1:pass}
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
${2:pass}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet attr "methods for customizing attribute access" b
|
||||
def __getattr__(self, name):
|
||||
${1:pass}
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
${2:pass}
|
||||
|
||||
def __delattr__(self, name):
|
||||
${3:pass}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet desc "methods implementing descriptors" b
|
||||
def __get__(self, instance, owner):
|
||||
${1:pass}
|
||||
|
||||
def __set__(self, instance, value):
|
||||
${2:pass}
|
||||
|
||||
def __delete__(self, instance):
|
||||
${3:pass}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet cmp "methods implementing rich comparison"
|
||||
def __eq__(self, other):
|
||||
${1:pass}
|
||||
|
||||
def __ne__(self, other):
|
||||
${2:pass}
|
||||
|
||||
def __lt__(self, other):
|
||||
${3:pass}
|
||||
|
||||
def __le__(self, other):
|
||||
${4:pass}
|
||||
|
||||
def __gt__(self, other):
|
||||
${5:pass}
|
||||
|
||||
def __ge__(self, other):
|
||||
${6:pass}
|
||||
|
||||
def __cmp__(self, other):
|
||||
${7:pass}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet repr "methods implementing string representation"
|
||||
def __repr__(self):
|
||||
${1:pass}
|
||||
|
||||
def __str__(self):
|
||||
${2:pass}
|
||||
|
||||
def __unicode__(self):
|
||||
${3:pass}
|
||||
endsnippet
|
||||
|
||||
|
||||
# note: reflected operands and augmented arithmeitc assignements have been
|
||||
# intentionally ommited to reduce verbosity.
|
||||
snippet numeric "methods for emulating a numeric type" b
|
||||
def __add__(self, other):
|
||||
${1:pass}
|
||||
|
||||
def __sub__(self, other):
|
||||
${2:pass}
|
||||
|
||||
def __mul__(self, other):
|
||||
${3:pass}
|
||||
|
||||
def __div__(self, other):
|
||||
${4:pass}
|
||||
|
||||
def __truediv__(self, other):
|
||||
${5:pass}
|
||||
|
||||
def __floordiv__(self, other):
|
||||
${6:pass}
|
||||
|
||||
|
||||
def __mod__(self, other):
|
||||
${7:pass}
|
||||
|
||||
def __divmod__(self, other):
|
||||
${8:pass}
|
||||
|
||||
def __pow__(self, other):
|
||||
${9:pass}
|
||||
|
||||
|
||||
def __lshift__(self, other):
|
||||
${10:pass}
|
||||
|
||||
def __rshift__(self, other):
|
||||
${11:pass}
|
||||
|
||||
def __and__(self, other):
|
||||
${12:pass}
|
||||
|
||||
def __xor__(self, other):
|
||||
${13:pass}
|
||||
|
||||
def __or__(self, other):
|
||||
${14:pass}
|
||||
|
||||
|
||||
def __neg__(self):
|
||||
${15:pass}
|
||||
|
||||
def __pos__(self):
|
||||
${16:pass}
|
||||
|
||||
def __abs__(self):
|
||||
${17:pass}
|
||||
|
||||
def __invert__(self):
|
||||
${18:pass}
|
||||
|
||||
|
||||
def __complex__(self):
|
||||
${19:pass}
|
||||
|
||||
def __int__(self):
|
||||
${20:pass}
|
||||
|
||||
def __long__(self):
|
||||
${21:pass}
|
||||
|
||||
def __float__(self):
|
||||
${22:pass}
|
||||
|
||||
|
||||
def __oct__(self):
|
||||
${22:pass}
|
||||
|
||||
def __hex__(self):
|
||||
${23:pass}
|
||||
|
||||
|
||||
def __index__(self):
|
||||
${24:pass}
|
||||
|
||||
def __coerce__(self, other):
|
||||
${25:pass}
|
||||
endsnippet
|
||||
|
||||
snippet def "function with docstrings" b
|
||||
def ${1:function}(`!p
|
||||
if snip.indent:
|
||||
snip.rv = 'self' + (", " if len(t[2]) else "")`${2:arg1}):
|
||||
`!p snip.rv = tripple_quotes(snip)`${4:@todo: Docstring for $1.}`!p
|
||||
snip.rv = ""
|
||||
snip >> 1
|
||||
|
||||
args = get_args(t[2])
|
||||
if args:
|
||||
write_docstring_args(args, snip)
|
||||
|
||||
style = get_style(snip)
|
||||
snip += format_return(style)
|
||||
snip.rv += '\n' + snip.mkline('', indent='')
|
||||
snip += tripple_quotes(snip) `
|
||||
${0:pass}
|
||||
endsnippet
|
||||
|
||||
|
||||
# doesn't expand when there is a word in front
|
||||
snippet /(^|(?<=\W))\./ "self." r
|
||||
self.
|
||||
endsnippet
|
||||
|
||||
snippet from "from module import name" b
|
||||
from ${1:module} import ${2:Stuff}
|
||||
endsnippet
|
||||
|
||||
|
||||
##############
|
||||
# PROPERTIES #
|
||||
##############
|
||||
snippet roprop "Read Only Property" b
|
||||
@property
|
||||
def ${1:name}(self):
|
||||
${2:return self._$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet rwprop "Read write property" b
|
||||
def ${1:name}():
|
||||
`!p snip.rv = tripple_quotes(snip) if t[2] else ''
|
||||
`${2:@todo: Docstring for $1.}`!p
|
||||
if t[2]:
|
||||
snip >> 1
|
||||
|
||||
style = get_style(snip)
|
||||
snip.rv += '\n' + snip.mkline('', indent='')
|
||||
snip += format_return(style)
|
||||
snip.rv += '\n' + snip.mkline('', indent='')
|
||||
snip += tripple_quotes(snip)
|
||||
else:
|
||||
snip.rv = ""`
|
||||
def fget(self):
|
||||
return self._$1$0
|
||||
|
||||
def fset(self, value):
|
||||
self._$1 = value
|
||||
return locals()
|
||||
|
||||
$1 = property(**$1(), doc=$1.__doc__)
|
||||
endsnippet
|
||||
|
||||
|
||||
####################
|
||||
# If / Else / Elif #
|
||||
####################
|
||||
snippet if "If" b
|
||||
if ${1:condition}:
|
||||
${2:pass}
|
||||
endsnippet
|
||||
|
||||
snippet ife "If / Else" b
|
||||
if ${1:condition}:
|
||||
${2:pass}
|
||||
else:
|
||||
${3:pass}
|
||||
endsnippet
|
||||
|
||||
snippet ifee "If / Elif / Else" b
|
||||
if ${1:condition}:
|
||||
${2:pass}
|
||||
elif ${3:condition}:
|
||||
${4:pass}
|
||||
else:
|
||||
${5:pass}
|
||||
endsnippet
|
||||
|
||||
|
||||
##########################
|
||||
# Try / Except / Finally #
|
||||
##########################
|
||||
snippet try "Try / Except" b
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
endsnippet
|
||||
|
||||
snippet try "Try / Except / Else" b
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
else:
|
||||
${5:pass}
|
||||
endsnippet
|
||||
|
||||
snippet try "Try / Except / Finally" b
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
finally:
|
||||
${5:pass}
|
||||
endsnippet
|
||||
|
||||
snippet try "Try / Except / Else / Finally" b
|
||||
try:
|
||||
${1:pass}
|
||||
except${2: ${3:Exception}, ${4:e}}:
|
||||
${5:raise}
|
||||
else:
|
||||
${6:pass}
|
||||
finally:
|
||||
${7:pass}
|
||||
endsnippet
|
||||
|
||||
|
||||
#####################
|
||||
# Assertions & Tests #
|
||||
#####################
|
||||
|
||||
snippet pdb "Set PDB breakpoint" b
|
||||
import pdb; pdb.set_trace()
|
||||
endsnippet
|
||||
|
||||
snippet ipdb "Set IPDB breakpoint" b
|
||||
import ipdb; ipdb.set_trace()
|
||||
endsnippet
|
||||
|
||||
snippet pudb "Set PUDB breakpoint" b
|
||||
import pudb; pudb.set_trace()
|
||||
endsnippet
|
||||
|
||||
snippet ae "Assert equal" b
|
||||
self.assertEqual(${1:first},${2:second})
|
||||
endsnippet
|
||||
|
||||
snippet at "Assert True" b
|
||||
self.assertTrue(${0:exp})
|
||||
endsnippet
|
||||
|
||||
snippet af "Assert False" b
|
||||
self.assertFalse(${1:expression})
|
||||
endsnippet
|
||||
|
||||
snippet aae "Assert almost equal" b
|
||||
self.assertAlmostEqual(${1:first},${2:second})
|
||||
endsnippet
|
||||
|
||||
snippet ar "Assert raises" b
|
||||
self.assertRaises(${1:exception}, ${2:func}${3/.+/, /}${3:arguments})
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet testcase "pyunit testcase" b
|
||||
class Test${1:Class}(${2:unittest.TestCase}):
|
||||
|
||||
`!p snip.rv = tripple_quotes(snip)`${3:Test case docstring.}`!p snip.rv = tripple_quotes(snip)`
|
||||
|
||||
def setUp(self):
|
||||
${4:pass}
|
||||
|
||||
def tearDown(self):
|
||||
${5:pass}
|
||||
|
||||
def test_${6:name}(self):
|
||||
${7:pass}
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
904
bundle/vim-snippets/UltiSnips/rails.snippets
Normal file
904
bundle/vim-snippets/UltiSnips/rails.snippets
Normal file
@ -0,0 +1,904 @@
|
||||
priority -50
|
||||
|
||||
snippet anaf "accepts_nested_attributes_for"
|
||||
accepts_nested_attributes_for :${1:association_name}${2:${3:, :allow_destroy => true}${4:, :reject_if => proc \{ |obj| ${5:obj.blank?} \}}}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet tcbi "Create binary column"
|
||||
t.binary :${1:title}${2:, :limit => ${3:2}.megabytes}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet tcb "Create boolean column"
|
||||
t.boolean :${1:title}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet cla "Create controller class"
|
||||
class ${1:Model}Controller < ApplicationController
|
||||
before_filter :find_${2:model}
|
||||
|
||||
$0
|
||||
|
||||
private
|
||||
def find_${2}
|
||||
@$2 = ${3:$1}.find(params[:id]) if params[:id]
|
||||
end
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet tcda "Create date column"
|
||||
t.date :${1:title}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet tcdt "Create datetime column"
|
||||
t.datetime :${1:title}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet tcd "Create decimal column"
|
||||
t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet tcf "Create float column"
|
||||
t.float :${1:title}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet cla "Create functional test class"
|
||||
require 'test_helper'
|
||||
|
||||
class ${1:Model}ControllerTest < ActionController::TestCase
|
||||
test$0
|
||||
end
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet tci "Create integer column"
|
||||
t.integer :${1:title}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet tcl "Create lock_version column"
|
||||
t.integer :lock_version, :null => false, :default => 0
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
# FIXME: handling literal bracket pair inside of nested tab groups?
|
||||
snippet tcr "Create references column"
|
||||
t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet resources "Create resources controller class"
|
||||
class ${1:Model}sController < ApplicationController
|
||||
before_filter :find_${1/./\l$0/}, :only => [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /${1/./\l$0/}s
|
||||
# GET /${1/./\l$0/}s.xml
|
||||
def index
|
||||
@${1/./\l$0/}s = ${1:Model}.all
|
||||
|
||||
respond_to do |wants|
|
||||
wants.html # index.html.erb
|
||||
wants.xml { render :xml => @${1/./\l$0/}s }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /${1/./\l$0/}s/1
|
||||
# GET /${1/./\l$0/}s/1.xml
|
||||
def show
|
||||
respond_to do |wants|
|
||||
wants.html # show.html.erb
|
||||
wants.xml { render :xml => @${1/./\l$0/} }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /${1/./\l$0/}s/new
|
||||
# GET /${1/./\l$0/}s/new.xml
|
||||
def new
|
||||
@${1/./\l$0/} = ${1:Model}.new
|
||||
|
||||
respond_to do |wants|
|
||||
wants.html # new.html.erb
|
||||
wants.xml { render :xml => @${1/./\l$0/} }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /${1/./\l$0/}s/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /${1/./\l$0/}s
|
||||
# POST /${1/./\l$0/}s.xml
|
||||
def create
|
||||
@${1/./\l$0/} = ${1:Model}.new(params[:${1/./\l$0/}])
|
||||
|
||||
respond_to do |wants|
|
||||
if @${1/./\l$0/}.save
|
||||
flash[:notice] = '${1:Model} was successfully created.'
|
||||
wants.html { redirect_to(@${1/./\l$0/}) }
|
||||
wants.xml { render :xml => @${1/./\l$0/}, :status => :created, :location => @${1/./\l$0/} }
|
||||
else
|
||||
wants.html { render :action => "new" }
|
||||
wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /${1/./\l$0/}s/1
|
||||
# PUT /${1/./\l$0/}s/1.xml
|
||||
def update
|
||||
respond_to do |wants|
|
||||
if @${1/./\l$0/}.update_attributes(params[:${1/./\l$0/}])
|
||||
flash[:notice] = '${1:Model} was successfully updated.'
|
||||
wants.html { redirect_to(@${1/./\l$0/}) }
|
||||
wants.xml { head :ok }
|
||||
else
|
||||
wants.html { render :action => "edit" }
|
||||
wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /${1/./\l$0/}s/1
|
||||
# DELETE /${1/./\l$0/}s/1.xml
|
||||
def destroy
|
||||
@${1/./\l$0/}.destroy
|
||||
|
||||
respond_to do |wants|
|
||||
wants.html { redirect_to(${1/./\l$0/}s_url) }
|
||||
wants.xml { head :ok }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def find_${1/./\l$0/}
|
||||
@${1/./\l$0/} = ${1:Model}.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet tcs "Create string column"
|
||||
t.string :${1:title}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet tct "Create text column"
|
||||
t.text :${1:title}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet tcti "Create time column"
|
||||
t.time :${1:title}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet tcts "Create timestamp column"
|
||||
t.timestamp :${1:title}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet tctss "Create timestamps columns"
|
||||
t.timestamps
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet mcol "Migration Create Column (mcc)"
|
||||
t.column ${1:title}, :${2:string}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet mccc "Migration Create Column Continue (mccc)"
|
||||
t.column ${1:title}, :${2:string}
|
||||
mccc$0
|
||||
endsnippet
|
||||
|
||||
snippet mtab "Migration Drop Create Table (mdct)"
|
||||
drop_table :${1:table}${2: [press tab twice to generate create_table]}
|
||||
endsnippet
|
||||
|
||||
snippet mcol "Migration Remove and Add Column (mrac)"
|
||||
remove_column :${1:table}, :${2:column}${3: [press tab twice to generate add_column]}
|
||||
endsnippet
|
||||
|
||||
snippet rdb "RAILS_DEFAULT_LOGGER.debug (rdb)"
|
||||
RAILS_DEFAULT_LOGGER.debug "${1:message}"$0
|
||||
endsnippet
|
||||
|
||||
snippet tre "Table column(s) rename"
|
||||
t.rename(:${1:old_column_name}, :${2:new_column_name})
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet art "Test Assert Redirected To (art)"
|
||||
assert_redirected_to ${2::action => "${1:index}"}
|
||||
endsnippet
|
||||
|
||||
snippet asre "Test Assert Response (are)"
|
||||
assert_response :${1:success}, @response.body$0
|
||||
endsnippet
|
||||
|
||||
snippet aftc "after_create"
|
||||
after_create $0
|
||||
endsnippet
|
||||
|
||||
snippet aftd "after_destroy"
|
||||
after_destroy $0
|
||||
endsnippet
|
||||
|
||||
snippet afts "after_save"
|
||||
after_save $0
|
||||
endsnippet
|
||||
|
||||
snippet aftu "after_update"
|
||||
after_update $0
|
||||
endsnippet
|
||||
|
||||
snippet aftv "after_validation"
|
||||
after_validation $0
|
||||
endsnippet
|
||||
|
||||
snippet aftvoc "after_validation_on_create"
|
||||
after_validation_on_create $0
|
||||
endsnippet
|
||||
|
||||
snippet aftvou "after_validation_on_update"
|
||||
after_validation_on_update $0
|
||||
endsnippet
|
||||
|
||||
snippet asg "assert(var = assigns(:var))"
|
||||
assert(${1:var} = assigns(:${1}), "Cannot find @${1}")
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet asd "assert_difference"
|
||||
assert_difference "${1:Model}.${2:count}", ${3:1} do
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet asnd "assert_no_difference"
|
||||
assert_no_difference "${1:Model}.${2:count}" do
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet artnpp "assert_redirected_to (nested path plural)"
|
||||
assert_redirected_to ${10:${2:parent}_${3:child}_path(${4:@}${5:${2}})}
|
||||
endsnippet
|
||||
|
||||
snippet artnp "assert_redirected_to (nested path)"
|
||||
assert_redirected_to ${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}
|
||||
endsnippet
|
||||
|
||||
snippet artpp "assert_redirected_to (path plural)"
|
||||
assert_redirected_to ${10:${2:model}s_path}
|
||||
endsnippet
|
||||
|
||||
snippet artp "assert_redirected_to (path)"
|
||||
assert_redirected_to ${2:${12:model}_path(${13:@}${14:${12}})}
|
||||
endsnippet
|
||||
|
||||
snippet asrj "assert_rjs"
|
||||
assert_rjs :${1:replace}, ${2:"${3:dom id}"}
|
||||
endsnippet
|
||||
|
||||
snippet ass "assert_select"
|
||||
assert_select '${1:path}'${2:, :${3:text} => ${4:'${5:inner_html}'}}${6: do
|
||||
$0
|
||||
end}
|
||||
endsnippet
|
||||
|
||||
snippet befc "before_create"
|
||||
before_create $0
|
||||
endsnippet
|
||||
|
||||
snippet befd "before_destroy"
|
||||
before_destroy $0
|
||||
endsnippet
|
||||
|
||||
snippet befs "before_save"
|
||||
before_save $0
|
||||
endsnippet
|
||||
|
||||
snippet befu "before_update"
|
||||
before_update $0
|
||||
endsnippet
|
||||
|
||||
snippet befv "before_validation"
|
||||
before_validation $0
|
||||
endsnippet
|
||||
|
||||
snippet befvoc "before_validation_on_create"
|
||||
before_validation_on_create $0
|
||||
endsnippet
|
||||
|
||||
snippet befvou "before_validation_on_update"
|
||||
before_validation_on_update
|
||||
endsnippet
|
||||
|
||||
snippet bt "belongs_to (bt)"
|
||||
belongs_to :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"}
|
||||
endsnippet
|
||||
|
||||
snippet crw "cattr_accessor"
|
||||
cattr_accessor :${0:attr_names}
|
||||
endsnippet
|
||||
|
||||
snippet defcreate "def create - resource"
|
||||
def create
|
||||
@${1:model} = ${2:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}.new(params[:$1])
|
||||
$0
|
||||
respond_to do |wants|
|
||||
if @$1.save
|
||||
flash[:notice] = '$2 was successfully created.'
|
||||
wants.html { redirect_to(@$1) }
|
||||
wants.xml { render :xml => @$1, :status => :created, :location => @$1 }
|
||||
else
|
||||
wants.html { render :action => "new" }
|
||||
wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet test "test do..end"
|
||||
test "${1:something interesting}" do
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet deftg "def get request"
|
||||
def test_should_get_${1:action}
|
||||
${2:@${3:model} = ${4:$3s}(:${5:fixture_name})
|
||||
}get :${1}${6:, :id => @$3.to_param}
|
||||
assert_response :success
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet deftp "def post request"
|
||||
def test_should_post_${1:action}
|
||||
${3:@$2 = ${4:$2s}(:${5:fixture_name})
|
||||
}post :${1}${6:, :id => @$2.to_param}, :${2:model} => { $0 }
|
||||
assert_response :redirect
|
||||
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet fina "find(:all)"
|
||||
find(:all${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
|
||||
endsnippet
|
||||
|
||||
snippet finf "find(:first)"
|
||||
find(:first${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
|
||||
endsnippet
|
||||
|
||||
snippet fini "find(id)"
|
||||
find(${1:id})
|
||||
endsnippet
|
||||
|
||||
snippet fine "find_each"
|
||||
find_each(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}|
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet finb "find_in_batches"
|
||||
find_in_batches(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}s|
|
||||
$4s.each do |$4|
|
||||
$0
|
||||
end
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet habtm "has_and_belongs_to_many (habtm)"
|
||||
has_and_belongs_to_many :${1:object}${2:, :join_table => "${3:table_name}", :foreign_key => "${4:${1}_id}"}
|
||||
endsnippet
|
||||
|
||||
snippet hm "has_many (hm)"
|
||||
has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}
|
||||
endsnippet
|
||||
|
||||
snippet hmt "has_many (through)"
|
||||
has_many :${1:objects}, :through => :${2:join_association}${3:, :source => :${4:${2}_table_foreign_key_to_${1}_table}}
|
||||
endsnippet
|
||||
|
||||
snippet hmd "has_many :dependent => :destroy"
|
||||
has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}, :dependent => :destroy$0
|
||||
endsnippet
|
||||
|
||||
snippet ho "has_one (ho)"
|
||||
has_one :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"}
|
||||
endsnippet
|
||||
|
||||
snippet logd "logger.debug"
|
||||
${1:Rails.}logger.debug { "${1:message}" }$0
|
||||
endsnippet
|
||||
|
||||
snippet loge "logger.error"
|
||||
logger.error { "${1:message}" }$0
|
||||
endsnippet
|
||||
|
||||
snippet logf "logger.fatal"
|
||||
logger.fatal { "${1:message}" }$0
|
||||
endsnippet
|
||||
|
||||
snippet logi "logger.info"
|
||||
logger.info { "${1:message}" }$0
|
||||
endsnippet
|
||||
|
||||
snippet logw "logger.warn"
|
||||
logger.warn { "${1:message}" }$0
|
||||
endsnippet
|
||||
|
||||
snippet mp "map(&:sym_proc)"
|
||||
map(&:${1:id})
|
||||
endsnippet
|
||||
|
||||
snippet mapca "map.catch_all"
|
||||
${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}"
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet map "map.named_route"
|
||||
${1:map}.${2:connect} '${3::controller/:action/:id}'
|
||||
endsnippet
|
||||
|
||||
snippet mapr "map.resource"
|
||||
${1:map}.resource :${2:resource}${10: do |${11:$2}|
|
||||
$0
|
||||
end}
|
||||
endsnippet
|
||||
|
||||
snippet maprs "map.resources"
|
||||
${1:map}.resources :${2:resource}${10: do |${11:$2}|
|
||||
$0
|
||||
end}
|
||||
endsnippet
|
||||
|
||||
snippet mapwo "map.with_options"
|
||||
${1:map}.with_options :${2:controller} => '${3:thing}' do |${4:$3}|
|
||||
$0
|
||||
end
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet mrw "mattr_accessor"
|
||||
mattr_accessor :${0:attr_names}
|
||||
endsnippet
|
||||
|
||||
snippet ncl "named_scope lambda"
|
||||
named_scope :name, lambda { |${1:param}| { :conditions => ${3:['${4:${5:field} = ?}', ${6:$1}]} } }
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet nc "named_scope"
|
||||
named_scope :name${1:, :joins => :${2:table}}, :conditions => ${3:['${4:${5:field} = ?}', ${6:true}]}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet dscope "default_scope"
|
||||
default_scope ${1:order(${2:'${3:created_at DESC}'})}
|
||||
endsnippet
|
||||
|
||||
snippet flash "flash[...]"
|
||||
flash[:${1:notice}] = "${2:Successfully created...}"$0
|
||||
endsnippet
|
||||
|
||||
snippet rea "redirect_to (action)"
|
||||
redirect_to :action => "${1:index}"
|
||||
endsnippet
|
||||
|
||||
snippet reai "redirect_to (action, id)"
|
||||
redirect_to :action => "${1:show}", :id => ${0:@item}
|
||||
endsnippet
|
||||
|
||||
snippet rec "redirect_to (controller)"
|
||||
redirect_to :controller => "${1:items}"
|
||||
endsnippet
|
||||
|
||||
snippet reca "redirect_to (controller, action)"
|
||||
redirect_to :controller => "${1:items}", :action => "${2:list}"
|
||||
endsnippet
|
||||
|
||||
snippet recai "redirect_to (controller, action, id)"
|
||||
redirect_to :controller => "${1:items}", :action => "${2:show}", :id => ${0:@item}
|
||||
endsnippet
|
||||
|
||||
snippet renpp "redirect_to (nested path plural)"
|
||||
redirect_to(${2:${10:parent}_${11:child}_path(${12:@}${13:${10}})})
|
||||
endsnippet
|
||||
|
||||
snippet renp "redirect_to (nested path)"
|
||||
redirect_to(${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})})
|
||||
endsnippet
|
||||
|
||||
snippet repp "redirect_to (path plural)"
|
||||
redirect_to(${2:${10:model}s_path})
|
||||
endsnippet
|
||||
|
||||
snippet rep "redirect_to (path)"
|
||||
redirect_to(${2:${12:model}_path(${13:@}${14:${12}})})
|
||||
endsnippet
|
||||
|
||||
snippet reb "redirect_to :back"
|
||||
redirect_to :back
|
||||
endsnippet
|
||||
|
||||
snippet ra "render (action)... (ra)"
|
||||
render :action => "${1:action}"
|
||||
endsnippet
|
||||
|
||||
snippet ral "render (action,layout) (ral)"
|
||||
render :action => "${1:action}", :layout => "${2:layoutname}"
|
||||
endsnippet
|
||||
|
||||
snippet rf "render (file) (rf)"
|
||||
render :file => "${1:filepath}"
|
||||
endsnippet
|
||||
|
||||
snippet rfu "render (file,use_full_path) (rfu)"
|
||||
render :file => "${1:filepath}", :use_full_path => ${2:false}
|
||||
endsnippet
|
||||
|
||||
snippet ri "render (inline) (ri)"
|
||||
render :inline => "${1:<%= 'hello' %>}"
|
||||
endsnippet
|
||||
|
||||
snippet ril "render (inline,locals) (ril)"
|
||||
render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"$4 }
|
||||
endsnippet
|
||||
|
||||
snippet rit "render (inline,type) (rit)"
|
||||
render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml}
|
||||
endsnippet
|
||||
|
||||
snippet rl "render (layout) (rl)"
|
||||
render :layout => "${1:layoutname}"
|
||||
endsnippet
|
||||
|
||||
snippet rn "render (nothing) (rn)"
|
||||
render :nothing => ${1:true}
|
||||
endsnippet
|
||||
|
||||
snippet rns "render (nothing,status) (rns)"
|
||||
render :nothing => ${1:true}, :status => ${2:401}
|
||||
endsnippet
|
||||
|
||||
snippet rt "render (text) (rt)"
|
||||
render :text => "${1:text to render...}"
|
||||
endsnippet
|
||||
|
||||
snippet rtl "render (text,layout) (rtl)"
|
||||
render :text => "${1:text to render...}", :layout => "${2:layoutname}"
|
||||
endsnippet
|
||||
|
||||
snippet rtlt "render (text,layout => true) (rtlt)"
|
||||
render :text => "${1:text to render...}", :layout => ${2:true}
|
||||
endsnippet
|
||||
|
||||
snippet rts "render (text,status) (rts)"
|
||||
render :text => "${1:text to render...}", :status => ${2:401}
|
||||
endsnippet
|
||||
|
||||
snippet ru "render (update)"
|
||||
render :update do |${2:page}|
|
||||
$2.$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet rest "respond_to"
|
||||
respond_to do |wants|
|
||||
wants.${1:html}${2: { $0 \}}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet resw "respond_with"
|
||||
respond_with(${1:@${2:model}})${3: do |format|
|
||||
format.${4:html} { $0 \}
|
||||
end}
|
||||
endsnippet
|
||||
|
||||
# FIXME
|
||||
snippet returning "returning do |variable| ... end"
|
||||
returning ${1:variable} do${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1: |)/}${2:v}${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.binary (tcbi)"
|
||||
t.binary :${1:title}${2:, :limit => ${3:2}.megabytes}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.boolean (tcb)"
|
||||
t.boolean :${1:title}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.date (tcda)"
|
||||
t.date :${1:title}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.datetime (tcdt)"
|
||||
t.datetime :${1:title}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.decimal (tcd)"
|
||||
t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.float (tcf)"
|
||||
t.float :${1:title}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.integer (tci)"
|
||||
t.integer :${1:title}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.lock_version (tcl)"
|
||||
t.integer :lock_version, :null => false, :default => 0
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.references (tcr)"
|
||||
t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.rename (tre)"
|
||||
t.rename(:${1:old_column_name}, :${2:new_column_name})
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.string (tcs)"
|
||||
t.string :${1:title}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.text (tct)"
|
||||
t.text :${1:title}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.time (tcti)"
|
||||
t.time :${1:title}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.timestamp (tcts)"
|
||||
t.timestamp :${1:title}
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet t. "t.timestamps (tctss)"
|
||||
t.timestamps
|
||||
t.$0
|
||||
endsnippet
|
||||
|
||||
snippet vaoif "validates_acceptance_of if"
|
||||
validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}, :if => proc { |obj| ${7:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet vao "validates_acceptance_of"
|
||||
validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}
|
||||
endsnippet
|
||||
|
||||
snippet va "validates_associated (va)"
|
||||
validates_associated :${1:attribute}${2:, :on => :${3:create}}
|
||||
endsnippet
|
||||
|
||||
snippet vaif "validates_associated if (vaif)"
|
||||
validates_associated :${1:attribute}${2:, :on => :${3:create}, :if => proc { |obj| ${5:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet vc "validates_confirmation_of (vc)"
|
||||
validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}"}
|
||||
endsnippet
|
||||
|
||||
snippet vcif "validates_confirmation_of if (vcif)"
|
||||
validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}", :if => proc { |obj| ${5:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet ve "validates_exclusion_of (ve)"
|
||||
validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}
|
||||
endsnippet
|
||||
|
||||
snippet veif "validates_exclusion_of if (veif)"
|
||||
validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}, :if => proc { |obj| ${7:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet vfif "validates_format_of if"
|
||||
validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}, :if => proc { |obj| ${7:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet vf "validates_format_of"
|
||||
validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}
|
||||
endsnippet
|
||||
|
||||
snippet viif "validates_inclusion_of if"
|
||||
validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}, :if => proc { |obj| ${7:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet vi "validates_inclusion_of"
|
||||
validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}
|
||||
endsnippet
|
||||
|
||||
snippet vl "validates_length_of (vl)"
|
||||
validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}
|
||||
endsnippet
|
||||
|
||||
snippet vlif "validates_length_of if"
|
||||
validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}, :if => proc { |obj| ${6:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet vnif "validates_numericality_of if"
|
||||
validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}, :if => proc { |obj| ${5:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet vn "validates_numericality_of"
|
||||
validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}
|
||||
endsnippet
|
||||
|
||||
snippet vp "validates_presence_of (vp)"
|
||||
validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}
|
||||
endsnippet
|
||||
|
||||
snippet vpif "validates_presence_of if (vpif) 2"
|
||||
validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}, :if => proc { |obj| ${5:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet vu "validates_uniqueness_of (vu)"
|
||||
validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}"}
|
||||
endsnippet
|
||||
|
||||
snippet vuif "validates_uniqueness_of if (vuif)"
|
||||
validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}", :if => proc { |obj| ${6:obj.condition?} }}
|
||||
endsnippet
|
||||
|
||||
snippet verify "verify -- render"
|
||||
verify :only => [:$1], :method => :post, :render => {:status => 500, :text => "use HTTP-POST"}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet verify "verify -- redirect"
|
||||
verify :only => [:$1], :session => :user, :params => :id, :redirect_to => {:action => '${2:index}'}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet wants "wants_format"
|
||||
wants.${1:js|xml|html}${2: { $0 \}}
|
||||
endsnippet
|
||||
|
||||
snippet xdelete "xhr delete"
|
||||
xhr :delete, :${1:destroy}, :id => ${2:1}$0
|
||||
endsnippet
|
||||
|
||||
snippet xget "xhr get"
|
||||
xhr :get, :${1:show}${2:, :id => ${3:1}}$0
|
||||
endsnippet
|
||||
|
||||
snippet xpost "xhr post"
|
||||
xhr :post, :${1:create}, :${2:object} => { $3 }
|
||||
endsnippet
|
||||
|
||||
snippet xput "xhr put"
|
||||
xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { $4 }$0
|
||||
endsnippet
|
||||
|
||||
snippet finl "find(:last)"
|
||||
find(:last${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
|
||||
endsnippet
|
||||
|
||||
snippet sweeper "Create sweeper class"
|
||||
class ${1:Model}Sweeper < ActionController::Caching::Sweeper
|
||||
observe ${1:Model}
|
||||
|
||||
def after_save(${1/./\l$0/})
|
||||
expire_cache(${1/./\l$0/})
|
||||
end
|
||||
|
||||
def after_destroy(${1/./\l$0/})
|
||||
expire_cache(${1/./\l$0/})
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def expire_cache(${1/./\l$0/})
|
||||
${0:expire_page ${1/./\l$0/}s_path
|
||||
expire_page ${1/./\l$0/}_path(${1/./\l$0/})}
|
||||
end
|
||||
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet col "collection routes"
|
||||
collection do
|
||||
${1:get :${2:action}}
|
||||
${3:put :${4:action}}
|
||||
${5:post :${6:action}}
|
||||
${7:delete :${8:action}}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet format "format (respond_with)"
|
||||
format.${1:html|xml|json|js|any} { $0 }
|
||||
endsnippet
|
||||
|
||||
snippet gem "gem"
|
||||
gem '${1:name}'${2:${3:, "${4:1.0}"}${5:${6:, :require => ${7:"${8:$1}"}}${9:, :group => :${10:test}}}}
|
||||
endsnippet
|
||||
|
||||
snippet gemg "gem :git"
|
||||
gem '${1:paperclip}', :git => "${2:git://github.com/thoughtbot/paperclip.git}"${3:, :branch => "${4:rails3}"}
|
||||
endsnippet
|
||||
|
||||
snippet match "match"
|
||||
match '${1:${2::controller}${3:/${4::action}${5:/${6::id}${7:(.:format)}}}}'${8: => '${9:$2}#${10:$4}'${11:, :as => :${12:$10}}}
|
||||
endsnippet
|
||||
|
||||
snippet member "member routes"
|
||||
member do
|
||||
${1:get :${2:action}}
|
||||
${3:put :${4:action}}
|
||||
${5:post :${6:action}}
|
||||
${7:delete :${8:action}}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet res "resources"
|
||||
resources :${1:posts}${2: do
|
||||
$3
|
||||
end}
|
||||
endsnippet
|
||||
|
||||
snippet scope "scope"
|
||||
scope :${1:name}, ${2:joins(:${3:table}).}where(${4:'${5:$3.${6:field}} = ?', ${7:'${8:value}'}})
|
||||
endsnippet
|
||||
|
||||
snippet scopel "scope lambda"
|
||||
scope :${1:name}, lambda { |${2:param}| ${3:where(${4::${5:field} => ${6:"${7:value}"}})} }
|
||||
endsnippet
|
||||
|
||||
snippet scopee "scope with extension"
|
||||
scope :${1:name}, ${2:where(${3::${4:field} => ${5:'${6:value}'}})} do
|
||||
def ${7:method_name}
|
||||
$0
|
||||
end
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet sb "scoped_by"
|
||||
scoped_by_${1:attribute}(${2:id})
|
||||
endsnippet
|
||||
|
||||
snippet setup "setup do..end"
|
||||
setup do
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet trans "Translation snippet"
|
||||
I18n.t('`!v substitute(substitute(substitute(@%, substitute(getcwd() . "/", "\/", "\\\\/", "g"), "", ""), "\\(\\.\\(html\\|js\\)\\.\\(haml\\|erb\\)\\|\\(_controller\\)\\?\\.rb\\)$", "", ""), "/", ".", "g")`.${2:${1/[^\w]/_/g}}${3}', :default => "${1:some_text}"${4})${5:$0}
|
||||
endsnippet
|
||||
|
||||
snippet route_spec
|
||||
it 'routes to #${1:action}' do
|
||||
${2:get}('/${3:url}').should route_to('`!v substitute(expand('%:t:r'), '_routing_spec$', '', '')`#$1'${4:, ${5:params}})${6}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
316
bundle/vim-snippets/UltiSnips/rst.snippets
Normal file
316
bundle/vim-snippets/UltiSnips/rst.snippets
Normal file
@ -0,0 +1,316 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
priority -50
|
||||
|
||||
###########################################################################
|
||||
# General Stuff #
|
||||
###########################################################################
|
||||
global !p
|
||||
import vim
|
||||
from os import path as ospath
|
||||
from string import Template
|
||||
import re
|
||||
from collections import Counter
|
||||
|
||||
#http://docutils.sourceforge.net/docs/ref/rst/roles.html
|
||||
TEXT_ROLES = ['emphasis','literal','code','math',
|
||||
'pep-reference','rfc-reference',
|
||||
'strong','subscript','superscript',
|
||||
'title-reference','raw']
|
||||
TEXT_ROLES_REGEX = r'\.\.\srole::?\s(w+)'
|
||||
|
||||
#http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions
|
||||
SPECIFIC_ADMONITIONS = ["attention", "caution", "danger",
|
||||
"error", "hint", "important", "note",
|
||||
"tip", "warning"]
|
||||
#http://docutils.sourceforge.net/docs/ref/rst/directives.html
|
||||
DIRECTIVES = ['topic','sidebar','math','epigraph',
|
||||
'parsed-literal','code','highlights',
|
||||
'pull-quote','compound','container',
|
||||
'list-table','class','sectnum',
|
||||
'role','default-role','unicode',
|
||||
'raw']
|
||||
|
||||
NONE_CONTENT_DIRECTIVES = ['rubric', 'contents', 'header',
|
||||
'footer', 'date', 'include', 'title']
|
||||
|
||||
INCLUDABLE_DIRECTIVES = ['image', 'figure', 'include']
|
||||
# CJK chars
|
||||
# http://stackoverflow.com/questions/2718196/find-all-chinese-text-in-a-string-using-python-and-regex
|
||||
CJK_RE = re.compile(u'[⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〺〻㐀-䶵一-鿃豈-鶴侮-頻並-龎]', re.UNICODE)
|
||||
|
||||
|
||||
def has_cjk(char):
|
||||
"""
|
||||
Detect char contains CJK character
|
||||
|
||||
:param char: characters needs to be detect
|
||||
"""
|
||||
try:
|
||||
CJK_RE.finditer(char).next()
|
||||
except StopIteration:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def real_filename(filename):
|
||||
"""pealeextension name off if possible
|
||||
# i.e. "foo.bar.png will return "foo.bar"
|
||||
"""
|
||||
return ospath.splitext(filename)[0]
|
||||
|
||||
def check_file_exist(rst_path, relative_path):
|
||||
"""
|
||||
For RST file, it can just include files as relative path.
|
||||
|
||||
:param rst_path: absolute path to rst file
|
||||
:param relative_path: path related to rst file
|
||||
:return: relative file's absolute path if file exist
|
||||
"""
|
||||
abs_path = ospath.join(ospath.dirname(rst_path), relative_path)
|
||||
if ospath.isfile(abs_path):
|
||||
return abs_path
|
||||
|
||||
|
||||
def rst_char_len(char):
|
||||
"""
|
||||
return len of string which fit in rst
|
||||
For instance:chinese "我" decode as only one character,
|
||||
However, the rst interpreter needs 2 "=" instead of 1.
|
||||
|
||||
:param: char needs to be count
|
||||
"""
|
||||
return len(re.findall(r'[^\u4e00-\u9fff\s]', char))+len(char)
|
||||
|
||||
def make_items(times, leading='+'):
|
||||
"""
|
||||
make lines with leading char multitimes
|
||||
|
||||
:param: times, how many times you need
|
||||
:param: leading, leading character
|
||||
"""
|
||||
times = int(times)
|
||||
if leading == 1:
|
||||
msg = ""
|
||||
for x in xrange(1, times+1):
|
||||
msg += "%s. Item\n" % x
|
||||
return msg
|
||||
else:
|
||||
return ("%s Item\n" % leading) * times
|
||||
|
||||
|
||||
def look_up_directives(regex, fpath):
|
||||
"""
|
||||
find all directive args in given file
|
||||
:param: regex, the regex that needs to match
|
||||
:param: path, to path to rst file
|
||||
|
||||
:return: list, empty list if nothing match
|
||||
"""
|
||||
try:
|
||||
with open(fpath) as source:
|
||||
match = re.findall(regex, source.read())
|
||||
except IOError:
|
||||
match = []
|
||||
return match
|
||||
|
||||
|
||||
def get_popular_code_type():
|
||||
"""
|
||||
find most popular code type in the given rst
|
||||
|
||||
:param path: file to detect
|
||||
|
||||
:return: string, most popular code type in file
|
||||
"""
|
||||
buf = "".join(vim.current.buffer)
|
||||
types = re.findall(r'[:|\.\.\s]code::?\s(\w+)', buf)
|
||||
try:
|
||||
popular_type = Counter(types).most_common()[0][0]
|
||||
except IndexError:
|
||||
popular_type = "lua" # Don't break default
|
||||
return popular_type
|
||||
|
||||
|
||||
def complete(t, opts):
|
||||
"""
|
||||
get options that start with t
|
||||
|
||||
:param t: query string
|
||||
:param opts: list that needs to be completed
|
||||
|
||||
:return: a string that start with t
|
||||
"""
|
||||
msg = "({0})"
|
||||
if t:
|
||||
opts = [ m[len(t):] for m in opts if m.startswith(t) ]
|
||||
if len(opts) == 1:
|
||||
return opts[0]
|
||||
|
||||
if not len(opts):
|
||||
msg = "{0}"
|
||||
return msg.format("|".join(opts))
|
||||
|
||||
endglobal
|
||||
|
||||
snippet part "Part" b
|
||||
`!p snip.rv = rst_char_len(t[1])*'#'`
|
||||
${1:Part name}
|
||||
`!p snip.rv = rst_char_len(t[1])*'#'`
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet sec "Section" b
|
||||
${1:Section name}
|
||||
`!p snip.rv = rst_char_len(t[1])*'='`
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ssec "Subsection" b
|
||||
${1:Section name}
|
||||
`!p snip.rv = rst_char_len(t[1])*'-'`
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet sssec "Subsubsection" b
|
||||
${1:Section name}
|
||||
`!p snip.rv = rst_char_len(t[1])*'^'`
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet chap "Chapter" b
|
||||
`!p snip.rv = rst_char_len(t[1])*'*'`
|
||||
${1:Chapter name}
|
||||
`!p snip.rv = rst_char_len(t[1])*'*'`
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet para "Paragraph" b
|
||||
${1:Paragraph name}
|
||||
`!p snip.rv = rst_char_len(t[1])*'"'`
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet em "Emphasize string" i
|
||||
`!p
|
||||
# dirty but works with CJK charactor detection
|
||||
if has_cjk(vim.current.line):
|
||||
snip.rv ="\ "`*${1:${VISUAL:Em}}*`!p
|
||||
if has_cjk(vim.current.line):
|
||||
snip.rv ="\ "
|
||||
else:
|
||||
snip.rv = " "
|
||||
`$0
|
||||
endsnippet
|
||||
|
||||
snippet st "Strong string" i
|
||||
`!p
|
||||
if has_cjk(vim.current.line):
|
||||
snip.rv ="\ "`**${1:${VISUAL:Strong}}**`!p
|
||||
if has_cjk(vim.current.line):
|
||||
snip.rv ="\ "
|
||||
else:
|
||||
snip.rv = " "
|
||||
`$0
|
||||
endsnippet
|
||||
|
||||
snippet "li(st)? (?P<num>\d+)" "List" br
|
||||
$0
|
||||
`!p
|
||||
# usage: li 4<tab>
|
||||
# which will extand into a unordered list contains 4 items
|
||||
snip.rv = make_items(match.groupdict()['num'])
|
||||
`
|
||||
endsnippet
|
||||
|
||||
snippet "ol(st)? (?P<num>\d+)" "Order List" br
|
||||
$0
|
||||
`!p
|
||||
# usage: ol 4<tab>
|
||||
# which will extand into a ordered list contains 4 items
|
||||
snip.rv = make_items(match.groupdict()['num'], 1)
|
||||
`
|
||||
endsnippet
|
||||
###########################################################################
|
||||
# More Specialized Stuff. #
|
||||
###########################################################################
|
||||
snippet cb "Code Block" b
|
||||
.. code-block:: ${1:`!p snip.rv = get_popular_code_type()`}
|
||||
|
||||
${2:code}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
# match snippets :
|
||||
# img, inc, fig
|
||||
snippet id "Includable Directives" b
|
||||
`!p
|
||||
real_name=real_filename(ospath.basename(t[2]))
|
||||
di=t[1][:2]
|
||||
|
||||
link=""
|
||||
content=""
|
||||
|
||||
if di == 'im':
|
||||
link = "|{0}|".format(real_name)
|
||||
|
||||
if di == 'fi':
|
||||
content="""
|
||||
:alt: {0}
|
||||
{0}""".format(real_name)
|
||||
`
|
||||
..`!p snip.rv = " %s" % link if link else ""` $1`!p snip.rv=complete(t[1], INCLUDABLE_DIRECTIVES)`:: ${2:file}`!p if content:
|
||||
snip.rv +=" "+content`
|
||||
`!p
|
||||
# Tip of whether file is exist in comment type
|
||||
if not check_file_exist(path, t[2]):
|
||||
snip.rv='.. FILE {0} does not exist'.format(t[2])
|
||||
else:
|
||||
snip.rv=""
|
||||
`$0
|
||||
endsnippet
|
||||
|
||||
snippet di "Directives" b
|
||||
.. $1`!p snip.rv=complete(t[1], DIRECTIVES)`:: $2
|
||||
|
||||
${3:Content}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet nd "None Content Directives" b
|
||||
.. $1`!p snip.rv=complete(t[1], NONE_CONTENT_DIRECTIVES)`:: $2
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet sa "Specific Admonitions" b
|
||||
.. $1`!p snip.rv =complete(t[1], SPECIFIC_ADMONITIONS)`::
|
||||
|
||||
${2:Content}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
#it will be trigger at start of line or after a word
|
||||
snippet ro "Text Roles" w
|
||||
\ :$1`!p snip.rv=complete(t[1],
|
||||
TEXT_ROLES+look_up_directives(TEXT_ROLES_REGEX,
|
||||
path))`:\`$2\`\
|
||||
endsnippet
|
||||
|
||||
############
|
||||
# Sphinx #
|
||||
############
|
||||
|
||||
snippet sid "SideBar" b
|
||||
.. sidebar:: ${1:SideBar Title}
|
||||
|
||||
${2:SideBar Content}
|
||||
endsnippet
|
||||
# vim:ft=snippets:
|
570
bundle/vim-snippets/UltiSnips/ruby.snippets
Normal file
570
bundle/vim-snippets/UltiSnips/ruby.snippets
Normal file
@ -0,0 +1,570 @@
|
||||
priority -50
|
||||
|
||||
snippet "^#!" "#!/usr/bin/env ruby" r
|
||||
#!/usr/bin/env ruby
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet "^# ?[uU][tT][fF]-?8" "# encoding: UTF-8" r
|
||||
# encoding: UTF-8
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet If "<command> if <expression>"
|
||||
${1:command} if ${0:expression}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet Unless "<command> unless <expression>"
|
||||
${1:command} unless ${0:expression}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet if "if <condition> ... end"
|
||||
if ${1:condition}
|
||||
${2:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet ife "if <condition> ... else ... end"
|
||||
if ${1:condition}
|
||||
${2:# TODO}
|
||||
else
|
||||
${3:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet ifee "if <condition> ... elseif <condition> ... else ... end"
|
||||
if ${1:condition}
|
||||
${2:# TODO}
|
||||
elsif ${3:condition}
|
||||
${4:# TODO}
|
||||
else
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet unless "unless <condition> ... end"
|
||||
unless ${1:condition}
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet unlesse "unless <condition> ... else ... end"
|
||||
unless ${1:condition}
|
||||
${2:# TODO}
|
||||
else
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet unlesee "unless <condition> ... elseif <condition> ... else ... end"
|
||||
unless ${1:condition}
|
||||
${2:# TODO}
|
||||
elsif ${3:condition}
|
||||
${4:# TODO}
|
||||
else
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "\b(de)?f" "def <name>..." r
|
||||
def ${1:function_name}${2: ${3:*args}}
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet defi "def initialize ..."
|
||||
def initialize${1: ${2:*args}}
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet defr "def <name> ... rescue ..."
|
||||
def ${1:function_name}${2: ${3:*args}}
|
||||
${4:# TODO}
|
||||
rescue
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet For "(<from>..<to>).each { |<i>| <block> }"
|
||||
(${1:from}..${2:to}).each { |${3:i}| ${4:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet for "(<from>..<to>).each do |<i>| <block> end"
|
||||
(${1:from}..${2:to}).each do |${3:i}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Merge!" ".merge!(<other_hash>) { |<key>,<oldval>,<newval>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.merge!(${1:other_hash}) { |${2:key},${3:oldval},${4:newval}| ${5:block} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.merge!" ".merge!(<other_hash>) do |<key>,<oldval>,<newval>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.merge!(${1:other_hash}) do |${2:key},${3:oldval},${4:newval}|
|
||||
${0:block}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Del(ete)?_?if" ".delete_if { |<key>,<value>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.delete_if { |${1:key},${2:value}| ${3:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.del(ete)?_?if" ".delete_if do |<key>,<value>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.delete_if do |${1:key},${2:value}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Keep_?if" ".keep_if { |<key>,<value>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.keep_if { |${1:key},${2:value}| ${3:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.keep_?if" ".keep_if do <key>,<value>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.keep_if do |${1:key},${2:value}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Reject" ".reject { |<key>,<value>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.reject { |${1:key},${2:value}| ${3:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.reject" ".reject do <key>,<value>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.reject do |${1:key},${2:value}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Select" ".select { |<item>| <block>}" r
|
||||
`!p snip.rv=match.group(1)`.select { |${1:item}| ${2:block} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.select" ".select do |<item>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.select do |${1:item}|
|
||||
${0:block}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Sort" ".sort { |<a>,<b>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.sort { |${1:a},${2:b}| ${3:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.sort" ".sort do |<a>,<b>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.sort do |${1:a},${2:b}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Each_?k(ey)?" ".each_key { |<key>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.each_key { |${1:key}| ${2:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.each_?k(ey)?" ".each_key do |key| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.each_key do |${1:key}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Each_?val(ue)?" ".each_value { |<value>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.each_value { |${1:value}| ${2:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.each_?val(ue)?" ".each_value do |<value>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.each_value do |${1:value}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet Each "<elements>.each { |<element>| <block> }"
|
||||
${1:elements}.each { |${2:${1/s$//}}| ${3:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet each "<elements>.each do |<element>| <block> end"
|
||||
${1:elements}.each do |${2:${1/s$//}}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "each_?s(lice)?" "<array>.each_slice(n) do |slice| <block> end" r
|
||||
${1:elements}.each_slice(${2:2}) do |${3:slice}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "Each_?s(lice)?" "<array>.each_slice(n) { |slice| <block> }" r
|
||||
${1:elements}.each_slice(${2:2}) { |${3:slice}| ${0:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Map" ".map { |<element>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.map { |${1:`!p
|
||||
element_name = match.group(1).lstrip('$@')
|
||||
ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
|
||||
try:
|
||||
wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
|
||||
snip.rv = wmatch.group(1).lower()
|
||||
except:
|
||||
snip.rv = 'element'
|
||||
`}| ${2:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.map" ".map do |<element>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.map do |${1:`!p
|
||||
element_name = match.group(1).lstrip('$@')
|
||||
ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
|
||||
try:
|
||||
wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
|
||||
snip.rv = wmatch.group(1).lower()
|
||||
except:
|
||||
snip.rv = 'element'
|
||||
`}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Rev(erse)?_?each" ".reverse_each { |<element>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.reverse_each { |${1:`!p
|
||||
element_name = match.group(1).lstrip('$@')
|
||||
ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
|
||||
try:
|
||||
wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
|
||||
snip.rv = wmatch.group(1).lower()
|
||||
except:
|
||||
snip.rv = 'element'
|
||||
`}| ${2:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.rev(erse)?_?each" ".reverse_each do |<element>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.reverse_each do |${1:`!p
|
||||
element_name = match.group(1).lstrip('$@')
|
||||
ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
|
||||
try:
|
||||
wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
|
||||
snip.rv = wmatch.group(1).lower()
|
||||
except:
|
||||
snip.rv = 'element'
|
||||
`}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Each" ".each { |<element>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.each { |${1:`!p
|
||||
element_name = match.group(1).lstrip('$@')
|
||||
ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
|
||||
try:
|
||||
wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
|
||||
snip.rv = wmatch.group(1).lower()
|
||||
except:
|
||||
snip.rv = 'element'
|
||||
`}| ${2:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.each" ".each do |<element>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.each do |${1:`!p
|
||||
element_name = match.group(1).lstrip('$@')
|
||||
ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
|
||||
try:
|
||||
wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
|
||||
snip.rv = wmatch.group(1).lower()
|
||||
except:
|
||||
snip.rv = 'element'
|
||||
`}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Each_?w(ith)?_?i(ndex)?" ".each_with_index { |<element>,<i>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.each_with_index { |${1:`!p
|
||||
element_name = match.group(1).lstrip('$@')
|
||||
ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
|
||||
try:
|
||||
wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
|
||||
snip.rv = wmatch.group(1).lower()
|
||||
except:
|
||||
snip.rv = 'element'
|
||||
`},${2:i}| ${3:# TODO} }$0
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.each_?w(ith)?_?i(ndex)?" ".each_with_index do |<element>,<i>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.each_with_index do |${1:`!p
|
||||
element_name = match.group(1).lstrip('$@')
|
||||
ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
|
||||
try:
|
||||
wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
|
||||
snip.rv = wmatch.group(1).lower()
|
||||
except:
|
||||
snip.rv = 'element'
|
||||
`},${2:i}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Each_?p(air)?" ".each_pair { |<key>,<value>| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.each_pair { |${1:key},${2:value}| ${3:# TODO} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.each_?p(air)?" ".each_pair do |<key>,<value>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.each_pair do |${1:key},${2:value}|
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.sub" ".sub(<expression>) { <block> }" r
|
||||
`!p snip.rv=match.group(1)`.sub(${1:expression}) { ${2:"replace_with"} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.gsub" ".gsub(<expression>) { <block> }" r
|
||||
`!p snip.rv=match.group(1)`.gsub(${1:expression}) { ${2:"replace_with"} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.index" ".index { |item| <block> }" r
|
||||
`!p snip.rv=match.group(1)`.index { |${1:item}| ${2:block} }
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "(\S+)\.Index" ".index do |item| ... end" r
|
||||
`!p snip.rv=match.group(1)`.index do |${1:item}|
|
||||
${0:block}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet do "do |<key>| ... end" i
|
||||
do |${1:args}|
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet Do "do ... end" i
|
||||
do
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet until "until <expression> ... end"
|
||||
until ${1:expression}
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet Until "begin ... end until <expression>"
|
||||
begin
|
||||
${0:# TODO}
|
||||
end until ${1:expression}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet while "while <expression> ... end"
|
||||
while ${1:expression}
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet While "begin ... end while <expression>"
|
||||
begin
|
||||
${0:# TODO}
|
||||
end while ${1:expression}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "\b(r|attr)" "attr_reader :<attr_names>" r
|
||||
attr_reader :${0:attr_names}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "\b(w|attr)" "attr_writer :<attr_names>" r
|
||||
attr_writer :${0:attr_names}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "\b(rw|attr)" "attr_accessor :<attr_names>" r
|
||||
attr_accessor :${0:attr_names}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet begin "begin ... rescue ... end"
|
||||
begin
|
||||
${1:# TODO}
|
||||
rescue
|
||||
${0:# TODO}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet begin "begin ... rescue ... else ... ensure ... end"
|
||||
begin
|
||||
${1:# Raise exception}
|
||||
rescue Exception => e
|
||||
puts e.message
|
||||
puts e.backtrace.inspect
|
||||
${2:# Rescue}
|
||||
else
|
||||
${3:# other exception}
|
||||
ensure
|
||||
${0:# always excute}
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet rescue
|
||||
rescue Exception => e
|
||||
puts e.message
|
||||
puts e.backtrace.inspect
|
||||
${0:# Rescue}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet "\b(case|sw(itch)?)" "case <variable> when <expression> ... end" r
|
||||
case ${1:variable}
|
||||
when ${2:expression}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet alias "alias :<new_name> :<old_name>"
|
||||
alias :${1:new_name} :${2:old_name}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet class "class <class_name> def initialize ... end end"
|
||||
class ${1:class_name}
|
||||
def initialize ${2:*args}
|
||||
$0
|
||||
end
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet module "module"
|
||||
module ${1:module_name}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet ###
|
||||
=begin
|
||||
$0
|
||||
=end
|
||||
endsnippet
|
||||
|
||||
# vim: set ts=2 sw=2 expandtab:
|
55
bundle/vim-snippets/UltiSnips/scss.snippets
Normal file
55
bundle/vim-snippets/UltiSnips/scss.snippets
Normal file
@ -0,0 +1,55 @@
|
||||
priority -50
|
||||
|
||||
snippet /@?imp/ "@import '...';" br
|
||||
@import '${1:file}';
|
||||
endsnippet
|
||||
|
||||
snippet /@?inc/ "@include mixin(...);" br
|
||||
@include ${1:mixin}(${2:arguments});
|
||||
endsnippet
|
||||
|
||||
snippet /@?ext?/ "@extend %placeholder;" br
|
||||
@extend %${1:placeholder};
|
||||
endsnippet
|
||||
|
||||
snippet /@?mixin/ "@mixin (...) { ... }" br
|
||||
@mixin ${1:name}(${2:arguments}) {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /@?fun/ "@function (...) { ... }" br
|
||||
@function ${1:name}(${2:arguments}) {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /@?if/ "@if (...) { ... }" br
|
||||
@if ${1:condition} {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /(} )?@?else/ "@else { ... }" br
|
||||
@else ${1:condition} {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /@?for/ "@for loop" br
|
||||
@for ${1:$i} from ${2:1} through ${3:3} {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /@?each/ "@each loop" br
|
||||
@each ${1:$item} in ${2:item, item, item} {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /@?while/ "@while loop" br
|
||||
@while ${1:$i} ${2:>} ${3:0} {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
92
bundle/vim-snippets/UltiSnips/sh.snippets
Normal file
92
bundle/vim-snippets/UltiSnips/sh.snippets
Normal file
@ -0,0 +1,92 @@
|
||||
priority -50
|
||||
|
||||
global !p
|
||||
import vim
|
||||
|
||||
# Tests for the existence of a variable declared by Vim's filetype detection
|
||||
# suggesting the type of shell script of the current file
|
||||
def testShell(scope, shell):
|
||||
return vim.eval("exists('" + scope + ":is_" + shell + "')")
|
||||
|
||||
# Loops over the possible variables, checking for global variables
|
||||
# first since they indicate an override by the user.
|
||||
def getShell():
|
||||
for scope in ["g", "b"]:
|
||||
for shell in ["bash", "posix", "sh", "kornshell"]:
|
||||
if testShell(scope, shell) == "1":
|
||||
if shell == "kornshell":
|
||||
return "ksh"
|
||||
if shell == "posix":
|
||||
return "sh"
|
||||
return shell
|
||||
return "sh"
|
||||
endglobal
|
||||
|
||||
###########################################################################
|
||||
# TextMate Snippets #
|
||||
###########################################################################
|
||||
snippet #!
|
||||
`!p snip.rv = '#!/bin/' + getShell() + "\n\n" `
|
||||
endsnippet
|
||||
|
||||
snippet !env "#!/usr/bin/env (!env)"
|
||||
`!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n\n" `
|
||||
endsnippet
|
||||
|
||||
snippet temp "Tempfile"
|
||||
${1:TMPFILE}="$(mktemp -t ${2:`!p
|
||||
snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled"
|
||||
`})"
|
||||
${3:${4/(.+)/trap "/}${4:rm -f '$${1/.*\s//}'}${4/(.+)/" 0 # EXIT\n/}${5/(.+)/trap "/}${5:rm -f '$${1/.*\s//}'; exit 1}${5/(.+)/" 2 # INT\n/}${6/(.+)/trap "/}${6:rm -f '$${1/.*\s//}'; exit 1}${6/(.+)/" 1 15 # HUP TERM\n/}}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet case "case .. esac (case)"
|
||||
case ${1:word} in
|
||||
${2:pattern} )
|
||||
$0;;
|
||||
esac
|
||||
endsnippet
|
||||
|
||||
snippet elif "elif .. (elif)"
|
||||
elif ${2:[[ ${1:condition} ]]}; then
|
||||
${0:#statements}
|
||||
endsnippet
|
||||
|
||||
snippet for "for ... done (for)"
|
||||
for (( i = 0; i < ${1:10}; i++ )); do
|
||||
${0:#statements}
|
||||
done
|
||||
endsnippet
|
||||
|
||||
snippet forin "for ... in ... done (forin)"
|
||||
for ${1:i}${2/.+/ in /}${2:words}; do
|
||||
${0:#statements}
|
||||
done
|
||||
endsnippet
|
||||
|
||||
snippet here "here document (here)"
|
||||
<<-${2:'${1:TOKEN}'}
|
||||
$0
|
||||
${1/['"`](.+)['"`]/$1/}
|
||||
endsnippet
|
||||
|
||||
snippet if "if ... then (if)"
|
||||
if ${2:[[ ${1:condition} ]]}; then
|
||||
${0:#statements}
|
||||
fi
|
||||
endsnippet
|
||||
|
||||
snippet until "until ... (done)"
|
||||
until ${2:[[ ${1:condition} ]]}; do
|
||||
${0:#statements}
|
||||
done
|
||||
endsnippet
|
||||
|
||||
snippet while "while ... (done)"
|
||||
while ${2:[[ ${1:condition} ]]}; do
|
||||
${0:#statements}
|
||||
done
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
21
bundle/vim-snippets/UltiSnips/snippets.snippets
Normal file
21
bundle/vim-snippets/UltiSnips/snippets.snippets
Normal file
@ -0,0 +1,21 @@
|
||||
priority -50
|
||||
|
||||
# We use a little hack so that the snippet is expanded
|
||||
# and parsed correctly
|
||||
snippet snip "Snippet definition" b
|
||||
`!p snip.rv = "snippet"` ${1:Tab_trigger} "${2:Description}" ${3:b}
|
||||
$0
|
||||
`!p snip.rv = "endsnippet"`
|
||||
endsnippet
|
||||
|
||||
snippet global "Global snippet" b
|
||||
`!p snip.rv = "global"` !p
|
||||
$0
|
||||
`!p snip.rv = "endglobal"`
|
||||
endsnippet
|
||||
|
||||
snippet vis "${VISUAL}" i
|
||||
\$\{VISUAL${1:${2:default}${3:/transform/}}\}
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
52
bundle/vim-snippets/UltiSnips/tcl.snippets
Normal file
52
bundle/vim-snippets/UltiSnips/tcl.snippets
Normal file
@ -0,0 +1,52 @@
|
||||
priority -50
|
||||
|
||||
###########################################################################
|
||||
# TEXTMATE SNIPPETS #
|
||||
###########################################################################
|
||||
snippet for "for... (for)" b
|
||||
for {${1:set i 0}} {${2:\$i < \$n}} {${3:incr i}} {
|
||||
${4}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet foreach "foreach... (foreach)"
|
||||
foreach ${1:var} ${2:\$list} {
|
||||
${3}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet if "if... (if)" b
|
||||
if {${1:condition}} {
|
||||
${2}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet proc "proc... (proc)" b
|
||||
proc ${1:name} {${2:args}} \
|
||||
{
|
||||
${3}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet switch "switch... (switch)" b
|
||||
switch ${1:-exact} -- ${2:\$var} {
|
||||
${3:match} {
|
||||
${4}
|
||||
}
|
||||
default {${5}}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet while "while... (while)" b
|
||||
while {${1:condition}} {
|
||||
${2}
|
||||
}
|
||||
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
110
bundle/vim-snippets/UltiSnips/tex.snippets
Normal file
110
bundle/vim-snippets/UltiSnips/tex.snippets
Normal file
@ -0,0 +1,110 @@
|
||||
priority -50
|
||||
|
||||
extends texmath
|
||||
|
||||
snippet "b(egin)?" "begin{} / end{}" br
|
||||
\begin{${1:something}}
|
||||
${0:${VISUAL}}
|
||||
\end{$1}
|
||||
endsnippet
|
||||
|
||||
snippet tab
|
||||
\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
|
||||
$0${2/((?<=.)c|l|r)|./(?1: & )/g}
|
||||
\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
|
||||
endsnippet
|
||||
|
||||
snippet fig "Figure environment" b
|
||||
\begin{figure}${2:[htpb]}
|
||||
\centering
|
||||
\includegraphics[width=${3:0.8}\linewidth]{${4:name.ext}}
|
||||
\caption{${4/(\w+)\.\w+/\u$1/}$0}
|
||||
\label{fig:${4/(\w+)\.\w+/$1/}}
|
||||
\end{figure}
|
||||
endsnippet
|
||||
|
||||
snippet enum "Enumerate" b
|
||||
\begin{enumerate}
|
||||
\item $0
|
||||
\end{enumerate}
|
||||
endsnippet
|
||||
|
||||
snippet item "Itemize" b
|
||||
\begin{itemize}
|
||||
\item $0
|
||||
\end{itemize}
|
||||
endsnippet
|
||||
|
||||
snippet desc "Description" b
|
||||
\begin{description}
|
||||
\item[$1] $0
|
||||
\end{description}
|
||||
endsnippet
|
||||
|
||||
snippet it "Individual item" b
|
||||
\item ${1}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet part "Part" b
|
||||
\part{${1:part name}}
|
||||
\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet cha "Chapter" b
|
||||
\chapter{${1:chapter name}}
|
||||
\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet sec "Section" b
|
||||
\section{${1:section name}}
|
||||
\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet sub "Subsection" b
|
||||
\subsection{${1:subsection name}}
|
||||
\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet ssub "Subsubsection" b
|
||||
\subsubsection{${1:subsubsection name}}
|
||||
\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet par "Paragraph" b
|
||||
\paragraph{${1:paragraph name}}
|
||||
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet subp "Subparagraph" b
|
||||
\subparagraph{${1:subparagraph name}}
|
||||
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet ni "Non-indented paragraph" b
|
||||
\noindent
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet pac "Package" b
|
||||
\usepackage[${1:options}]{${2:package}}$0
|
||||
endsnippet
|
||||
|
||||
snippet lp "Long parenthesis"
|
||||
\left(${1:${VISUAL:contents}}\right)$0
|
||||
endsnippet
|
||||
# vim:ft=snippets:
|
56
bundle/vim-snippets/UltiSnips/texmath.snippets
Normal file
56
bundle/vim-snippets/UltiSnips/texmath.snippets
Normal file
@ -0,0 +1,56 @@
|
||||
priority -50
|
||||
|
||||
##############
|
||||
# MATH STUFF #
|
||||
##############
|
||||
snippet eq "Equation" b
|
||||
\begin{equation}
|
||||
$0
|
||||
\end{equation}
|
||||
endsnippet
|
||||
|
||||
snippet eqnn "Equation without number" b
|
||||
\begin{equation*}
|
||||
$0
|
||||
\end{equation*}
|
||||
endsnippet
|
||||
|
||||
snippet eqa "Equation array" b
|
||||
\begin{eqnarray}
|
||||
$1 & $2 & $0
|
||||
\end{eqnarray}
|
||||
endsnippet
|
||||
|
||||
snippet eqann "Equation array without numbers" b
|
||||
\begin{eqnarray*}
|
||||
$1 & $2 & $0
|
||||
\end{eqnarray*}
|
||||
|
||||
endsnippet
|
||||
snippet frac "Fraction" w
|
||||
\frac{${1:${VISUAL:nom}}}{${2:denom}}
|
||||
endsnippet
|
||||
|
||||
snippet mat "Smart Matrix"
|
||||
\begin{${1:p/b/v/V/B/small}matrix}
|
||||
$0
|
||||
\end{$1matrix}
|
||||
endsnippet
|
||||
|
||||
snippet lr( "left( right)" w
|
||||
\left( ${1:${VISUAL}} \right)
|
||||
endsnippet
|
||||
|
||||
snippet lr| "left| right|" w
|
||||
\left| ${1:${VISUAL}} \right|
|
||||
endsnippet
|
||||
|
||||
snippet lr{ "left\{ right\}" w
|
||||
\left\\{ ${1:${VISUAL}} \right\\}
|
||||
endsnippet
|
||||
|
||||
snippet lr[ "left[ right]" w
|
||||
\left[ ${1:${VISUAL}} \right]
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
35
bundle/vim-snippets/UltiSnips/twig.snippets
Normal file
35
bundle/vim-snippets/UltiSnips/twig.snippets
Normal file
@ -0,0 +1,35 @@
|
||||
priority -50
|
||||
|
||||
snippet bl "twig block" b
|
||||
{% block ${1} %}
|
||||
${2}
|
||||
{% endblock $1 %}
|
||||
endsnippet
|
||||
|
||||
snippet js "twig javascripts" b
|
||||
{% javascripts '${1}' %}
|
||||
<script src="{{ asset_url }}"></script>
|
||||
{% endjavascripts %}
|
||||
endsnippet
|
||||
|
||||
snippet css "twig stylesheets" b
|
||||
{% stylesheets '${1}' %}
|
||||
<link rel="stylesheet" href="{{ asset_url }}">
|
||||
{% endstylesheets %}
|
||||
endsnippet
|
||||
|
||||
snippet if "twig if" b
|
||||
{% if ${1} %}
|
||||
${2}
|
||||
{% endif %}
|
||||
endsnippet
|
||||
|
||||
snippet for "twig for" b
|
||||
{% for ${1} in ${2} %}
|
||||
${3}
|
||||
{% endfor %}
|
||||
endsnippet
|
||||
|
||||
snippet ext "twig extends" b
|
||||
{% extends ${1} %}
|
||||
endsnippet
|
60
bundle/vim-snippets/UltiSnips/vim.snippets
Normal file
60
bundle/vim-snippets/UltiSnips/vim.snippets
Normal file
@ -0,0 +1,60 @@
|
||||
priority -50
|
||||
|
||||
###########################################################################
|
||||
# SnipMate Snippets #
|
||||
###########################################################################
|
||||
snippet header
|
||||
" File: ${1:`!v expand('%:t')`}
|
||||
" Author: ${2:`!v g:snips_author`}
|
||||
" Description: ${3}
|
||||
${4:" Last Modified: `!v strftime("%B %d, %Y")`}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet gvar "Global / configuration variable"
|
||||
if !exists("g:${1:MyUltraImportantVar}")
|
||||
let g:$1 = ${2:"${3:<tab>}"}
|
||||
endif
|
||||
endsnippet
|
||||
|
||||
snippet guard
|
||||
if exists('${1:did_`!p snip.rv = snip.fn.replace('.','_')`}') || &cp${2: || version < 700}
|
||||
finish
|
||||
endif
|
||||
let $1 = 1${3}
|
||||
endsnippet
|
||||
|
||||
snippet f
|
||||
fun ${1:function_name}(${2})
|
||||
${3:" code}
|
||||
endf
|
||||
endsnippet
|
||||
|
||||
snippet for
|
||||
for ${1:needle} in ${2:haystack}
|
||||
${3:" code}
|
||||
endfor
|
||||
endsnippet
|
||||
|
||||
snippet wh
|
||||
while ${1:condition}
|
||||
${2:" code}
|
||||
endw
|
||||
endsnippet
|
||||
|
||||
snippet if
|
||||
if ${1:condition}
|
||||
${2:" code}
|
||||
endif
|
||||
endsnippet
|
||||
|
||||
snippet ife
|
||||
if ${1:condition}
|
||||
${2}
|
||||
else
|
||||
${3}
|
||||
endif
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
3
bundle/vim-snippets/UltiSnips/xhtml.snippets
Normal file
3
bundle/vim-snippets/UltiSnips/xhtml.snippets
Normal file
@ -0,0 +1,3 @@
|
||||
priority -50
|
||||
|
||||
extends html
|
16
bundle/vim-snippets/UltiSnips/xml.snippets
Normal file
16
bundle/vim-snippets/UltiSnips/xml.snippets
Normal file
@ -0,0 +1,16 @@
|
||||
priority -50
|
||||
|
||||
snippet xml "XML declaration" b
|
||||
<?xml version="1.0"?>
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet t "Simple tag" b
|
||||
<${1:tag}>
|
||||
${2:content}
|
||||
</${1/([\w:._-]+).*/$1/}>
|
||||
endsnippet
|
||||
|
||||
snippet ti "Inline tag" b
|
||||
<${1:tag}>${2:content}</${1/([\w:._-]+).*/$1/}>
|
||||
endsnippet
|
17
bundle/vim-snippets/UltiSnips/zsh.snippets
Normal file
17
bundle/vim-snippets/UltiSnips/zsh.snippets
Normal file
@ -0,0 +1,17 @@
|
||||
priority -50
|
||||
|
||||
extends sh
|
||||
|
||||
priority -49
|
||||
|
||||
snippet #! "shebang" b
|
||||
#!/bin/zsh
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet !env "#!/usr/bin/env (!env)" b
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
9
bundle/vim-snippets/addon-info.json
Normal file
9
bundle/vim-snippets/addon-info.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"name" : "snipmate-snippets",
|
||||
"author" : "community",
|
||||
"maintainer" : "honza @ github & others",
|
||||
"repository" : {"type": "git", "url": "git://github.com/honza/snipmate-snippets.git"},
|
||||
"dependencies" : {
|
||||
},
|
||||
"description" : "community driven set of snippets for snipmate"
|
||||
}
|
27
bundle/vim-snippets/autoload/vim_snippets.vim
Normal file
27
bundle/vim-snippets/autoload/vim_snippets.vim
Normal file
@ -0,0 +1,27 @@
|
||||
" this is well known Filename found in snipmate (and the other engines), but
|
||||
" rewritten and documented :)
|
||||
"
|
||||
" optional arg1: string in which to replace '$1' by filename with extension
|
||||
" and path dropped. Defaults to $1
|
||||
" optional arg2: return this value if buffer has no filename
|
||||
" But why not use the template in this case, too?
|
||||
" Doesn't make sense to me
|
||||
fun! vim_snippets#Filename(...)
|
||||
let template = get(a:000, 0, "$1")
|
||||
let arg2 = get(a:000, 1, "")
|
||||
|
||||
let basename = expand('%:t:r')
|
||||
|
||||
if basename == ''
|
||||
return arg2
|
||||
else
|
||||
return substitute(template, '$1', basename, 'g')
|
||||
endif
|
||||
endf
|
||||
|
||||
" original code:
|
||||
" fun! Filename(...)
|
||||
" let filename = expand('%:t:r')
|
||||
" if filename == '' | return a:0 == 2 ? a:2 : '' | endif
|
||||
" return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g')
|
||||
" endf
|
241
bundle/vim-snippets/snippets/_.snippets
Normal file
241
bundle/vim-snippets/snippets/_.snippets
Normal file
@ -0,0 +1,241 @@
|
||||
# Global snippets
|
||||
|
||||
# (c) holds no legal value ;)
|
||||
snippet c)
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.
|
||||
snippet date
|
||||
`strftime("%Y-%m-%d")`
|
||||
snippet ddate
|
||||
`strftime("%B %d, %Y")`
|
||||
snippet time
|
||||
`strftime("%H:%M")`
|
||||
snippet datetime
|
||||
`strftime("%Y-%m-%d %H:%M")`
|
||||
snippet lorem
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
snippet GPL2
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${0}
|
||||
snippet LGPL2
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${0}
|
||||
snippet GPL3
|
||||
${1:one line to give the program's name and a brief description.}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${0}
|
||||
snippet LGPL3
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${0}
|
||||
snippet BSD2
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
The views and conclusions contained in the software and documentation
|
||||
are those of the authors and should not be interpreted as representing
|
||||
official policies, either expressedor implied, of $2.
|
||||
|
||||
${0}
|
||||
snippet BSD3
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the ${3:organization} nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
${0}
|
||||
snippet BSD4
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
This product includes software developed by the ${3:organization}.
|
||||
4. Neither the name of the $3 nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
${0}
|
||||
snippet MIT
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
${0}
|
||||
snippet APACHE
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
${0}
|
||||
snippet BEERWARE
|
||||
${2:one line to give the program's name and a brief description}
|
||||
Copyright `strftime("%Y")` ${3:copyright holder}
|
||||
|
||||
Licensed under the "THE BEER-WARE LICENSE" (Revision 42):
|
||||
${1:`g:snips_author`} wrote this file. As long as you retain this notice you
|
||||
can do whatever you want with this stuff. If we meet some day, and you think
|
||||
this stuff is worth it, you can buy me a beer or coffee in return
|
||||
|
||||
${0}
|
||||
|
||||
snippet WTFPL
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright `strftime("%Y")` ${0:copyright holder}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
157
bundle/vim-snippets/snippets/actionscript.snippets
Normal file
157
bundle/vim-snippets/snippets/actionscript.snippets
Normal file
@ -0,0 +1,157 @@
|
||||
snippet main
|
||||
package {
|
||||
import flash.display.*;
|
||||
import flash.Events.*;
|
||||
|
||||
public class Main extends Sprite {
|
||||
public function Main ( ) {
|
||||
trace("start");
|
||||
stage.scaleMode = StageScaleMode.NO_SCALE;
|
||||
stage.addEventListener(Event.RESIZE, resizeListener);
|
||||
}
|
||||
|
||||
private function resizeListener (e:Event):void {
|
||||
trace("The application window changed size!");
|
||||
trace("New width: " + stage.stageWidth);
|
||||
trace("New height: " + stage.stageHeight);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
snippet class
|
||||
${1:public|internal} class ${2:name} ${0:extends } {
|
||||
public function $2 ( ) {
|
||||
("start");
|
||||
}
|
||||
}
|
||||
snippet all
|
||||
package name {
|
||||
|
||||
${1:public|internal|final} class ${2:name} ${0:extends } {
|
||||
private|public| static const FOO = "abc";
|
||||
private|public| static var BAR = "abc";
|
||||
|
||||
// class initializer - no JIT !! one time setup
|
||||
if Cababilities.os == "Linux|MacOS" {
|
||||
FOO = "other";
|
||||
}
|
||||
|
||||
// constructor:
|
||||
public function $2 ( ){
|
||||
super2();
|
||||
trace("start");
|
||||
}
|
||||
public function name (a, b...){
|
||||
super.name(..);
|
||||
lable:break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function A(){
|
||||
// A can only be accessed within this file
|
||||
}
|
||||
snippet switch
|
||||
switch(${1}){
|
||||
case ${2}:
|
||||
${0}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
snippet case
|
||||
case ${1}:
|
||||
${0}
|
||||
break;
|
||||
snippet package
|
||||
package ${1:package}{
|
||||
${0}
|
||||
}
|
||||
snippet wh
|
||||
while ${1:cond}{
|
||||
${0}
|
||||
}
|
||||
snippet do
|
||||
do {
|
||||
${0}
|
||||
} while (${1:cond})
|
||||
snippet wh
|
||||
while ${1:cond}{
|
||||
${0}
|
||||
}
|
||||
snippet for enumerate names
|
||||
for (${1:var} in ${2:object}){
|
||||
${0}
|
||||
}
|
||||
snippet for enumerate values
|
||||
for each (${1:var} in ${2:object}){
|
||||
${0}
|
||||
}
|
||||
snippet get_set
|
||||
function get ${1:name} {
|
||||
return ${2}
|
||||
}
|
||||
function set $1 (newValue) {
|
||||
${0}
|
||||
}
|
||||
snippet interface
|
||||
interface name {
|
||||
function method(${1}):${0:returntype};
|
||||
}
|
||||
snippet try
|
||||
try {
|
||||
${1}
|
||||
} catch (error:ErrorType) {
|
||||
${2}
|
||||
} finally {
|
||||
${0}
|
||||
}
|
||||
# For Loop (same as c.snippet)
|
||||
snippet for for (..) {..}
|
||||
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
|
||||
${0}
|
||||
}
|
||||
# Custom For Loop
|
||||
snippet forr
|
||||
for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
|
||||
${0}
|
||||
}
|
||||
# If Condition
|
||||
snippet if
|
||||
if (${1:/* condition */}) {
|
||||
${0}
|
||||
}
|
||||
snippet el
|
||||
else {
|
||||
${0}
|
||||
}
|
||||
# Ternary conditional
|
||||
snippet t
|
||||
${1:/* condition */} ? ${2:a} : ${0:b}
|
||||
snippet fun
|
||||
function ${1:function_name}(${2})${3}
|
||||
{
|
||||
${0}
|
||||
}
|
||||
# FlxSprite (usefull when using the flixel library)
|
||||
snippet FlxSprite
|
||||
package
|
||||
{
|
||||
import org.flixel.*
|
||||
|
||||
public class ${1:ClassName} extends ${2:FlxSprite}
|
||||
{
|
||||
public function $1(${3: X:Number, Y:Number}):void
|
||||
{
|
||||
super(X,Y);
|
||||
${4}
|
||||
}
|
||||
|
||||
override public function update():void
|
||||
{
|
||||
super.update();
|
||||
${0}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
35
bundle/vim-snippets/snippets/apache.snippets
Normal file
35
bundle/vim-snippets/snippets/apache.snippets
Normal file
@ -0,0 +1,35 @@
|
||||
# Snippets for code blocks used oftenly in Apache files.
|
||||
# <Directory>
|
||||
snippet dir
|
||||
<Directory ${1:/}>
|
||||
DirectoryIndex ${0:index.html}
|
||||
Order Deny,Allow
|
||||
Deny from All
|
||||
</Directory>
|
||||
# <FilesMatch>
|
||||
snippet filesmatch
|
||||
<FilesMatch "${1:regex}">
|
||||
${0}
|
||||
</FilesMatch>
|
||||
# <IfModule>
|
||||
snippet ifmodule
|
||||
<IfModule ${1:mod_example.c}>
|
||||
${0}
|
||||
</IfModule>
|
||||
# <LimitExcept>
|
||||
snippet limitexcept
|
||||
<LimitExcept ${1:POST GET}>
|
||||
${0}
|
||||
</LimitExcept>
|
||||
# <Proxy>
|
||||
snippet proxy
|
||||
<Proxy ${1:*}>
|
||||
${0}
|
||||
</Proxy>
|
||||
# <VirtualHost>
|
||||
snippet virtualhost
|
||||
<VirtualHost ${1:*}:${2:80}>
|
||||
ServerAdmin ${3:webmaster@example.com}
|
||||
DocumentRoot ${4:/www/example.com}
|
||||
ServerName ${0:www.example.com}
|
||||
</VirtualHost>
|
66
bundle/vim-snippets/snippets/autoit.snippets
Normal file
66
bundle/vim-snippets/snippets/autoit.snippets
Normal file
@ -0,0 +1,66 @@
|
||||
snippet if
|
||||
If ${1:condition} Then
|
||||
${0:; True code}
|
||||
EndIf
|
||||
snippet el
|
||||
Else
|
||||
${0}
|
||||
snippet eif
|
||||
ElseIf ${1:condition} Then
|
||||
${0:; True code}
|
||||
# If/Else block
|
||||
snippet ife
|
||||
If ${1:condition} Then
|
||||
${2:; True code}
|
||||
Else
|
||||
${0:; Else code}
|
||||
EndIf
|
||||
# If/ElseIf/Else block - because there is eif this is not really neccessary
|
||||
snippet ifelif
|
||||
If ${1:condition 1} Then
|
||||
${2:; True code}
|
||||
ElseIf ${3:condition 2} Then
|
||||
${4:; True code}
|
||||
Else
|
||||
${0:; Else code}
|
||||
EndIf
|
||||
# Switch block
|
||||
snippet switch
|
||||
Switch (${1:condition})
|
||||
Case ${2:case1}:
|
||||
${3:; Case 1 code}
|
||||
Case Else:
|
||||
${0:; Else code}
|
||||
EndSwitch
|
||||
# Select block
|
||||
snippet select
|
||||
Select (${1:condition})
|
||||
Case ${2:case1}:
|
||||
${3:; Case 1 code}
|
||||
Case Else:
|
||||
${0:; Else code}
|
||||
EndSelect
|
||||
# While loop
|
||||
snippet wh
|
||||
While (${1:condition})
|
||||
${0:; code...}
|
||||
WEnd
|
||||
# For loop
|
||||
snippet for
|
||||
For ${1:n} = ${3:1} to ${2:count}
|
||||
${0:; code...}
|
||||
Next
|
||||
# New Function
|
||||
snippet func
|
||||
Func ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||
${0:Return}
|
||||
EndFunc
|
||||
# Message box
|
||||
snippet msg
|
||||
MsgBox(${0:MsgType}, ${1:"Title"}, ${2:"Message Text"})
|
||||
# Debug Message
|
||||
snippet debug
|
||||
MsgBox(0, "Debug", ${0:"Debug Message"})
|
||||
# Show Variable Debug Message
|
||||
snippet showvar
|
||||
MsgBox(0, "${0:VarName}", $1)
|
237
bundle/vim-snippets/snippets/c.snippets
Normal file
237
bundle/vim-snippets/snippets/c.snippets
Normal file
@ -0,0 +1,237 @@
|
||||
## Main
|
||||
# main
|
||||
snippet main
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
${0}
|
||||
return 0;
|
||||
}
|
||||
# main(void)
|
||||
snippet mainn
|
||||
int main(void)
|
||||
{
|
||||
${0}
|
||||
return 0;
|
||||
}
|
||||
##
|
||||
## Preprocessor
|
||||
# #include <...>
|
||||
snippet inc
|
||||
#include <${1:stdio}.h>
|
||||
# #include "..."
|
||||
snippet Inc
|
||||
#include "${1:`vim_snippets#Filename("$1.h")`}"
|
||||
# ifndef...define...endif
|
||||
snippet ndef
|
||||
#ifndef $1
|
||||
#define ${1:SYMBOL} ${2:value}
|
||||
#endif
|
||||
# define
|
||||
snippet def
|
||||
#define
|
||||
# ifdef...endif
|
||||
snippet ifdef
|
||||
#ifdef ${1:FOO}
|
||||
${2:#define }
|
||||
#endif
|
||||
# if
|
||||
snippet #if
|
||||
#if ${1:FOO}
|
||||
${0}
|
||||
#endif
|
||||
# header include guard
|
||||
snippet once
|
||||
#ifndef ${1:`toupper(vim_snippets#Filename('$1_H', 'UNTITLED_H'))`}
|
||||
|
||||
#define $1
|
||||
|
||||
${0}
|
||||
|
||||
#endif /* end of include guard: $1 */
|
||||
##
|
||||
## Control Statements
|
||||
# if
|
||||
snippet if
|
||||
if (${1:/* condition */}) {
|
||||
${2}
|
||||
}
|
||||
# else
|
||||
snippet el
|
||||
else {
|
||||
${1}
|
||||
}
|
||||
# else if
|
||||
snippet elif
|
||||
else if (${1:/* condition */}) {
|
||||
${2}
|
||||
}
|
||||
# ifi
|
||||
snippet ifi
|
||||
if (${1:/* condition */}) ${2};
|
||||
# ternary
|
||||
snippet t
|
||||
${1:/* condition */} ? ${2:a} : ${3:b}
|
||||
# switch
|
||||
snippet switch
|
||||
switch (${1:/* variable */}) {
|
||||
case ${2:/* variable case */}:
|
||||
${3}
|
||||
${4:break;}${5}
|
||||
default:
|
||||
${6}
|
||||
}
|
||||
# switch without default
|
||||
snippet switchndef
|
||||
switch (${1:/* variable */}) {
|
||||
case ${2:/* variable case */}:
|
||||
${3}
|
||||
${4:break;}${5}
|
||||
}
|
||||
# case
|
||||
snippet case
|
||||
case ${1:/* variable case */}:
|
||||
${2}
|
||||
${3:break;}
|
||||
##
|
||||
## Loops
|
||||
# for
|
||||
snippet for
|
||||
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
|
||||
${4}
|
||||
}
|
||||
# for (custom)
|
||||
snippet forr
|
||||
for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
|
||||
${5}
|
||||
}
|
||||
# while
|
||||
snippet wh
|
||||
while (${1:/* condition */}) {
|
||||
${2}
|
||||
}
|
||||
# do... while
|
||||
snippet do
|
||||
do {
|
||||
${2}
|
||||
} while (${1:/* condition */});
|
||||
##
|
||||
## Functions
|
||||
# function definition
|
||||
snippet fun
|
||||
${1:void} ${2:function_name}(${3})
|
||||
{
|
||||
${4}
|
||||
}
|
||||
# function declaration
|
||||
snippet fund
|
||||
${1:void} ${2:function_name}(${3});
|
||||
##
|
||||
## Types
|
||||
# typedef
|
||||
snippet td
|
||||
typedef ${1:int} ${2:MyCustomType};
|
||||
# struct
|
||||
snippet st
|
||||
struct ${1:`vim_snippets#Filename('$1_t', 'name')`} {
|
||||
${2:/* data */}
|
||||
}${3: /* optional variable list */};
|
||||
# typedef struct
|
||||
snippet tds
|
||||
typedef struct ${2:_$1 }{
|
||||
${3:/* data */}
|
||||
} ${1:`vim_snippets#Filename('$1_t', 'name')`};
|
||||
# typedef enum
|
||||
snippet tde
|
||||
typedef enum {
|
||||
${1:/* data */}
|
||||
} ${2:foo};
|
||||
##
|
||||
## Input/Output
|
||||
# printf
|
||||
snippet pr
|
||||
printf("${1:%s}\n"${2});
|
||||
# fprintf (again, this isn't as nice as TextMate's version, but it works)
|
||||
snippet fpr
|
||||
fprintf(${1:stderr}, "${2:%s}\n"${3});
|
||||
# getopt
|
||||
snippet getopt
|
||||
int choice;
|
||||
while (1)
|
||||
{
|
||||
static struct option long_options[] =
|
||||
{
|
||||
/* Use flags like so:
|
||||
{"verbose", no_argument, &verbose_flag, 'V'}*/
|
||||
/* Argument styles: no_argument, required_argument, optional_argument */
|
||||
{"version", no_argument, 0, 'v'},
|
||||
{"help", no_argument, 0, 'h'},
|
||||
${1}
|
||||
{0,0,0,0}
|
||||
};
|
||||
|
||||
int option_index = 0;
|
||||
|
||||
/* Argument parameters:
|
||||
no_argument: " "
|
||||
required_argument: ":"
|
||||
optional_argument: "::" */
|
||||
|
||||
choice = getopt_long( argc, argv, "vh",
|
||||
long_options, &option_index);
|
||||
|
||||
if (choice == -1)
|
||||
break;
|
||||
|
||||
switch( choice )
|
||||
{
|
||||
case 'v':
|
||||
${2}
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
${3}
|
||||
break;
|
||||
|
||||
case '?':
|
||||
/* getopt_long will have already printed an error */
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Not sure how to get here... */
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Deal with non-option arguments here */
|
||||
if ( optind < argc )
|
||||
{
|
||||
while ( optind < argc )
|
||||
{
|
||||
${0}
|
||||
}
|
||||
}
|
||||
##
|
||||
## Miscellaneous
|
||||
# This is kind of convenient
|
||||
snippet .
|
||||
[${1}]
|
||||
# GPL
|
||||
snippet gpl
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright (C) ${1:Author}, `strftime("%Y")`
|
||||
*/
|
||||
|
||||
${0}
|
204
bundle/vim-snippets/snippets/chef.snippets
Normal file
204
bundle/vim-snippets/snippets/chef.snippets
Normal file
@ -0,0 +1,204 @@
|
||||
# Opscode Chef Cookbook Recipe Resources
|
||||
# Snippet by: Mike Smullin <mike@smullindesign.com>
|
||||
# Based on: http://wiki.opscode.com/display/chef/Resources
|
||||
|
||||
# @TODO: Include Meta attributes and actions in all snippets
|
||||
# @TODO: Finish writing snippets for remaining Resources
|
||||
|
||||
snippet cookbook_file
|
||||
# Cookbook File resource
|
||||
cookbook_file ${1:"/path/to/file"} do # The remote path where the file will reside
|
||||
${2:#}backup ${3} # How many backups of this file to keep. Set to false if you want no backups
|
||||
${4:#}group ${5} # The group owner of the file (string or id)
|
||||
${6:#}mode ${7} # The octal mode of the file - e.g. 0755
|
||||
${8:#}owner ${9} # The owner for the file
|
||||
${10:#}source ${11} # The basename of the source file
|
||||
${12:#}cookbook ${13} # The cookbook this file is stored in
|
||||
|
||||
${14:#}${15: action :create} # Create this file (Default)
|
||||
${16:#}${17: action :create_if_missing} # Create only if it doesn't exist yet
|
||||
${18:#}${0: action :delete} # Delete this file
|
||||
end
|
||||
|
||||
snippet execute
|
||||
# Execute resource
|
||||
execute ${1:"command to execute"} do # The command to execute
|
||||
${2:#}creates ${3:nil} # A file this command creates - if the file exists, the command will not be run.
|
||||
${4:#}cwd ${5:nil} # Current working directory to run the command from.
|
||||
${6:#}environment ${7:nil} # A hash of environment variables to set before running this command.
|
||||
${8:#}group ${9:nil} # A group name or group ID that we should change to before running this command.
|
||||
${10:#}path ${11:nil} # An array of paths to use when searching for the command. Nil uses system path.
|
||||
${12:#}returns ${13:0} # The return value of the command - this resource raises an exception if the return value does not match.
|
||||
${14:#}timeout ${15:nil} # How many seconds to let the command run before timing it out.
|
||||
${16:#}user ${17:nil} # A user name or user ID that we should change to before running this command.
|
||||
${18:#}umask ${19:nil} # Umask for files created by the command
|
||||
|
||||
${20:#}${21:action :run} # Run this command (Default)
|
||||
${22:#}${0:action :nothing} # Do not run this command
|
||||
end
|
||||
|
||||
snippet link
|
||||
# Link resource
|
||||
link ${1:"/target/file"} do # The file name of the link
|
||||
${2:#}to ${3} # The real file you want to link to
|
||||
${4:#}link_type ${5:symbolic} # Either :symbolic or :hard
|
||||
${6:#}owner ${7} # The owner of the symlink
|
||||
${8:#}group ${9} # The group of the symlink
|
||||
|
||||
${10:#}${11:action :create} # Create a link (Default)
|
||||
${12:#}${0:action :delete} # Delete a link
|
||||
end
|
||||
|
||||
snippet package
|
||||
# Package resource
|
||||
package ${1:"package_name"} do # Name of the package to install
|
||||
${2:#}version ${3:nil} # The version of the package to install/upgrade
|
||||
${4:#}response_file ${5:nil} # An optional response file - used to pre-seed packages (note: the file is fetched by Remote File)
|
||||
${6:#}source ${7} # Used to provide an optional package source for providers that use a local file (rubygems, dpkg and rpm)
|
||||
${8:#}options ${9:nil} # Add additional options to the underlying package command
|
||||
${10:#}gem_binary ${11:gem} # A gem_package attribut to specify a gem binary. Useful for installing ruby 1.9 gems while running chef in ruby 1.8
|
||||
|
||||
${12:#}${13:action :install} # Install a package - if version is provided, install that specific version (Default)
|
||||
${14:#}${15:action :upgrade} # Upgrade a package - if version is provided, upgrade to that specific version
|
||||
${16:#}${17:action :remove} # Remove a package
|
||||
${18:#}${0:action :purge} # Purge a package (this usually entails removing configuration files as well as the package itself)
|
||||
end
|
||||
|
||||
snippet service
|
||||
# Service resource
|
||||
service ${1:"service_name"} do # Name of the service
|
||||
${2:#}enabled ${3:nil} # Whether the service is enabled at boot time
|
||||
${4:#}running ${5:nil} # Make sure the service is running. Start if stopped
|
||||
${6:#}pattern ${7} # Pattern to look for in the process table
|
||||
${8:#}start_command ${9:nil} # Command used to start this service
|
||||
${10:#}stop_command ${11:nil} # Command used to stop this service
|
||||
${12:#}status_command ${13:nil} # Command used to check the service run status
|
||||
${14:#}restart_command ${15:nil} # Command used to restart this service
|
||||
${16:#}reload_command ${17:nil} # Command used to tell this service to reload its configuration
|
||||
${18:#}supports ${19:false} # Features this service supports, ie :restart, :reload, :status
|
||||
|
||||
${20:#}${21:action :enable} # Enable this service
|
||||
${22:#}${23:action :disable} # Disable this service
|
||||
${24:#}${25:action :nothing} # Don't do anything with this service (Default)
|
||||
${26:#}${27:action :start} # Start this service
|
||||
${28:#}${29:action :stop} # Stop this service
|
||||
${30:#}${31:action :restart} # Restart this service
|
||||
${32:#}${0:action :reload} # Reload the configuration for this service
|
||||
end
|
||||
|
||||
snippet file
|
||||
# File resource
|
||||
file ${1:"/path/to/file"} do # Path to the file
|
||||
${2:#}backup ${3:5} # How many backups of this file to keep. Set to false if you want no backups.
|
||||
${4:#}owner ${5} # The owner for the file
|
||||
${6:#}group ${7} # The group owner of the file (string or id)
|
||||
${8:#}mode ${9} # The octal mode of the file (4-digit format)
|
||||
${10:#}content ${11:nil} # A string to write to the file. This will replace any previous content if set
|
||||
|
||||
${12:#}${13:action :create} # Create this file (Default)
|
||||
${14:#}${15:action :delete} # Delete this file
|
||||
${16:#}${0:action :touch} # Touch this file (update the mtime/atime)
|
||||
end
|
||||
|
||||
snippet directory
|
||||
# Directory resource
|
||||
directory ${1:"/path/to/dir"} do # The path to the directory
|
||||
${2:#}group ${3} # The group owner of the directory (string or id)
|
||||
${4:#}mode ${5} # The octal mode of the directory, eg 0755
|
||||
${6:#}owner ${7} # The owner for the directory
|
||||
${10:#}recursive ${11:false} # When deleting the directory, delete it recursively. When creating the directory, create recursively (ie, mkdir -p)
|
||||
|
||||
${12:#}${13:action :create} # Create this directory (Default)
|
||||
${14:#}${0:action :delete} # Delete this directory
|
||||
end
|
||||
|
||||
snippet template
|
||||
# Template resource
|
||||
template ${1:"/path/to/file"} do # Path to the file
|
||||
${2:#}cookbook ${3:nil} # Specify the cookbook where the template is located, default is current cookbook
|
||||
${4:#}source ${5:nil} # Template source file. Found in templates/default for the cookbook
|
||||
${6:#}variables ${7} # Variables to use in the template
|
||||
${8:#}local ${9:false} # Is the template already present on the node?
|
||||
${10:#}backup ${11:5} # How many backups of this file to keep. Set to false if you want no backups.
|
||||
${12:#}owner ${13} # The owner for the file
|
||||
${14:#}group ${15} # The group owner of the file (string or id)
|
||||
${16:#}mode ${17} # The octal mode of the file (4-digit format)
|
||||
${18:#}content ${19:nil} # A string to write to the file. This will replace any previous content if set
|
||||
|
||||
${20:#}${21:action :create} # Create the file (Default)
|
||||
${22:#}${23:action :delete} # Delete this file
|
||||
${24:#}${0:action :touch} # Touch this file (update the mtime/atime)
|
||||
end
|
||||
|
||||
snippet svn
|
||||
# SCM Resource, Chef::Provider::Subversion
|
||||
svn ${1:"/destination/path"} do # Path to clone/checkout/export the source to
|
||||
${2:#}repository ${3} # URI of the repository
|
||||
${4:#}revision ${5:"HEAD"} # revision to checkout. can be symbolic, like "HEAD" or an SCM specific revision id
|
||||
${6:#}reference ${7} # (Git only) alias for revision
|
||||
${8:#}user ${9:nil} # System user to own the checked out code
|
||||
${10:#}group ${11:nil} # System group to own the checked out code
|
||||
${12:#}svn_username ${13} # (Subversion only) Username for Subversion operations
|
||||
${14:#}svn_password ${15} # (Subversion only) Password for Subversion operations
|
||||
${16:#}svn_arguments ${17} # (Subversion only) Extra arguments passed to the subversion command
|
||||
|
||||
${18:#}${19:action :sync} # Update the source to the specified revision, or get a new checkout (Default)
|
||||
${20:#}${21:action :checkout} # Checkout the source. Does nothing if a checkout is available
|
||||
${22:#}${0:action :export} # Export the source, excluding or removing any version control artifacts
|
||||
end
|
||||
|
||||
snippet git
|
||||
# SCM Resource, Chef::Provider::Git
|
||||
git ${1:"/destination/path"} do # Path to clone/checkout/export the source to
|
||||
${2:#}repository ${3} # URI of the repository
|
||||
${4:#}revision ${5:"HEAD"} # revision to checkout. can be symbolic, like "HEAD" or an SCM specific revision id
|
||||
${6:#}reference ${7} # (Git only) alias for revision
|
||||
${8:#}user ${9:nil} # System user to own the checked out code
|
||||
${10:#}group ${11:nil} # System group to own the checked out code
|
||||
${12:#}depth ${13:nil} # (Git only) Number of past revisions to include in Git shallow clone
|
||||
${14:#}enable_submodules ${15:"false"} # (Git only) performs a submodule init and submodule update
|
||||
${16:#}remote ${17:"origin"} # (Git only) remote repository to use for syncing an existing clone
|
||||
${18:#}ssh_wrapper ${19} # (Git only) path to a wrapper script for running SSH with git. GIT_SSH environment variable is set to this.
|
||||
|
||||
${20:#}${21:action :sync} # Update the source to the specified revision, or get a new clone (Default)
|
||||
${22:#}${23:action :checkout} # Clone the source. Does nothing if a checkout is available
|
||||
${24:#}${0:action :export} # Export the source, excluding or removing any version control artifacts
|
||||
end
|
||||
|
||||
snippet deploy
|
||||
# Deploy resource
|
||||
deploy ${1:"/deploy/dir/"} do # Path to deploy to
|
||||
${2:#}deploy_to ${3} # The "meta root" for your application.
|
||||
${4:#}repository ${5} # URI of the repository
|
||||
${6:#}repo ${7} # alias for repository
|
||||
${8:#}revision ${9:"HEAD"} # revision to checkout. can be symbolic, like "HEAD" or an SCM specific revision id
|
||||
${10:#}branch ${11} # alias for revision
|
||||
${12:#}user ${13:nil} # System user to run the deploy as
|
||||
${14:#}group ${15:nil} # System group to run the deploy as
|
||||
${16:#}svn_username ${17} # (Subversion only) Username for Subversion operations}
|
||||
${18:#}svn_password ${19} # (Subversion only) Password for Subversion operations}
|
||||
${20:#}svn_arguments ${21} # (Subversion only) Extra arguments passed to the subversion command}
|
||||
${22:#}shallow_clone ${23:nil} # (Git only) boolean, true sets clone depth to 5
|
||||
${24:#}enable_submodules ${25:false} # (Git only) performs a submodule init and submodule update
|
||||
${26:#}remote ${27:"origin"} # (Git only) remote repository to use for syncing an existing clone
|
||||
${28:#}ssh_wrapper ${29} # (Git only) path to a wrapper script for running SSH with git. GIT_SSH environment variable is set to this.
|
||||
${30:#}git_ssh_wrapper ${31} # alias for ssh_wrapper
|
||||
${32:#}scm_provider ${33:Chef::Provider::Git} # SCM Provider to use.
|
||||
${34:#}repository_cache ${35: "cached-copy"} # Name of the subdirectory where the pristine copy of your app's source is kept
|
||||
${36:#}environment ${37} # A hash of the form {"ENV_VARIABLE"=>"VALUE"}}
|
||||
${38:#}purge_before_symlink ${39:%w(log tmp/pids public/system)} # An array of paths, relative to app root, to be removed from a checkout before symlinking
|
||||
${40:#}create_dirs_before_symlink ${41:%w(tmp public config)} # Directories to create before symlinking. Runs after purge_before_symlink
|
||||
${42:#}symlinks ${43:"system" => "public/system", "pids" => "tmp/pids", "log" => "log"} # A hash that maps files in the shared directory to their paths in the current release
|
||||
${44:#}symlink_before_migrate ${45:"config/database.yml" => "config/database.yml"} # A hash that maps files in the shared directory into the current release. Runs before migration
|
||||
${46:#}migrate ${47:false} # Should the migration command be executed? (true or false)
|
||||
${48:#}migration_command ${49} # A string containing a shell command to execute to run the migration
|
||||
${50:#}restart_command ${51:nil} # A code block to evaluate or a string containing a shell command
|
||||
${52:#}before_migrate ${53:"deploy/before_migrate.rb"} # A block or path to a file containing chef code to run before migrating
|
||||
${54:#}before_symlink ${55:"deploy/before_symlink.rb"} # A block or path to a file containing chef code to run before symlinking
|
||||
${56:#}before_restart ${57:"deploy/before_restart.rb"} # A block or path to a file containing chef code to run before restarting
|
||||
${58:#}after_restart ${59:"deploy/after_restart.rb"} # A block or path to a file containing chef code to run after restarting
|
||||
|
||||
${60:#}${61::deploy} # Deploy the application (Default)
|
||||
${62:#}${63::force_deploy} # For the revision deploy strategy, this removes any existing release of the same code version and re-deploys in its place
|
||||
${64:#}${0::rollback} # Rollback the application to the previous release
|
||||
end
|
90
bundle/vim-snippets/snippets/clojure.snippets
Normal file
90
bundle/vim-snippets/snippets/clojure.snippets
Normal file
@ -0,0 +1,90 @@
|
||||
snippet comm
|
||||
(comment
|
||||
${0}
|
||||
)
|
||||
snippet condp
|
||||
(condp ${1:pred} ${2:expr}
|
||||
${0})
|
||||
snippet def
|
||||
(def ${0})
|
||||
snippet defm
|
||||
(defmethod ${1:multifn} "${2:doc-string}" ${3:dispatch-val} [${4:args}]
|
||||
${0})
|
||||
snippet defmm
|
||||
(defmulti ${1:name} "${2:doc-string}" ${0:dispatch-fn})
|
||||
snippet defma
|
||||
(defmacro ${1:name} "${2:doc-string}" ${0:dispatch-fn})
|
||||
snippet defn
|
||||
(defn ${1:name} "${2:doc-string}" [${3:arg-list}]
|
||||
${0})
|
||||
snippet defp
|
||||
(defprotocol ${1:name}
|
||||
${0})
|
||||
snippet defr
|
||||
(defrecord ${1:name} [${2:fields}]
|
||||
${3:protocol}
|
||||
${0})
|
||||
snippet deft
|
||||
(deftest ${1:name}
|
||||
(is (= ${2:assertion})))
|
||||
${0})
|
||||
snippet is
|
||||
(is (= ${1} ${0}))
|
||||
snippet defty
|
||||
(deftype ${1:Name} [${2:fields}]
|
||||
${3:Protocol}
|
||||
${0})
|
||||
snippet doseq
|
||||
(doseq [${1:elem} ${2:coll}]
|
||||
${0})
|
||||
snippet fn
|
||||
(fn [${1:arg-list}] ${0})
|
||||
snippet if
|
||||
(if ${1:test-expr}
|
||||
${2:then-expr}
|
||||
${0:else-expr})
|
||||
snippet if-let
|
||||
(if-let [${1:result} ${2:test-expr}]
|
||||
(${3:then-expr} $1)
|
||||
(${0:else-expr}))
|
||||
snippet imp
|
||||
(:import [${1:package}])
|
||||
& {:keys [${1:keys}] :or {${0:defaults}}}
|
||||
snippet let
|
||||
(let [${1:name} ${2:expr}]
|
||||
${0})
|
||||
snippet letfn
|
||||
(letfn [(${1:name) [${2:args}]
|
||||
${0})])
|
||||
snippet map
|
||||
(map ${1:func} ${0:coll})
|
||||
snippet mapl
|
||||
(map #(${1:lambda}) ${0:coll})
|
||||
snippet met
|
||||
(${1:name} [${2:this} ${3:args}]
|
||||
${0})
|
||||
snippet ns
|
||||
(ns ${1:name}
|
||||
${0})
|
||||
snippet dotimes
|
||||
(dotimes [_ 10]
|
||||
(time
|
||||
(dotimes [_ ${1:times}]
|
||||
${0})))
|
||||
snippet pmethod
|
||||
(${1:name} [${2:this} ${0:args}])
|
||||
snippet refer
|
||||
(:refer-clojure :exclude [${0}])
|
||||
snippet require
|
||||
(:require [${1:namespace} :as [${0}]])
|
||||
snippet use
|
||||
(:use [${1:namespace} :only [${0}]])
|
||||
snippet print
|
||||
(println ${0})
|
||||
snippet reduce
|
||||
(reduce ${1:(fn [p n] ${3})} ${2})
|
||||
snippet when
|
||||
(when ${1:test} ${0:body})
|
||||
snippet when-let
|
||||
(when-let [${1:result} ${2:test}]
|
||||
${0:body})
|
58
bundle/vim-snippets/snippets/cmake.snippets
Normal file
58
bundle/vim-snippets/snippets/cmake.snippets
Normal file
@ -0,0 +1,58 @@
|
||||
snippet cmake
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
PROJECT(${1:ProjectName})
|
||||
|
||||
FIND_PACKAGE(${2:LIBRARY})
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${$2_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
ADD_SUBDIRECTORY(${0:src})
|
||||
|
||||
ADD_EXECUTABLE($1)
|
||||
|
||||
TARGET_LINK_LIBRARIES($1
|
||||
${$2_LIBRARIES}
|
||||
)
|
||||
|
||||
snippet include
|
||||
INCLUDE_DIRECTORIES(
|
||||
${${0:INCLUDE_DIR}}
|
||||
)
|
||||
|
||||
snippet find
|
||||
FIND_PACKAGE(${0:LIBRARY})
|
||||
|
||||
snippet glob
|
||||
FILE(GLOB ${1:SRCS} *.${0:cpp})
|
||||
|
||||
snippet subdir
|
||||
ADD_SUBDIRECTORY(${0:src})
|
||||
|
||||
snippet lib
|
||||
ADD_LIBRARY(${1:lib} ${2:STATIC}
|
||||
${${0:SRCS}}
|
||||
)
|
||||
|
||||
snippet link
|
||||
TARGET_LINK_LIBRARIES(${1:bin}
|
||||
${0:somelib}
|
||||
)
|
||||
|
||||
snippet bin
|
||||
ADD_EXECUTABLE(${1:bin})
|
||||
|
||||
snippet set
|
||||
SET(${1:var} ${0:val})
|
||||
|
||||
snippet dep
|
||||
ADD_DEPENDENCIES(${1:target}
|
||||
${0:dep}
|
||||
)
|
||||
|
||||
snippet props
|
||||
SET_TARGET_PROPERTIES(${1:target}
|
||||
${2:PROPERTIES} ${3:COMPILE_FLAGS}
|
||||
${0:"-O3 -Wall -pedantic"}
|
||||
)
|
116
bundle/vim-snippets/snippets/coffee/angular_coffee.snippets
Normal file
116
bundle/vim-snippets/snippets/coffee/angular_coffee.snippets
Normal file
@ -0,0 +1,116 @@
|
||||
## Global Snippets
|
||||
# Define a new Angular Controller;
|
||||
# You can change the controller name and parameters
|
||||
snippet ngc
|
||||
${1:controllerName} = (${2:scope}, ${3:injectables}) ->
|
||||
${4}
|
||||
# angular.foreach loop
|
||||
snippet ngfor
|
||||
angular.forEach ${1:iterateOver}, (value, key) ->
|
||||
${2}
|
||||
## Module Based Snippets
|
||||
# A new angular module without a config function
|
||||
snippet ngm
|
||||
angular.module '${1:moduleName}', [${2:moduleDependencies}]
|
||||
${3}
|
||||
# A new angular module without a config function and a variable assignment
|
||||
snippet ngma
|
||||
${1:moduleName} = angular.module '$1', [${2:moduleDeps}]
|
||||
${3}
|
||||
# A new angular module with a config function
|
||||
snippet ngmc
|
||||
${1:moduleName} = angular.module('$1', [${2:moduleDeps}], (${3:configDeps}) ->
|
||||
${4}
|
||||
)
|
||||
# A factory in a module
|
||||
snippet ngmfa
|
||||
factory '${1:factoryName}', (${2:dependencies}) ->
|
||||
${3}
|
||||
# Define an Angular Module Service to be attached to a previously defined module
|
||||
# You can change the service name and service injectables
|
||||
snippet ngms
|
||||
service '${1:serviceName}', (${2:injectables}) ->
|
||||
${3}
|
||||
# Define an Angular Module Filter to be attached to a previously defined module
|
||||
# You can change the filter name
|
||||
snippet ngmfi
|
||||
filter '${1:filterName}', (${2:injectables}) ->
|
||||
(input, ${3:args}) ->
|
||||
${4}
|
||||
## Route Based Snippets
|
||||
# Defines a when condition of an AngularJS route
|
||||
snippet ngrw
|
||||
$routeProvider.when '${1:url}',
|
||||
templateUrl: '${2:templateUrl}'
|
||||
controller: '${3:controller}'
|
||||
${4}
|
||||
# Defines a when condition of an AngularJS route with the resolve block
|
||||
snippet ngrwr
|
||||
$routeProvider.when '${1:url}',
|
||||
templateUrl: '${2:templateUrl}'
|
||||
controller: '${3:controller}'
|
||||
resolve:
|
||||
${4}
|
||||
${5}
|
||||
# Defines an otherwise condition of an AngularJS route
|
||||
snippet ngro
|
||||
$routeProvider.otherwise redirectTo: '${1:url}'
|
||||
${2}
|
||||
## Scope Related Snippets
|
||||
# Define a new $scope'd function (usually inside an AngularJS Controller)
|
||||
# You can change the function name and arguments
|
||||
snippet $f
|
||||
$scope.${1:functionName} = (${2:args}) ->
|
||||
${3}
|
||||
# Defines a new $scope'd variable inside an AngularJS controller
|
||||
snippet $v
|
||||
$scope.${1:variable} = ${2:value}
|
||||
${3}
|
||||
# Defines a new $scope'd variable inside an AngularJS controller and assigns a value from a constructor arguments
|
||||
snippet $va
|
||||
$scope.${1:variable} = ${2:variable}
|
||||
${3}
|
||||
# Define a $watch for an expression
|
||||
# You can change the expression to be watched
|
||||
snippet $w
|
||||
$scope.$watch '${1:watchExpr}', (newValue, oldValue) ->
|
||||
${2}
|
||||
# Define a $on for a $broadcast/$emit on the $scope inside an Angular Controller
|
||||
# You can change the event name to listen on
|
||||
snippet $on
|
||||
$scope.$on '${1:eventName}', (event, ${2:args}) ->
|
||||
${3}
|
||||
# Define a $broadcast for a $scope inside an Angular Controller / Angular Controller Function
|
||||
# You can change the event name and optional event arguments
|
||||
snippet $b
|
||||
$scope.$broadcast '${1:eventName}', ${2:eventArgs}
|
||||
${3}
|
||||
# Define an $emit for a $scope inside an Angular Controller / Angular Controller Function
|
||||
# You can change the event name and optional event arguments
|
||||
snippet $e
|
||||
$scope.$emit '${1:eventName}', ${2:eventArgs}
|
||||
${3}
|
||||
## Directive related snippets
|
||||
# A compile function
|
||||
snippet ngdcf
|
||||
compile = (tElement, tAttrs, transclude) ->
|
||||
(scope, element, attrs) ->
|
||||
${1}
|
||||
# A linking function in a directive
|
||||
snippet ngdlf
|
||||
(scope, element, attrs${1:ctrl}) ->
|
||||
${2}
|
||||
# A directive with a compile function
|
||||
snippet ngdc
|
||||
directive '${1:directiveName}', factory = (${2:injectables}) ->
|
||||
directiveDefinitionObject =
|
||||
${3:directiveAttrs}
|
||||
compile: compile = (tElement, tAttrs, transclude) ->
|
||||
(scope, element, attrs) ->
|
||||
directiveDefinitionObject
|
||||
# A directive with a linking function only
|
||||
snippet ngdl
|
||||
.directive('${1:directiveName}', (${2:directiveDeps}) ->
|
||||
(scope, element, attrs${3:ctrl}) ->
|
||||
${4}
|
||||
)
|
101
bundle/vim-snippets/snippets/coffee/coffee.snippets
Normal file
101
bundle/vim-snippets/snippets/coffee/coffee.snippets
Normal file
@ -0,0 +1,101 @@
|
||||
# Closure loop
|
||||
snippet forindo
|
||||
for ${1:name} in ${2:array}
|
||||
do ($1) ->
|
||||
${0:// body}
|
||||
# Array comprehension
|
||||
snippet fora
|
||||
for ${1:name} in ${2:array}
|
||||
${0:# body...}
|
||||
# Object comprehension
|
||||
snippet foro
|
||||
for ${1:key}, ${2:value} of ${3:object}
|
||||
${0:# body...}
|
||||
# Range comprehension (inclusive)
|
||||
snippet forr
|
||||
for ${1:name} in [${2:start}..${3:finish}]
|
||||
${0:# body...}
|
||||
snippet forrb
|
||||
for ${1:name} in [${2:start}..${3:finish}] by ${4:step}
|
||||
${0:# body...}
|
||||
# Range comprehension (exclusive)
|
||||
snippet forrex
|
||||
for ${1:name} in [${2:start}...${3:finish}]
|
||||
${0:# body...}
|
||||
snippet forrexb
|
||||
for ${1:name} in [${2:start}...${3:finish}] by ${4:step}
|
||||
${0:# body...}
|
||||
# Function
|
||||
snippet fun
|
||||
(${1:args}) ->
|
||||
${0:# body...}
|
||||
# Function (bound)
|
||||
snippet bfun
|
||||
(${1:args}) =>
|
||||
${0:# body...}
|
||||
# Class
|
||||
snippet cla class ..
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
${0}
|
||||
snippet cla class .. constructor: ..
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
constructor: (${2:args}) ->
|
||||
${3}
|
||||
|
||||
${0}
|
||||
snippet cla class .. extends ..
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
|
||||
${0}
|
||||
snippet cla class .. extends .. constructor: ..
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
|
||||
constructor: (${3:args}) ->
|
||||
${4}
|
||||
|
||||
${0}
|
||||
# If
|
||||
snippet if
|
||||
if ${1:condition}
|
||||
${0:# body...}
|
||||
# If __ Else
|
||||
snippet ife
|
||||
if ${1:condition}
|
||||
${2:# body...}
|
||||
else
|
||||
${0:# body...}
|
||||
# Else if
|
||||
snippet eif
|
||||
else if ${1:condition}
|
||||
${0:# body...}
|
||||
# Ternary If
|
||||
snippet ifte
|
||||
if ${1:condition} then ${2:value} else ${0:other}
|
||||
# Unless
|
||||
snippet unl
|
||||
${1:action} unless ${0:condition}
|
||||
# Switch
|
||||
snippet swi
|
||||
switch ${1:object}
|
||||
when ${2:value}
|
||||
${0:# body...}
|
||||
|
||||
# Log
|
||||
snippet log
|
||||
console.log ${0}
|
||||
# Try __ Catch
|
||||
snippet try
|
||||
try
|
||||
${1}
|
||||
catch ${2:error}
|
||||
${0}
|
||||
# Require
|
||||
snippet req
|
||||
${2:$1} = require '${1:sys}'
|
||||
# Export
|
||||
snippet exp
|
||||
${0:root} = exports ? this
|
||||
|
||||
snippet jsonp
|
||||
JSON.parse ${0:jstr}
|
||||
# JSON.stringify
|
||||
snippet jsons
|
||||
JSON.stringify ${0:object}
|
524
bundle/vim-snippets/snippets/coffee/jquery_coffee.snippets
Normal file
524
bundle/vim-snippets/snippets/coffee/jquery_coffee.snippets
Normal file
@ -0,0 +1,524 @@
|
||||
snippet add
|
||||
${1:obj}.add('${2:selector expression}')
|
||||
snippet addClass
|
||||
${1:obj}.addClass('${2:class name}')
|
||||
snippet after
|
||||
${1:obj}.after('${2:Some text <b>and bold!</b>}')
|
||||
snippet ajax
|
||||
$.ajax
|
||||
url: "${1:mydomain.com/url}"
|
||||
type: "${2:POST}"
|
||||
dataType: "${3:xml/html/script/json}"
|
||||
data: ${4:data}
|
||||
complete: (jqXHR, textStatus) ->
|
||||
${5:// callback}
|
||||
success: (data, textStatus, jqXHR) ->
|
||||
${6:// success callback}
|
||||
error: (jqXHR, textStatus, errorThrown) ->
|
||||
${0:// error callback}
|
||||
snippet ajaxcomplete
|
||||
${1:obj}.ajaxComplete (${1:e}, xhr, settings) ->
|
||||
${0:// callback}
|
||||
snippet ajaxerror
|
||||
${1:obj}.ajaxError (${1:e}, xhr, settings, thrownError) ->
|
||||
${2:// error callback}
|
||||
${0}
|
||||
snippet ajaxget
|
||||
$.get '${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
(data, textStatus, jqXHR) ->
|
||||
${0:// success callback}
|
||||
snippet ajaxpost
|
||||
$.post '${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
(data, textStatus, jqXHR) ->
|
||||
${0:// success callback}
|
||||
snippet ajaxprefilter
|
||||
$.ajaxPrefilter (${1:options}, ${2:originalOptions}, jqXHR) ->
|
||||
${0: // Modify options, control originalOptions, store jqXHR, etc}
|
||||
snippet ajaxsend
|
||||
${1:obj}.ajaxSend (${1:request, settings}) ->
|
||||
${2:// error callback}
|
||||
${0}
|
||||
snippet ajaxsetup
|
||||
$.ajaxSetup({
|
||||
url: "${1:mydomain.com/url}",
|
||||
type: "${2:POST}",
|
||||
dataType: "${3:xml/html/script/json}",
|
||||
data: $.param( $("${4:Element or Expression}") ),
|
||||
complete: (jqXHR, textStatus) ->
|
||||
${5:// callback}
|
||||
,
|
||||
success: (data, textStatus, jqXHR) ->
|
||||
${6:// success callback}
|
||||
,
|
||||
error: (jqXHR, textStatus, errorThrown) ->
|
||||
${0:// error callback}
|
||||
})
|
||||
snippet ajaxstart
|
||||
$.ajaxStart ->
|
||||
${1:// handler for when an AJAX call is started and no other AJAX calls are in progress}
|
||||
${0}
|
||||
snippet ajaxstop
|
||||
$.ajaxStop ->
|
||||
${1:// handler for when all AJAX calls have been completed}
|
||||
${0}
|
||||
snippet ajaxsuccess
|
||||
$.ajaxSuccess (${1:e}, xhr, settings) ->
|
||||
${2:// handler for when any AJAX call is successfully completed}
|
||||
${0}
|
||||
snippet andself
|
||||
${1:obj}.andSelf()
|
||||
snippet animate
|
||||
${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed})
|
||||
snippet append
|
||||
${1:obj}.append('${2:Some text <b>and bold!</b>}')
|
||||
snippet appendTo
|
||||
${1:obj}.appendTo('${2:selector expression}')
|
||||
snippet attr
|
||||
${1:obj}.attr('${2:attribute}', '${3:value}')
|
||||
snippet attrm
|
||||
${1:obj}.attr({'${2:attr1}': '${3:value1}', '${4:attr2}': '${5:value2}'})
|
||||
snippet before
|
||||
${1:obj}.before('${2:Some text <b>and bold!</b>}')
|
||||
snippet bind
|
||||
${1:obj}.bind('${2:event name}', (${3:e}) ->
|
||||
${0:// event handler}
|
||||
snippet blur
|
||||
${1:obj}.blur (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet C
|
||||
$.Callbacks()
|
||||
snippet Cadd
|
||||
${1:callbacks}.add(${2:callbacks})
|
||||
snippet Cdis
|
||||
${1:callbacks}.disable()
|
||||
snippet Cempty
|
||||
${1:callbacks}.empty()
|
||||
snippet Cfire
|
||||
${1:callbacks}.fire(${2:args})
|
||||
snippet Cfired
|
||||
${1:callbacks}.fired()
|
||||
snippet Cfirew
|
||||
${1:callbacks}.fireWith(${2:this}, ${3:args})
|
||||
snippet Chas
|
||||
${1:callbacks}.has(${2:callback})
|
||||
snippet Clock
|
||||
${1:callbacks}.lock()
|
||||
snippet Clocked
|
||||
${1:callbacks}.locked()
|
||||
snippet Crem
|
||||
${1:callbacks}.remove(${2:callbacks})
|
||||
snippet change
|
||||
${1:obj}.change (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet children
|
||||
${1:obj}.children('${2:selector expression}')
|
||||
snippet clearq
|
||||
${1:obj}.clearQueue(${2:'queue name'})
|
||||
snippet click
|
||||
${1:obj}.click (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet clone
|
||||
${1:obj}.clone()
|
||||
snippet contains
|
||||
$.contains(${1:container}, ${0:contents})
|
||||
snippet css
|
||||
${1:obj}.css('${2:attribute}', '${3:value}')
|
||||
snippet csshooks
|
||||
$.cssHooks['${1:CSS prop}'] = {
|
||||
get: (elem, computed, extra) ->
|
||||
${2: // handle getting the CSS property}
|
||||
set: (elem, value) ->
|
||||
${0: // handle setting the CSS value}
|
||||
}
|
||||
snippet cssm
|
||||
${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'})
|
||||
snippet D
|
||||
$.Deferred()
|
||||
snippet Dalways
|
||||
${1:deferred}.always(${2:callbacks})
|
||||
snippet Ddone
|
||||
${1:deferred}.done(${2:callbacks})
|
||||
snippet Dfail
|
||||
${1:deferred}.fail(${2:callbacks})
|
||||
snippet Disrej
|
||||
${1:deferred}.isRejected()
|
||||
snippet Disres
|
||||
${1:deferred}.isResolved()
|
||||
snippet Dnotify
|
||||
${1:deferred}.notify(${2:args})
|
||||
snippet Dnotifyw
|
||||
${1:deferred}.notifyWith(${2:this}, ${3:args})
|
||||
snippet Dpipe
|
||||
${1:deferred}.then(${2:doneFilter}, ${3:failFilter}, ${4:progressFilter})
|
||||
snippet Dprog
|
||||
${1:deferred}.progress(${2:callbacks})
|
||||
snippet Dprom
|
||||
${1:deferred}.promise(${2:target})
|
||||
snippet Drej
|
||||
${1:deferred}.reject(${2:args})
|
||||
snippet Drejw
|
||||
${1:deferred}.rejectWith(${2:this}, ${3:args})
|
||||
snippet Dres
|
||||
${1:deferred}.resolve(${2:args})
|
||||
snippet Dresw
|
||||
${1:deferred}.resolveWith(${2:this}, ${3:args})
|
||||
snippet Dstate
|
||||
${1:deferred}.state()
|
||||
snippet Dthen
|
||||
${1:deferred}.then(${2:doneCallbacks}, ${3:failCallbacks}, ${4:progressCallbacks})
|
||||
snippet Dwhen
|
||||
$.when(${1:deferreds})
|
||||
snippet data
|
||||
${1:obj}.data(${2:obj})
|
||||
snippet dataa
|
||||
$.data('${1:selector expression}', '${2:key}'${3:, 'value'})
|
||||
snippet dblclick
|
||||
${1:obj}.dblclick (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet delay
|
||||
${1:obj}.delay('${2:slow/400/fast}'${3:, 'queue name'})
|
||||
snippet dele
|
||||
${1:obj}.delegate '${2:selector expression}', '${3:event name}', (${4:e}) ->
|
||||
${0:// event handler}
|
||||
snippet deq
|
||||
${1:obj}.dequeue(${2:'queue name'})
|
||||
snippet deqq
|
||||
$.dequeue('${1:selector expression}'${2:, 'queue name'})
|
||||
snippet detach
|
||||
${1:obj}.detach('${2:selector expression}')
|
||||
snippet die
|
||||
${1:obj}.die(${2:event}, ${3:handler})
|
||||
snippet each
|
||||
${1:obj}.each (index) ->
|
||||
${0:this.innerHTML = this + " is the element, " + index + " is the position"}
|
||||
snippet el
|
||||
$('<${1}/>'${2:, {}})
|
||||
snippet eltrim
|
||||
$.trim('${1:string}')
|
||||
snippet empty
|
||||
${1:obj}.empty()
|
||||
snippet end
|
||||
${1:obj}.end()
|
||||
snippet eq
|
||||
${1:obj}.eq(${2:element index})
|
||||
snippet error
|
||||
${1:obj}.error (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet eventsmap
|
||||
{
|
||||
:f${0}
|
||||
}
|
||||
snippet extend
|
||||
$.extend(${1:true, }${2:target}, ${3:obj})
|
||||
snippet fadein
|
||||
${1:obj}.fadeIn('${2:slow/400/fast}')
|
||||
snippet fadeinc
|
||||
${1:obj}.fadeIn 'slow/400/fast', ->
|
||||
${0:// callback}
|
||||
snippet fadeout
|
||||
${1:obj}.fadeOut('${2:slow/400/fast}')
|
||||
snippet fadeoutc
|
||||
${1:obj}.fadeOut 'slow/400/fast', ->
|
||||
${0:// callback}
|
||||
snippet fadeto
|
||||
${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5})
|
||||
snippet fadetoc
|
||||
${1:obj}.fadeTo 'slow/400/fast', ${2:0.5}, ->
|
||||
${0:// callback}
|
||||
snippet filter
|
||||
${1:obj}.filter('${2:selector expression}')
|
||||
snippet filtert
|
||||
${1:obj}.filter (${2:index}) ->
|
||||
${3}
|
||||
snippet find
|
||||
${1:obj}.find('${2:selector expression}')
|
||||
snippet focus
|
||||
${1:obj}.focus (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet focusin
|
||||
${1:obj}.focusIn (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet focusout
|
||||
${1:obj}.focusOut (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet get
|
||||
${1:obj}.get(${2:element index})
|
||||
snippet getjson
|
||||
$.getJSON '${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
(data, textStatus, jqXHR) ->
|
||||
${0:// success callback}
|
||||
snippet getscript
|
||||
$.getScript '${1:mydomain.com/url}', (script, textStatus, jqXHR) ->
|
||||
${0:// callback}
|
||||
snippet grep
|
||||
$.grep(${1:array}, (item, index) >
|
||||
${2}
|
||||
${0:, true})
|
||||
snippet hasc
|
||||
${1:obj}.hasClass('${2:className}')
|
||||
snippet hasd
|
||||
$.hasData('${0:selector expression}')
|
||||
snippet height
|
||||
${1:obj}.height(${2:integer})
|
||||
snippet hide
|
||||
${1:obj}.hide('${2:slow/400/fast}')
|
||||
snippet hidec
|
||||
${1:obj}.hide '${2:slow/400/fast}', ->
|
||||
${0:// callback}
|
||||
snippet hover
|
||||
${1:obj}.hover (${2:e}) ->
|
||||
${3:// event handler}
|
||||
, ($2) ->
|
||||
${4:// event handler}
|
||||
snippet html
|
||||
${1:obj}.html('${2:Some text <b>and bold!</b>}')
|
||||
snippet inarr
|
||||
$.inArray(${1:value}, ${0:array})
|
||||
snippet insa
|
||||
${1:obj}.insertAfter('${2:selector expression}')
|
||||
snippet insb
|
||||
${1:obj}.insertBefore('${2:selector expression}')
|
||||
snippet is
|
||||
${1:obj}.is('${2:selector expression}')
|
||||
snippet isarr
|
||||
$.isArray(${1:obj})
|
||||
snippet isempty
|
||||
$.isEmptyObject(${1:obj})
|
||||
snippet isfunc
|
||||
$.isFunction(${1:obj})
|
||||
snippet isnum
|
||||
$.isNumeric(${1:value})
|
||||
snippet isobj
|
||||
$.isPlainObject(${1:obj})
|
||||
snippet iswin
|
||||
$.isWindow(${1:obj})
|
||||
snippet isxml
|
||||
$.isXMLDoc(${1:node})
|
||||
snippet jj
|
||||
$('${1:selector}')
|
||||
snippet kdown
|
||||
${1:obj}.keydown (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet kpress
|
||||
${1:obj}.keypress (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet kup
|
||||
${1:obj}.keyup (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet last
|
||||
${1:obj}.last('${1:selector expression}')
|
||||
snippet live
|
||||
${1:obj}.live '${2:events}', (${3:e}) ->
|
||||
${0:// event handler}
|
||||
snippet load
|
||||
${1:obj}.load (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet loadf
|
||||
${1:obj}.load('${2:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
(responseText, textStatus, xhr) ->
|
||||
${0:// success callback}
|
||||
})
|
||||
snippet makearray
|
||||
$.makeArray(${0:obj})
|
||||
snippet map
|
||||
${1:obj}.map (${2:index}, ${3:element}) ->
|
||||
${0:// callback}
|
||||
snippet mapp
|
||||
$.map ${1:arrayOrObject}, (${2:value}, ${3:indexOrKey}) ->
|
||||
${0:// callback}
|
||||
snippet merge
|
||||
$.merge(${1:target}, ${0:original})
|
||||
snippet mdown
|
||||
${1:obj}.mousedown (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet menter
|
||||
${1:obj}.mouseenter (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mleave
|
||||
${1:obj}.mouseleave (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mmove
|
||||
${1:obj}.mousemove (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mout
|
||||
${1:obj}.mouseout (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mover
|
||||
${1:obj}.mouseover (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet mup
|
||||
${1:obj}.mouseup (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet next
|
||||
${1:obj}.next('${2:selector expression}')
|
||||
snippet nexta
|
||||
${1:obj}.nextAll('${2:selector expression}')
|
||||
snippet nextu
|
||||
${1:obj}.nextUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet not
|
||||
${1:obj}.not('${2:selector expression}')
|
||||
snippet off
|
||||
${1:obj}.off('${2:events}', '${3:selector expression}'${4:, handler})
|
||||
snippet offset
|
||||
${1:obj}.offset()
|
||||
snippet offsetp
|
||||
${1:obj}.offsetParent()
|
||||
snippet on
|
||||
${1:obj}.on '${2:events}', '${3:selector expression}', (${4:e}) ->
|
||||
${0:// event handler}
|
||||
snippet one
|
||||
${1:obj}.one '${2:event name}', (${3:e}) ->
|
||||
${0:// event handler}
|
||||
snippet outerh
|
||||
${1:obj}.outerHeight()
|
||||
snippet outerw
|
||||
${1:obj}.outerWidth()
|
||||
snippet param
|
||||
$.param(${1:obj})
|
||||
snippet parent
|
||||
${1:obj}.parent('${2:selector expression}')
|
||||
snippet parents
|
||||
${1:obj}.parents('${2:selector expression}')
|
||||
snippet parentsu
|
||||
${1:obj}.parentsUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet parsejson
|
||||
$.parseJSON(${1:data})
|
||||
snippet parsexml
|
||||
$.parseXML(${1:data})
|
||||
snippet pos
|
||||
${1:obj}.position()
|
||||
snippet prepend
|
||||
${1:obj}.prepend('${2:Some text <b>and bold!</b>}')
|
||||
snippet prependto
|
||||
${1:obj}.prependTo('${2:selector expression}')
|
||||
snippet prev
|
||||
${1:obj}.prev('${2:selector expression}')
|
||||
snippet preva
|
||||
${1:obj}.prevAll('${2:selector expression}')
|
||||
snippet prevu
|
||||
${1:obj}.prevUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet promise
|
||||
${1:obj}.promise(${2:'fx'}, ${3:target})
|
||||
snippet prop
|
||||
${1:obj}.prop('${2:property name}')
|
||||
snippet proxy
|
||||
$.proxy(${1:function}, ${2:this})
|
||||
snippet pushstack
|
||||
${1:obj}.pushStack(${2:elements})
|
||||
snippet queue
|
||||
${1:obj}.queue(${2:name}${3:, newQueue})
|
||||
snippet queuee
|
||||
$.queue(${1:element}${2:, name}${3:, newQueue})
|
||||
snippet ready
|
||||
$(() ->
|
||||
${0}
|
||||
)
|
||||
snippet rem
|
||||
${1:obj}.remove()
|
||||
snippet rema
|
||||
${1:obj}.removeAttr('${2:attribute name}')
|
||||
snippet remc
|
||||
${1:obj}.removeClass('${2:class name}')
|
||||
snippet remd
|
||||
${1:obj}.removeData('${2:key name}')
|
||||
snippet remdd
|
||||
$.removeData(${1:element}${2:, 'key name}')
|
||||
snippet remp
|
||||
${1:obj}.removeProp('${2:property name}')
|
||||
snippet repa
|
||||
${1:obj}.replaceAll(${2:target})
|
||||
snippet repw
|
||||
${1:obj}.replaceWith(${2:content})
|
||||
snippet reset
|
||||
${1:obj}.reset (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet resize
|
||||
${1:obj}.resize (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet scroll
|
||||
${1:obj}.scroll (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet scrolll
|
||||
${1:obj}.scrollLeft(${2:value})
|
||||
snippet scrollt
|
||||
${1:obj}.scrollTop(${2:value})
|
||||
snippet sdown
|
||||
${1:obj}.slideDown('${2:slow/400/fast}')
|
||||
snippet sdownc
|
||||
${1:obj}.slideDown('${2:slow/400/fast}', ->
|
||||
${0:// callback}
|
||||
snippet select
|
||||
${1:obj}.select (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet serialize
|
||||
${1:obj}.serialize()
|
||||
snippet serializea
|
||||
${1:obj}.serializeArray()
|
||||
snippet show
|
||||
${1:obj}.show('${2:slow/400/fast}')
|
||||
snippet showc
|
||||
${1:obj}.show '${2:slow/400/fast}', ->
|
||||
${0:// callback}
|
||||
snippet sib
|
||||
${1:obj}.siblings('${2:selector expression}')
|
||||
snippet size
|
||||
${1:obj}.size()
|
||||
snippet slice
|
||||
${1:obj}.slice(${2:start}${3:, end})
|
||||
snippet stoggle
|
||||
${1:obj}.slideToggle('${2:slow/400/fast}')
|
||||
snippet stop
|
||||
${1:obj}.stop('${2:queue}', ${3:false}, ${4:false})
|
||||
snippet submit
|
||||
${1:obj}.submit (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet sup
|
||||
${1:obj}.slideUp('${2:slow/400/fast}')
|
||||
snippet supc
|
||||
${1:obj}.slideUp '${2:slow/400/fast}', ->
|
||||
${0:// callback}
|
||||
snippet text
|
||||
${1:obj}.text(${2:'some text'})
|
||||
snippet this
|
||||
$(this)
|
||||
snippet toarr
|
||||
${0:obj}.toArray()
|
||||
snippet tog
|
||||
${1:obj}.toggle (${2:e}) ->
|
||||
${3:// event handler}
|
||||
, ($2) ->
|
||||
${4:// event handler}
|
||||
${0}
|
||||
snippet togclass
|
||||
${1:obj}.toggleClass('${2:class name}')
|
||||
snippet togsh
|
||||
${1:obj}.toggle('${2:slow/400/fast}')
|
||||
snippet trig
|
||||
${1:obj}.trigger('${2:event name}')
|
||||
snippet trigh
|
||||
${1:obj}.triggerHandler('${2:event name}')
|
||||
snippet $trim
|
||||
$.trim(${1:str})
|
||||
snippet $type
|
||||
$.type(${1:obj})
|
||||
snippet unbind
|
||||
${1:obj}.unbind('${2:event name}')
|
||||
snippet undele
|
||||
${1:obj}.undelegate(${2:selector expression}, ${3:event}, ${4:handler})
|
||||
snippet uniq
|
||||
$.unique(${1:array})
|
||||
snippet unload
|
||||
${1:obj}.unload (${2:e}) ->
|
||||
${0:// event handler}
|
||||
snippet unwrap
|
||||
${1:obj}.unwrap()
|
||||
snippet val
|
||||
${1:obj}.val('${2:text}')
|
||||
snippet width
|
||||
${1:obj}.width(${2:integer})
|
||||
snippet wrap
|
||||
${1:obj}.wrap('${2:<div class="extra-wrapper"></div>}')
|
131
bundle/vim-snippets/snippets/cpp.snippets
Normal file
131
bundle/vim-snippets/snippets/cpp.snippets
Normal file
@ -0,0 +1,131 @@
|
||||
## STL Collections
|
||||
# std::array
|
||||
snippet array
|
||||
std::array<${1:T}, ${2:N}> ${3};
|
||||
# std::vector
|
||||
snippet vector
|
||||
std::vector<${1:T}> ${2};
|
||||
# std::deque
|
||||
snippet deque
|
||||
std::deque<${1:T}> ${2};
|
||||
# std::forward_list
|
||||
snippet flist
|
||||
std::forward_list<${1:T}> ${2};
|
||||
# std::list
|
||||
snippet list
|
||||
std::list<${1:T}> ${2};
|
||||
# std::set
|
||||
snippet set
|
||||
std::set<${1:T}> ${2};
|
||||
# std::map
|
||||
snippet map
|
||||
std::map<${1:Key}, ${2:T}> ${3};
|
||||
# std::multiset
|
||||
snippet mset
|
||||
std::multiset<${1:T}> ${2};
|
||||
# std::multimap
|
||||
snippet mmap
|
||||
std::multimap<${1:Key}, ${2:T}> ${3};
|
||||
# std::unordered_set
|
||||
snippet uset
|
||||
std::unordered_set<${1:T}> ${2};
|
||||
# std::unordered_map
|
||||
snippet umap
|
||||
std::unordered_map<${1:Key}, ${2:T}> ${3};
|
||||
# std::unordered_multiset
|
||||
snippet umset
|
||||
std::unordered_multiset<${1:T}> ${2};
|
||||
# std::unordered_multimap
|
||||
snippet ummap
|
||||
std::unordered_multimap<${1:Key}, ${2:T}> ${3};
|
||||
# std::stack
|
||||
snippet stack
|
||||
std::stack<${1:T}> ${2};
|
||||
# std::queue
|
||||
snippet queue
|
||||
std::queue<${1:T}> ${2};
|
||||
# std::priority_queue
|
||||
snippet pqueue
|
||||
std::priority_queue<${1:T}> ${2};
|
||||
##
|
||||
## Access Modifiers
|
||||
# private
|
||||
snippet pri
|
||||
private
|
||||
# protected
|
||||
snippet pro
|
||||
protected
|
||||
# public
|
||||
snippet pub
|
||||
public
|
||||
# friend
|
||||
snippet fr
|
||||
friend
|
||||
# mutable
|
||||
snippet mu
|
||||
mutable
|
||||
##
|
||||
## Class
|
||||
# class
|
||||
snippet cl
|
||||
class ${1:`vim_snippets#Filename('$1', 'name')`}
|
||||
{
|
||||
public:
|
||||
$1(${2});
|
||||
~$1();
|
||||
|
||||
private:
|
||||
${0:/* data */}
|
||||
};
|
||||
# member function implementation
|
||||
snippet mfun
|
||||
${4:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {
|
||||
${0}
|
||||
}
|
||||
# namespace
|
||||
snippet ns
|
||||
namespace ${1:`vim_snippets#Filename('', 'my')`} {
|
||||
${0}
|
||||
} /* namespace $1 */
|
||||
##
|
||||
## Input/Output
|
||||
# std::cout
|
||||
snippet cout
|
||||
std::cout << ${1} << std::endl;
|
||||
# std::cin
|
||||
snippet cin
|
||||
std::cin >> ${1};
|
||||
##
|
||||
## Iteration
|
||||
# for i
|
||||
snippet fori
|
||||
for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
|
||||
${4}
|
||||
}
|
||||
|
||||
# foreach
|
||||
snippet fore
|
||||
for (${1:auto} ${2:i} : ${3:container}) {
|
||||
${4}
|
||||
}
|
||||
# iterator
|
||||
snippet iter
|
||||
for (${1:std::vector}<${2:type}>::${3:const_iterator} ${4:i} = ${5:container}.begin(); $4 != $5.end(); ++$4) {
|
||||
${6}
|
||||
}
|
||||
|
||||
# auto iterator
|
||||
snippet itera
|
||||
for (auto ${1:i} = ${2:container}.begin(); $1 != $2.end(); ++$1) {
|
||||
${3:std::cout << *$1 << std::endl;}
|
||||
}
|
||||
##
|
||||
## Lambdas
|
||||
# lamda (one line)
|
||||
snippet ld
|
||||
[${1}](${2}){${3}}
|
||||
# lambda (multi-line)
|
||||
snippet lld
|
||||
[${1}](${2}){
|
||||
${3}
|
||||
}
|
374
bundle/vim-snippets/snippets/cs.snippets
Normal file
374
bundle/vim-snippets/snippets/cs.snippets
Normal file
@ -0,0 +1,374 @@
|
||||
# cs.snippets
|
||||
# ===========
|
||||
#
|
||||
# Standard C-Sharp snippets for snipmate.
|
||||
#
|
||||
# Largely ported over from Visual Studio 2010 snippets plus
|
||||
# a few snippets from Resharper plus a few widely known snippets.
|
||||
#
|
||||
# Most snippets on elements (i.e. classes, properties)
|
||||
# follow suffix conventions. The order of suffixes to a snippet
|
||||
# is fixed.
|
||||
#
|
||||
# Snippet Suffix Order
|
||||
# --------------------
|
||||
# 1. Access Modifiers
|
||||
# 2. Class Modifiers
|
||||
#
|
||||
# Access Modifier Suffix Table
|
||||
# ----------------------------
|
||||
# + = public
|
||||
# & = internal
|
||||
# | = protected
|
||||
# - = private
|
||||
#
|
||||
# Example: `cls&` expands to `internal class $1`.
|
||||
# Access modifiers might be doubled to indicate
|
||||
# different modifiers for get/set on properties.
|
||||
# Example: `pb+-` expands to `public bool $1 { get; private set; }`
|
||||
#
|
||||
# Class Modifier Table
|
||||
# --------------------
|
||||
# ^ = static
|
||||
# % = abstract
|
||||
#
|
||||
# Example: `cls|%` expands to `protected abstract class $1`
|
||||
#
|
||||
# On method and property snippets, you can directly set
|
||||
# one of the common types int, string and bool, if desired,
|
||||
# just by appending the type modifier.
|
||||
#
|
||||
# Type Modifier Table
|
||||
# -------------------
|
||||
# i = integer
|
||||
# s = string
|
||||
# b = bool
|
||||
#
|
||||
# Example: `pi+&` expands to `public int $1 { get; internal set; }`
|
||||
#
|
||||
# I'll most propably add more stuff in here like
|
||||
# * List/Array constructio
|
||||
# * Mostly used generics
|
||||
# * Linq
|
||||
# * Funcs, Actions, Predicates
|
||||
# * Lambda
|
||||
# * Events
|
||||
#
|
||||
# Feedback is welcome!
|
||||
#
|
||||
# entry point
|
||||
snippet sim
|
||||
public static int Main(string[] args) {
|
||||
${0}
|
||||
return 0;
|
||||
}
|
||||
snippet simc
|
||||
public class Application {
|
||||
public static int Main(string[] args) {
|
||||
${0}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
# if condition
|
||||
snippet if
|
||||
if (${1}) {
|
||||
${0}
|
||||
}
|
||||
snippet el
|
||||
else {
|
||||
${0}
|
||||
}
|
||||
snippet ifs
|
||||
if (${1})
|
||||
${0}
|
||||
# ternary conditional
|
||||
snippet t
|
||||
${1} ? ${2} : ${0}
|
||||
snippet ?
|
||||
${1} ? ${2} : ${0}
|
||||
# do while loop
|
||||
snippet do
|
||||
do {
|
||||
${0}
|
||||
} while (${1});
|
||||
# while loop
|
||||
snippet wh
|
||||
while (${1}) {
|
||||
${0}
|
||||
}
|
||||
# for loop
|
||||
snippet for
|
||||
for (int ${1:i} = 0; $1 < ${2:count}; $1${3:++}) {
|
||||
${0}
|
||||
}
|
||||
# foreach
|
||||
snippet fore
|
||||
foreach (var ${1:entry} in ${2}) {
|
||||
${0}
|
||||
}
|
||||
snippet foreach
|
||||
foreach (var ${1:entry} in ${2}) {
|
||||
${0}
|
||||
}
|
||||
snippet each
|
||||
foreach (var ${1:entry} in ${2}) {
|
||||
${0}
|
||||
}
|
||||
# interfaces
|
||||
snippet interface
|
||||
public interface ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
snippet if+
|
||||
public interface ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
# class bodies
|
||||
snippet class
|
||||
public class ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
snippet cls
|
||||
${2:public} class ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
snippet cls+
|
||||
public class ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
snippet cls+^
|
||||
public static class ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
snippet cls&
|
||||
internal class ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
snippet cls&^
|
||||
internal static class ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
snippet cls|
|
||||
protected class ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
snippet cls|%
|
||||
protected abstract class ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
# constructor
|
||||
snippet ctor
|
||||
public ${1:`vim_snippets#Filename()`}() {
|
||||
${0}
|
||||
}
|
||||
# properties - auto properties by default.
|
||||
# default type is int with layout get / set.
|
||||
snippet prop
|
||||
${1:public} ${2:int} ${3:} { get; set; }
|
||||
snippet p
|
||||
${1:public} ${2:int} ${3:} { get; set; }
|
||||
snippet p+
|
||||
public ${1:int} ${2:} { get; set; }
|
||||
snippet p+&
|
||||
public ${1:int} ${2:} { get; internal set; }
|
||||
snippet p+|
|
||||
public ${1:int} ${2:} { get; protected set; }
|
||||
snippet p+-
|
||||
public ${1:int} ${2:} { get; private set; }
|
||||
snippet p&
|
||||
internal ${1:int} ${2:} { get; set; }
|
||||
snippet p&|
|
||||
internal ${1:int} ${2:} { get; protected set; }
|
||||
snippet p&-
|
||||
internal ${1:int} ${2:} { get; private set; }
|
||||
snippet p|
|
||||
protected ${1:int} ${2:} { get; set; }
|
||||
snippet p|-
|
||||
protected ${1:int} ${2:} { get; private set; }
|
||||
snippet p-
|
||||
private ${1:int} ${2:} { get; set; }
|
||||
# property - bool
|
||||
snippet pi
|
||||
${1:public} int ${2:} { get; set; }
|
||||
snippet pi+
|
||||
public int ${1} { get; set; }
|
||||
snippet pi+&
|
||||
public int ${1} { get; internal set; }
|
||||
snippet pi+|
|
||||
public int ${1} { get; protected set; }
|
||||
snippet pi+-
|
||||
public int ${1} { get; private set; }
|
||||
snippet pi&
|
||||
internal int ${1} { get; set; }
|
||||
snippet pi&|
|
||||
internal int ${1} { get; protected set; }
|
||||
snippet pi&-
|
||||
internal int ${1} { get; private set; }
|
||||
snippet pi|
|
||||
protected int ${1} { get; set; }
|
||||
snippet pi|-
|
||||
protected int ${1} { get; private set; }
|
||||
snippet pi-
|
||||
private int ${1} { get; set; }
|
||||
# property - bool
|
||||
snippet pb
|
||||
${1:public} bool ${2:} { get; set; }
|
||||
snippet pb+
|
||||
public bool ${1} { get; set; }
|
||||
snippet pb+&
|
||||
public bool ${1} { get; internal set; }
|
||||
snippet pb+|
|
||||
public bool ${1} { get; protected set; }
|
||||
snippet pb+-
|
||||
public bool ${1} { get; private set; }
|
||||
snippet pb&
|
||||
internal bool ${1} { get; set; }
|
||||
snippet pb&|
|
||||
internal bool ${1} { get; protected set; }
|
||||
snippet pb&-
|
||||
internal bool ${1} { get; private set; }
|
||||
snippet pb|
|
||||
protected bool ${1} { get; set; }
|
||||
snippet pb|-
|
||||
protected bool ${1} { get; private set; }
|
||||
snippet pb-
|
||||
private bool ${1} { get; set; }
|
||||
# property - string
|
||||
snippet ps
|
||||
${1:public} string ${2:} { get; set; }
|
||||
snippet ps+
|
||||
public string ${1} { get; set; }
|
||||
snippet ps+&
|
||||
public string ${1} { get; internal set; }
|
||||
snippet ps+|
|
||||
public string ${1} { get; protected set; }
|
||||
snippet ps+-
|
||||
public string ${1} { get; private set; }
|
||||
snippet ps&
|
||||
internal string ${1} { get; set; }
|
||||
snippet ps&|
|
||||
internal string ${1} { get; protected set; }
|
||||
snippet ps&-
|
||||
internal string ${1} { get; private set; }
|
||||
snippet ps|
|
||||
protected string ${1} { get; set; }
|
||||
snippet ps|-
|
||||
protected string ${1} { get; private set; }
|
||||
snippet ps-
|
||||
private string ${1} { get; set; }
|
||||
# members - void
|
||||
snippet m
|
||||
${1:public} ${2:void} ${3:}(${4:}) {
|
||||
${5:}
|
||||
}
|
||||
snippet m+
|
||||
public ${1:void} ${2:}(${3:}) {
|
||||
${4:}
|
||||
}
|
||||
snippet m&
|
||||
internal ${1:void} ${2:}(${3:}) {
|
||||
${4:}
|
||||
}
|
||||
snippet m|
|
||||
protected ${1:void} ${2:}(${3:}) {
|
||||
${4:}
|
||||
}
|
||||
snippet m-
|
||||
private ${1:void} ${2:}(${3:}) {
|
||||
${4:}
|
||||
}
|
||||
# members - int
|
||||
snippet mi
|
||||
${1:public} int ${2:}(${3:}) {
|
||||
${4:return 0;}
|
||||
}
|
||||
snippet mi+
|
||||
public int ${1:}(${2:}) {
|
||||
${3:return 0;}
|
||||
}
|
||||
snippet mi&
|
||||
internal int ${1:}(${2:}) {
|
||||
${3:return 0;}
|
||||
}
|
||||
snippet mi|
|
||||
protected int ${1:}(${2:}) {
|
||||
${3:return 0;}
|
||||
}
|
||||
snippet mi-
|
||||
private int ${1:}(${2:}) {
|
||||
${3:return 0;}
|
||||
}
|
||||
# members - bool
|
||||
snippet mb
|
||||
${1:public} bool ${2:}(${3:}) {
|
||||
${4:return false;}
|
||||
}
|
||||
snippet mb+
|
||||
public bool ${1:}(${2:}) {
|
||||
${3:return false;}
|
||||
}
|
||||
snippet mb&
|
||||
internal bool ${1:}(${2:}) {
|
||||
${3:return false;}
|
||||
}
|
||||
snippet mb|
|
||||
protected bool ${1:}(${2:}) {
|
||||
${3:return false;}
|
||||
}
|
||||
snippet mb-
|
||||
private bool ${1:}(${2:}) {
|
||||
${3:return false;}
|
||||
}
|
||||
# members - string
|
||||
snippet ms
|
||||
${1:public} string ${2:}(${3:}) {
|
||||
${4:return "";}
|
||||
}
|
||||
snippet ms+
|
||||
public string ${1:}(${2:}) {
|
||||
${3:return "";}
|
||||
}
|
||||
snippet ms&
|
||||
internal string ${1:}(${2:}) {
|
||||
${3:return "";}
|
||||
}
|
||||
snippet ms|
|
||||
protected string ${1:}(${2:}) {
|
||||
${3:return "";}
|
||||
}
|
||||
snippet ms-
|
||||
private string ${1:}(${2:}) {
|
||||
${3:return "";}
|
||||
}
|
||||
# structure
|
||||
snippet struct
|
||||
public struct ${1:`vim_snippets#Filename()`} {
|
||||
${0}
|
||||
}
|
||||
# enumeration
|
||||
snippet enum
|
||||
public enum ${1} {
|
||||
${0}
|
||||
}
|
||||
# preprocessor directives
|
||||
snippet #if
|
||||
#if
|
||||
${0}
|
||||
#endif
|
||||
# inline xml documentation
|
||||
snippet ///
|
||||
/// <summary>
|
||||
/// ${0}
|
||||
/// </summary>
|
||||
snippet <p
|
||||
<param name="${1}">${2:$1}</param>
|
||||
snippet <ex
|
||||
<exception cref="${1:System.Exception}">${2}</exception>
|
||||
snippet <r
|
||||
<returns>${1}</returns>{
|
||||
snippet <s
|
||||
<see cref="${1}"/>
|
||||
snippet <rem
|
||||
<remarks>${1}</remarks>
|
||||
snippet <c
|
||||
<code>${1}</code>
|
967
bundle/vim-snippets/snippets/css.snippets
Normal file
967
bundle/vim-snippets/snippets/css.snippets
Normal file
@ -0,0 +1,967 @@
|
||||
snippet .
|
||||
${1} {
|
||||
${0}
|
||||
}
|
||||
snippet !
|
||||
!important
|
||||
snippet bdi:m+
|
||||
-moz-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch};
|
||||
snippet bdi:m
|
||||
-moz-border-image: ${0};
|
||||
snippet bdrz:m
|
||||
-moz-border-radius: ${0};
|
||||
snippet bxsh:m+
|
||||
-moz-box-shadow: ${1:0} ${2:0} ${3:0} #${0:000};
|
||||
snippet bxsh:m
|
||||
-moz-box-shadow: ${0};
|
||||
snippet bdi:w+
|
||||
-webkit-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch};
|
||||
snippet bdi:w
|
||||
-webkit-border-image: ${0};
|
||||
snippet bdrz:w
|
||||
-webkit-border-radius: ${0};
|
||||
snippet bxsh:w+
|
||||
-webkit-box-shadow: ${1:0} ${2:0} ${3:0} #${0:000};
|
||||
snippet bxsh:w
|
||||
-webkit-box-shadow: ${0};
|
||||
snippet @f
|
||||
@font-face {
|
||||
font-family: ${1};
|
||||
src: url(${0});
|
||||
}
|
||||
snippet @i
|
||||
@import url(${0});
|
||||
snippet @m
|
||||
@media ${1:print} {
|
||||
${0}
|
||||
}
|
||||
snippet bg+
|
||||
background: #${1:FFF} url(${2}) ${3:0} ${4:0} ${0:no-repeat};
|
||||
snippet bga
|
||||
background-attachment: ${0};
|
||||
snippet bga:f
|
||||
background-attachment: fixed;
|
||||
snippet bga:s
|
||||
background-attachment: scroll;
|
||||
snippet bgbk
|
||||
background-break: ${0};
|
||||
snippet bgbk:bb
|
||||
background-break: bounding-box;
|
||||
snippet bgbk:c
|
||||
background-break: continuous;
|
||||
snippet bgbk:eb
|
||||
background-break: each-box;
|
||||
snippet bgcp
|
||||
background-clip: ${0};
|
||||
snippet bgcp:bb
|
||||
background-clip: border-box;
|
||||
snippet bgcp:cb
|
||||
background-clip: content-box;
|
||||
snippet bgcp:nc
|
||||
background-clip: no-clip;
|
||||
snippet bgcp:pb
|
||||
background-clip: padding-box;
|
||||
snippet bgc
|
||||
background-color: #${0:FFF};
|
||||
snippet bgc:t
|
||||
background-color: transparent;
|
||||
snippet bgi
|
||||
background-image: url(${0});
|
||||
snippet bgi:n
|
||||
background-image: none;
|
||||
snippet bgo
|
||||
background-origin: ${0};
|
||||
snippet bgo:bb
|
||||
background-origin: border-box;
|
||||
snippet bgo:cb
|
||||
background-origin: content-box;
|
||||
snippet bgo:pb
|
||||
background-origin: padding-box;
|
||||
snippet bgpx
|
||||
background-position-x: ${0};
|
||||
snippet bgpy
|
||||
background-position-y: ${0};
|
||||
snippet bgp
|
||||
background-position: ${1:0} ${0:0};
|
||||
snippet bgr
|
||||
background-repeat: ${0};
|
||||
snippet bgr:n
|
||||
background-repeat: no-repeat;
|
||||
snippet bgr:x
|
||||
background-repeat: repeat-x;
|
||||
snippet bgr:y
|
||||
background-repeat: repeat-y;
|
||||
snippet bgr:r
|
||||
background-repeat: repeat;
|
||||
snippet bgz
|
||||
background-size: ${0};
|
||||
snippet bgz:a
|
||||
background-size: auto;
|
||||
snippet bgz:ct
|
||||
background-size: contain;
|
||||
snippet bgz:cv
|
||||
background-size: cover;
|
||||
snippet bg
|
||||
background: ${0};
|
||||
snippet bg:ie
|
||||
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${0:crop}');
|
||||
snippet bg:n
|
||||
background: none;
|
||||
snippet bd+
|
||||
border: ${1:1px} ${2:solid} #${0:000};
|
||||
snippet bdb+
|
||||
border-bottom: ${1:1px} ${2:solid} #${0:000};
|
||||
snippet bdbc
|
||||
border-bottom-color: #${0:000};
|
||||
snippet bdbi
|
||||
border-bottom-image: url(${0});
|
||||
snippet bdbi:n
|
||||
border-bottom-image: none;
|
||||
snippet bdbli
|
||||
border-bottom-left-image: url(${0});
|
||||
snippet bdbli:c
|
||||
border-bottom-left-image: continue;
|
||||
snippet bdbli:n
|
||||
border-bottom-left-image: none;
|
||||
snippet bdblrz
|
||||
border-bottom-left-radius: ${0};
|
||||
snippet bdbri
|
||||
border-bottom-right-image: url(${0});
|
||||
snippet bdbri:c
|
||||
border-bottom-right-image: continue;
|
||||
snippet bdbri:n
|
||||
border-bottom-right-image: none;
|
||||
snippet bdbrrz
|
||||
border-bottom-right-radius: ${0};
|
||||
snippet bdbs
|
||||
border-bottom-style: ${0};
|
||||
snippet bdbs:n
|
||||
border-bottom-style: none;
|
||||
snippet bdbw
|
||||
border-bottom-width: ${0};
|
||||
snippet bdb
|
||||
border-bottom: ${0};
|
||||
snippet bdb:n
|
||||
border-bottom: none;
|
||||
snippet bdbk
|
||||
border-break: ${0};
|
||||
snippet bdbk:c
|
||||
border-break: close;
|
||||
snippet bdcl
|
||||
border-collapse: ${0};
|
||||
snippet bdcl:c
|
||||
border-collapse: collapse;
|
||||
snippet bdcl:s
|
||||
border-collapse: separate;
|
||||
snippet bdc
|
||||
border-color: #${0:000};
|
||||
snippet bdci
|
||||
border-corner-image: url(${0});
|
||||
snippet bdci:c
|
||||
border-corner-image: continue;
|
||||
snippet bdci:n
|
||||
border-corner-image: none;
|
||||
snippet bdf
|
||||
border-fit: ${0};
|
||||
snippet bdf:c
|
||||
border-fit: clip;
|
||||
snippet bdf:of
|
||||
border-fit: overwrite;
|
||||
snippet bdf:ow
|
||||
border-fit: overwrite;
|
||||
snippet bdf:r
|
||||
border-fit: repeat;
|
||||
snippet bdf:sc
|
||||
border-fit: scale;
|
||||
snippet bdf:sp
|
||||
border-fit: space;
|
||||
snippet bdf:st
|
||||
border-fit: stretch;
|
||||
snippet bdi
|
||||
border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch};
|
||||
snippet bdi:n
|
||||
border-image: none;
|
||||
snippet bdl+
|
||||
border-left: ${1:1px} ${2:solid} #${0:000};
|
||||
snippet bdlc
|
||||
border-left-color: #${0:000};
|
||||
snippet bdli
|
||||
border-left-image: url(${0});
|
||||
snippet bdli:n
|
||||
border-left-image: none;
|
||||
snippet bdls
|
||||
border-left-style: ${0};
|
||||
snippet bdls:n
|
||||
border-left-style: none;
|
||||
snippet bdlw
|
||||
border-left-width: ${0};
|
||||
snippet bdl
|
||||
border-left: ${0};
|
||||
snippet bdl:n
|
||||
border-left: none;
|
||||
snippet bdlt
|
||||
border-length: ${0};
|
||||
snippet bdlt:a
|
||||
border-length: auto;
|
||||
snippet bdrz
|
||||
border-radius: ${0};
|
||||
snippet bdr+
|
||||
border-right: ${1:1px} ${2:solid} #${0:000};
|
||||
snippet bdrc
|
||||
border-right-color: #${0:000};
|
||||
snippet bdri
|
||||
border-right-image: url(${0});
|
||||
snippet bdri:n
|
||||
border-right-image: none;
|
||||
snippet bdrs
|
||||
border-right-style: ${0};
|
||||
snippet bdrs:n
|
||||
border-right-style: none;
|
||||
snippet bdrw
|
||||
border-right-width: ${0};
|
||||
snippet bdr
|
||||
border-right: ${0};
|
||||
snippet bdr:n
|
||||
border-right: none;
|
||||
snippet bdsp
|
||||
border-spacing: ${0};
|
||||
snippet bds
|
||||
border-style: ${0};
|
||||
snippet bds:ds
|
||||
border-style: dashed;
|
||||
snippet bds:dtds
|
||||
border-style: dot-dash;
|
||||
snippet bds:dtdtds
|
||||
border-style: dot-dot-dash;
|
||||
snippet bds:dt
|
||||
border-style: dotted;
|
||||
snippet bds:db
|
||||
border-style: double;
|
||||
snippet bds:g
|
||||
border-style: groove;
|
||||
snippet bds:h
|
||||
border-style: hidden;
|
||||
snippet bds:i
|
||||
border-style: inset;
|
||||
snippet bds:n
|
||||
border-style: none;
|
||||
snippet bds:o
|
||||
border-style: outset;
|
||||
snippet bds:r
|
||||
border-style: ridge;
|
||||
snippet bds:s
|
||||
border-style: solid;
|
||||
snippet bds:w
|
||||
border-style: wave;
|
||||
snippet bdt+
|
||||
border-top: ${1:1px} ${2:solid} #${0:000};
|
||||
snippet bdtc
|
||||
border-top-color: #${0:000};
|
||||
snippet bdti
|
||||
border-top-image: url(${0});
|
||||
snippet bdti:n
|
||||
border-top-image: none;
|
||||
snippet bdtli
|
||||
border-top-left-image: url(${0});
|
||||
snippet bdtli:c
|
||||
border-corner-image: continue;
|
||||
snippet bdtli:n
|
||||
border-corner-image: none;
|
||||
snippet bdtlrz
|
||||
border-top-left-radius: ${0};
|
||||
snippet bdtri
|
||||
border-top-right-image: url(${0});
|
||||
snippet bdtri:c
|
||||
border-top-right-image: continue;
|
||||
snippet bdtri:n
|
||||
border-top-right-image: none;
|
||||
snippet bdtrrz
|
||||
border-top-right-radius: ${0};
|
||||
snippet bdts
|
||||
border-top-style: ${0};
|
||||
snippet bdts:n
|
||||
border-top-style: none;
|
||||
snippet bdtw
|
||||
border-top-width: ${0};
|
||||
snippet bdt
|
||||
border-top: ${0};
|
||||
snippet bdt:n
|
||||
border-top: none;
|
||||
snippet bdw
|
||||
border-width: ${0};
|
||||
snippet bd
|
||||
border: ${0};
|
||||
snippet bd:n
|
||||
border: none;
|
||||
snippet b
|
||||
bottom: ${0};
|
||||
snippet b:a
|
||||
bottom: auto;
|
||||
snippet bxsh+
|
||||
box-shadow: ${1:0} ${2:0} ${3:0} #${0:000};
|
||||
snippet bxsh
|
||||
box-shadow: ${0};
|
||||
snippet bxsh:n
|
||||
box-shadow: none;
|
||||
snippet bxz
|
||||
box-sizing: ${0};
|
||||
snippet bxz:bb
|
||||
box-sizing: border-box;
|
||||
snippet bxz:cb
|
||||
box-sizing: content-box;
|
||||
snippet cps
|
||||
caption-side: ${0};
|
||||
snippet cps:b
|
||||
caption-side: bottom;
|
||||
snippet cps:t
|
||||
caption-side: top;
|
||||
snippet cl
|
||||
clear: ${0};
|
||||
snippet cl:b
|
||||
clear: both;
|
||||
snippet cl:l
|
||||
clear: left;
|
||||
snippet cl:n
|
||||
clear: none;
|
||||
snippet cl:r
|
||||
clear: right;
|
||||
snippet cp
|
||||
clip: ${0};
|
||||
snippet cp:a
|
||||
clip: auto;
|
||||
snippet cp:r
|
||||
clip: rect(${1:0} ${2:0} ${3:0} ${0:0});
|
||||
snippet c
|
||||
color: #${0:000};
|
||||
snippet ct
|
||||
content: ${0};
|
||||
snippet ct:a
|
||||
content: attr(${0});
|
||||
snippet ct:cq
|
||||
content: close-quote;
|
||||
snippet ct:c
|
||||
content: counter(${0});
|
||||
snippet ct:cs
|
||||
content: counters(${0});
|
||||
snippet ct:ncq
|
||||
content: no-close-quote;
|
||||
snippet ct:noq
|
||||
content: no-open-quote;
|
||||
snippet ct:n
|
||||
content: normal;
|
||||
snippet ct:oq
|
||||
content: open-quote;
|
||||
snippet coi
|
||||
counter-increment: ${0};
|
||||
snippet cor
|
||||
counter-reset: ${0};
|
||||
snippet cur
|
||||
cursor: ${0};
|
||||
snippet cur:a
|
||||
cursor: auto;
|
||||
snippet cur:c
|
||||
cursor: crosshair;
|
||||
snippet cur:d
|
||||
cursor: default;
|
||||
snippet cur:ha
|
||||
cursor: hand;
|
||||
snippet cur:he
|
||||
cursor: help;
|
||||
snippet cur:m
|
||||
cursor: move;
|
||||
snippet cur:p
|
||||
cursor: pointer;
|
||||
snippet cur:t
|
||||
cursor: text;
|
||||
snippet d
|
||||
display: ${0};
|
||||
snippet d:mib
|
||||
display: -moz-inline-box;
|
||||
snippet d:mis
|
||||
display: -moz-inline-stack;
|
||||
snippet d:b
|
||||
display: block;
|
||||
snippet d:cp
|
||||
display: compact;
|
||||
snippet d:ib
|
||||
display: inline-block;
|
||||
snippet d:itb
|
||||
display: inline-table;
|
||||
snippet d:i
|
||||
display: inline;
|
||||
snippet d:li
|
||||
display: list-item;
|
||||
snippet d:n
|
||||
display: none;
|
||||
snippet d:ri
|
||||
display: run-in;
|
||||
snippet d:tbcp
|
||||
display: table-caption;
|
||||
snippet d:tbc
|
||||
display: table-cell;
|
||||
snippet d:tbclg
|
||||
display: table-column-group;
|
||||
snippet d:tbcl
|
||||
display: table-column;
|
||||
snippet d:tbfg
|
||||
display: table-footer-group;
|
||||
snippet d:tbhg
|
||||
display: table-header-group;
|
||||
snippet d:tbrg
|
||||
display: table-row-group;
|
||||
snippet d:tbr
|
||||
display: table-row;
|
||||
snippet d:tb
|
||||
display: table;
|
||||
snippet ec
|
||||
empty-cells: ${0};
|
||||
snippet ec:h
|
||||
empty-cells: hide;
|
||||
snippet ec:s
|
||||
empty-cells: show;
|
||||
snippet exp
|
||||
expression()
|
||||
snippet fl
|
||||
float: ${0};
|
||||
snippet fl:l
|
||||
float: left;
|
||||
snippet fl:n
|
||||
float: none;
|
||||
snippet fl:r
|
||||
float: right;
|
||||
snippet f+
|
||||
font: ${1:1em} ${2:Arial},${0:sans-serif};
|
||||
snippet fef
|
||||
font-effect: ${0};
|
||||
snippet fef:eb
|
||||
font-effect: emboss;
|
||||
snippet fef:eg
|
||||
font-effect: engrave;
|
||||
snippet fef:n
|
||||
font-effect: none;
|
||||
snippet fef:o
|
||||
font-effect: outline;
|
||||
snippet femp
|
||||
font-emphasize-position: ${0};
|
||||
snippet femp:a
|
||||
font-emphasize-position: after;
|
||||
snippet femp:b
|
||||
font-emphasize-position: before;
|
||||
snippet fems
|
||||
font-emphasize-style: ${0};
|
||||
snippet fems:ac
|
||||
font-emphasize-style: accent;
|
||||
snippet fems:c
|
||||
font-emphasize-style: circle;
|
||||
snippet fems:ds
|
||||
font-emphasize-style: disc;
|
||||
snippet fems:dt
|
||||
font-emphasize-style: dot;
|
||||
snippet fems:n
|
||||
font-emphasize-style: none;
|
||||
snippet fem
|
||||
font-emphasize: ${0};
|
||||
snippet ff
|
||||
font-family: ${0};
|
||||
snippet ff:c
|
||||
font-family: ${0:'Monotype Corsiva','Comic Sans MS'},cursive;
|
||||
snippet ff:f
|
||||
font-family: ${0:Capitals,Impact},fantasy;
|
||||
snippet ff:m
|
||||
font-family: ${0:Monaco,'Courier New'},monospace;
|
||||
snippet ff:ss
|
||||
font-family: ${0:Helvetica,Arial},sans-serif;
|
||||
snippet ff:s
|
||||
font-family: ${0:Georgia,'Times New Roman'},serif;
|
||||
snippet fza
|
||||
font-size-adjust: ${0};
|
||||
snippet fza:n
|
||||
font-size-adjust: none;
|
||||
snippet fz
|
||||
font-size: ${0};
|
||||
snippet fsm
|
||||
font-smooth: ${0};
|
||||
snippet fsm:aw
|
||||
font-smooth: always;
|
||||
snippet fsm:a
|
||||
font-smooth: auto;
|
||||
snippet fsm:n
|
||||
font-smooth: never;
|
||||
snippet fst
|
||||
font-stretch: ${0};
|
||||
snippet fst:c
|
||||
font-stretch: condensed;
|
||||
snippet fst:e
|
||||
font-stretch: expanded;
|
||||
snippet fst:ec
|
||||
font-stretch: extra-condensed;
|
||||
snippet fst:ee
|
||||
font-stretch: extra-expanded;
|
||||
snippet fst:n
|
||||
font-stretch: normal;
|
||||
snippet fst:sc
|
||||
font-stretch: semi-condensed;
|
||||
snippet fst:se
|
||||
font-stretch: semi-expanded;
|
||||
snippet fst:uc
|
||||
font-stretch: ultra-condensed;
|
||||
snippet fst:ue
|
||||
font-stretch: ultra-expanded;
|
||||
snippet fs
|
||||
font-style: ${0};
|
||||
snippet fs:i
|
||||
font-style: italic;
|
||||
snippet fs:n
|
||||
font-style: normal;
|
||||
snippet fs:o
|
||||
font-style: oblique;
|
||||
snippet fv
|
||||
font-variant: ${0};
|
||||
snippet fv:n
|
||||
font-variant: normal;
|
||||
snippet fv:sc
|
||||
font-variant: small-caps;
|
||||
snippet fw
|
||||
font-weight: ${0};
|
||||
snippet fw:b
|
||||
font-weight: bold;
|
||||
snippet fw:br
|
||||
font-weight: bolder;
|
||||
snippet fw:lr
|
||||
font-weight: lighter;
|
||||
snippet fw:n
|
||||
font-weight: normal;
|
||||
snippet f
|
||||
font: ${0};
|
||||
snippet h
|
||||
height: ${0};
|
||||
snippet h:a
|
||||
height: auto;
|
||||
snippet l
|
||||
left: ${0};
|
||||
snippet l:a
|
||||
left: auto;
|
||||
snippet lts
|
||||
letter-spacing: ${0};
|
||||
snippet lh
|
||||
line-height: ${0};
|
||||
snippet lisi
|
||||
list-style-image: url(${0});
|
||||
snippet lisi:n
|
||||
list-style-image: none;
|
||||
snippet lisp
|
||||
list-style-position: ${0};
|
||||
snippet lisp:i
|
||||
list-style-position: inside;
|
||||
snippet lisp:o
|
||||
list-style-position: outside;
|
||||
snippet list
|
||||
list-style-type: ${0};
|
||||
snippet list:c
|
||||
list-style-type: circle;
|
||||
snippet list:dclz
|
||||
list-style-type: decimal-leading-zero;
|
||||
snippet list:dc
|
||||
list-style-type: decimal;
|
||||
snippet list:d
|
||||
list-style-type: disc;
|
||||
snippet list:lr
|
||||
list-style-type: lower-roman;
|
||||
snippet list:n
|
||||
list-style-type: none;
|
||||
snippet list:s
|
||||
list-style-type: square;
|
||||
snippet list:ur
|
||||
list-style-type: upper-roman;
|
||||
snippet lis
|
||||
list-style: ${0};
|
||||
snippet lis:n
|
||||
list-style: none;
|
||||
snippet mb
|
||||
margin-bottom: ${0};
|
||||
snippet mb:a
|
||||
margin-bottom: auto;
|
||||
snippet ml
|
||||
margin-left: ${0};
|
||||
snippet ml:a
|
||||
margin-left: auto;
|
||||
snippet mr
|
||||
margin-right: ${0};
|
||||
snippet mr:a
|
||||
margin-right: auto;
|
||||
snippet mt
|
||||
margin-top: ${0};
|
||||
snippet mt:a
|
||||
margin-top: auto;
|
||||
snippet m
|
||||
margin: ${0};
|
||||
snippet m:4
|
||||
margin: ${1:0} ${2:0} ${3:0} ${0:0};
|
||||
snippet m:3
|
||||
margin: ${1:0} ${2:0} ${0:0};
|
||||
snippet m:2
|
||||
margin: ${1:0} ${0:0};
|
||||
snippet m:0
|
||||
margin: 0;
|
||||
snippet m:a
|
||||
margin: auto;
|
||||
snippet mah
|
||||
max-height: ${0};
|
||||
snippet mah:n
|
||||
max-height: none;
|
||||
snippet maw
|
||||
max-width: ${0};
|
||||
snippet maw:n
|
||||
max-width: none;
|
||||
snippet mih
|
||||
min-height: ${0};
|
||||
snippet miw
|
||||
min-width: ${0};
|
||||
snippet op
|
||||
opacity: ${0};
|
||||
snippet op:ie
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100});
|
||||
snippet op:ms
|
||||
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100})';
|
||||
snippet orp
|
||||
orphans: ${0};
|
||||
snippet o+
|
||||
outline: ${1:1px} ${2:solid} #${0:000};
|
||||
snippet oc
|
||||
outline-color: ${0:#000};
|
||||
snippet oc:i
|
||||
outline-color: invert;
|
||||
snippet oo
|
||||
outline-offset: ${0};
|
||||
snippet os
|
||||
outline-style: ${0};
|
||||
snippet ow
|
||||
outline-width: ${0};
|
||||
snippet o
|
||||
outline: ${0};
|
||||
snippet o:n
|
||||
outline: none;
|
||||
snippet ovs
|
||||
overflow-style: ${0};
|
||||
snippet ovs:a
|
||||
overflow-style: auto;
|
||||
snippet ovs:mq
|
||||
overflow-style: marquee;
|
||||
snippet ovs:mv
|
||||
overflow-style: move;
|
||||
snippet ovs:p
|
||||
overflow-style: panner;
|
||||
snippet ovs:s
|
||||
overflow-style: scrollbar;
|
||||
snippet ovx
|
||||
overflow-x: ${0};
|
||||
snippet ovx:a
|
||||
overflow-x: auto;
|
||||
snippet ovx:h
|
||||
overflow-x: hidden;
|
||||
snippet ovx:s
|
||||
overflow-x: scroll;
|
||||
snippet ovx:v
|
||||
overflow-x: visible;
|
||||
snippet ovy
|
||||
overflow-y: ${0};
|
||||
snippet ovy:a
|
||||
overflow-y: auto;
|
||||
snippet ovy:h
|
||||
overflow-y: hidden;
|
||||
snippet ovy:s
|
||||
overflow-y: scroll;
|
||||
snippet ovy:v
|
||||
overflow-y: visible;
|
||||
snippet ov
|
||||
overflow: ${0};
|
||||
snippet ov:a
|
||||
overflow: auto;
|
||||
snippet ov:h
|
||||
overflow: hidden;
|
||||
snippet ov:s
|
||||
overflow: scroll;
|
||||
snippet ov:v
|
||||
overflow: visible;
|
||||
snippet pb
|
||||
padding-bottom: ${0};
|
||||
snippet pl
|
||||
padding-left: ${0};
|
||||
snippet pr
|
||||
padding-right: ${0};
|
||||
snippet pt
|
||||
padding-top: ${0};
|
||||
snippet p
|
||||
padding: ${0};
|
||||
snippet p:4
|
||||
padding: ${1:0} ${2:0} ${3:0} ${0:0};
|
||||
snippet p:3
|
||||
padding: ${1:0} ${2:0} ${0:0};
|
||||
snippet p:2
|
||||
padding: ${1:0} ${0:0};
|
||||
snippet p:0
|
||||
padding: 0;
|
||||
snippet pgba
|
||||
page-break-after: ${0};
|
||||
snippet pgba:aw
|
||||
page-break-after: always;
|
||||
snippet pgba:a
|
||||
page-break-after: auto;
|
||||
snippet pgba:l
|
||||
page-break-after: left;
|
||||
snippet pgba:r
|
||||
page-break-after: right;
|
||||
snippet pgbb
|
||||
page-break-before: ${0};
|
||||
snippet pgbb:aw
|
||||
page-break-before: always;
|
||||
snippet pgbb:a
|
||||
page-break-before: auto;
|
||||
snippet pgbb:l
|
||||
page-break-before: left;
|
||||
snippet pgbb:r
|
||||
page-break-before: right;
|
||||
snippet pgbi
|
||||
page-break-inside: ${0};
|
||||
snippet pgbi:a
|
||||
page-break-inside: auto;
|
||||
snippet pgbi:av
|
||||
page-break-inside: avoid;
|
||||
snippet pos
|
||||
position: ${0};
|
||||
snippet pos:a
|
||||
position: absolute;
|
||||
snippet pos:f
|
||||
position: fixed;
|
||||
snippet pos:r
|
||||
position: relative;
|
||||
snippet pos:s
|
||||
position: static;
|
||||
snippet q
|
||||
quotes: ${0};
|
||||
snippet q:en
|
||||
quotes: '\201C' '\201D' '\2018' '\2019';
|
||||
snippet q:n
|
||||
quotes: none;
|
||||
snippet q:ru
|
||||
quotes: '\00AB' '\00BB' '\201E' '\201C';
|
||||
snippet rz
|
||||
resize: ${0};
|
||||
snippet rz:b
|
||||
resize: both;
|
||||
snippet rz:h
|
||||
resize: horizontal;
|
||||
snippet rz:n
|
||||
resize: none;
|
||||
snippet rz:v
|
||||
resize: vertical;
|
||||
snippet r
|
||||
right: ${0};
|
||||
snippet r:a
|
||||
right: auto;
|
||||
snippet tbl
|
||||
table-layout: ${0};
|
||||
snippet tbl:a
|
||||
table-layout: auto;
|
||||
snippet tbl:f
|
||||
table-layout: fixed;
|
||||
snippet tal
|
||||
text-align-last: ${0};
|
||||
snippet tal:a
|
||||
text-align-last: auto;
|
||||
snippet tal:c
|
||||
text-align-last: center;
|
||||
snippet tal:l
|
||||
text-align-last: left;
|
||||
snippet tal:r
|
||||
text-align-last: right;
|
||||
snippet ta
|
||||
text-align: ${0};
|
||||
snippet ta:c
|
||||
text-align: center;
|
||||
snippet ta:l
|
||||
text-align: left;
|
||||
snippet ta:r
|
||||
text-align: right;
|
||||
snippet td
|
||||
text-decoration: ${0};
|
||||
snippet td:l
|
||||
text-decoration: line-through;
|
||||
snippet td:n
|
||||
text-decoration: none;
|
||||
snippet td:o
|
||||
text-decoration: overline;
|
||||
snippet td:u
|
||||
text-decoration: underline;
|
||||
snippet te
|
||||
text-emphasis: ${0};
|
||||
snippet te:ac
|
||||
text-emphasis: accent;
|
||||
snippet te:a
|
||||
text-emphasis: after;
|
||||
snippet te:b
|
||||
text-emphasis: before;
|
||||
snippet te:c
|
||||
text-emphasis: circle;
|
||||
snippet te:ds
|
||||
text-emphasis: disc;
|
||||
snippet te:dt
|
||||
text-emphasis: dot;
|
||||
snippet te:n
|
||||
text-emphasis: none;
|
||||
snippet th
|
||||
text-height: ${0};
|
||||
snippet th:a
|
||||
text-height: auto;
|
||||
snippet th:f
|
||||
text-height: font-size;
|
||||
snippet th:m
|
||||
text-height: max-size;
|
||||
snippet th:t
|
||||
text-height: text-size;
|
||||
snippet ti
|
||||
text-indent: ${0};
|
||||
snippet ti:-
|
||||
text-indent: -9999px;
|
||||
snippet tj
|
||||
text-justify: ${0};
|
||||
snippet tj:a
|
||||
text-justify: auto;
|
||||
snippet tj:d
|
||||
text-justify: distribute;
|
||||
snippet tj:ic
|
||||
text-justify: inter-cluster;
|
||||
snippet tj:ii
|
||||
text-justify: inter-ideograph;
|
||||
snippet tj:iw
|
||||
text-justify: inter-word;
|
||||
snippet tj:k
|
||||
text-justify: kashida;
|
||||
snippet tj:t
|
||||
text-justify: tibetan;
|
||||
snippet to+
|
||||
text-outline: ${1:0} ${2:0} #${0:000};
|
||||
snippet to
|
||||
text-outline: ${0};
|
||||
snippet to:n
|
||||
text-outline: none;
|
||||
snippet tr
|
||||
text-replace: ${0};
|
||||
snippet tr:n
|
||||
text-replace: none;
|
||||
snippet tsh+
|
||||
text-shadow: ${1:0} ${2:0} ${3:0} #${0:000};
|
||||
snippet tsh
|
||||
text-shadow: ${0};
|
||||
snippet tsh:n
|
||||
text-shadow: none;
|
||||
snippet tt
|
||||
text-transform: ${0};
|
||||
snippet tt:c
|
||||
text-transform: capitalize;
|
||||
snippet tt:l
|
||||
text-transform: lowercase;
|
||||
snippet tt:n
|
||||
text-transform: none;
|
||||
snippet tt:u
|
||||
text-transform: uppercase;
|
||||
snippet tw
|
||||
text-wrap: ${0};
|
||||
snippet tw:no
|
||||
text-wrap: none;
|
||||
snippet tw:n
|
||||
text-wrap: normal;
|
||||
snippet tw:s
|
||||
text-wrap: suppress;
|
||||
snippet tw:u
|
||||
text-wrap: unrestricted;
|
||||
snippet t
|
||||
top: ${0};
|
||||
snippet t:a
|
||||
top: auto;
|
||||
snippet va
|
||||
vertical-align: ${0};
|
||||
snippet va:bl
|
||||
vertical-align: baseline;
|
||||
snippet va:b
|
||||
vertical-align: bottom;
|
||||
snippet va:m
|
||||
vertical-align: middle;
|
||||
snippet va:sub
|
||||
vertical-align: sub;
|
||||
snippet va:sup
|
||||
vertical-align: super;
|
||||
snippet va:tb
|
||||
vertical-align: text-bottom;
|
||||
snippet va:tt
|
||||
vertical-align: text-top;
|
||||
snippet va:t
|
||||
vertical-align: top;
|
||||
snippet v
|
||||
visibility: ${0};
|
||||
snippet v:c
|
||||
visibility: collapse;
|
||||
snippet v:h
|
||||
visibility: hidden;
|
||||
snippet v:v
|
||||
visibility: visible;
|
||||
snippet whsc
|
||||
white-space-collapse: ${0};
|
||||
snippet whsc:ba
|
||||
white-space-collapse: break-all;
|
||||
snippet whsc:bs
|
||||
white-space-collapse: break-strict;
|
||||
snippet whsc:k
|
||||
white-space-collapse: keep-all;
|
||||
snippet whsc:l
|
||||
white-space-collapse: loose;
|
||||
snippet whsc:n
|
||||
white-space-collapse: normal;
|
||||
snippet whs
|
||||
white-space: ${0};
|
||||
snippet whs:n
|
||||
white-space: normal;
|
||||
snippet whs:nw
|
||||
white-space: nowrap;
|
||||
snippet whs:pl
|
||||
white-space: pre-line;
|
||||
snippet whs:pw
|
||||
white-space: pre-wrap;
|
||||
snippet whs:p
|
||||
white-space: pre;
|
||||
snippet wid
|
||||
widows: ${0};
|
||||
snippet w
|
||||
width: ${0};
|
||||
snippet w:a
|
||||
width: auto;
|
||||
snippet wob
|
||||
word-break: ${0};
|
||||
snippet wob:ba
|
||||
word-break: break-all;
|
||||
snippet wob:bs
|
||||
word-break: break-strict;
|
||||
snippet wob:k
|
||||
word-break: keep-all;
|
||||
snippet wob:l
|
||||
word-break: loose;
|
||||
snippet wob:n
|
||||
word-break: normal;
|
||||
snippet wos
|
||||
word-spacing: ${0};
|
||||
snippet wow
|
||||
word-wrap: ${0};
|
||||
snippet wow:no
|
||||
word-wrap: none;
|
||||
snippet wow:n
|
||||
word-wrap: normal;
|
||||
snippet wow:s
|
||||
word-wrap: suppress;
|
||||
snippet wow:u
|
||||
word-wrap: unrestricted;
|
||||
snippet z
|
||||
z-index: ${0};
|
||||
snippet z:a
|
||||
z-index: auto;
|
||||
snippet zoo
|
||||
zoom: 1;
|
82
bundle/vim-snippets/snippets/dart.snippets
Normal file
82
bundle/vim-snippets/snippets/dart.snippets
Normal file
@ -0,0 +1,82 @@
|
||||
snippet lib
|
||||
#library('${1}');
|
||||
${0}
|
||||
snippet im
|
||||
#import('${1}');
|
||||
${0}
|
||||
snippet so
|
||||
#source('${1}');
|
||||
${0}
|
||||
snippet main
|
||||
static void main() {
|
||||
${0}
|
||||
}
|
||||
snippet st
|
||||
static ${0}
|
||||
snippet fi
|
||||
final ${0}
|
||||
snippet re
|
||||
return ${0}
|
||||
snippet br
|
||||
break;
|
||||
snippet th
|
||||
throw ${0}
|
||||
snippet cl
|
||||
class ${1:`vim_snippets#Filename("", "untitled")`} ${0}
|
||||
snippet in
|
||||
interface ${1:`vim_snippets#Filename("", "untitled")`} ${0}
|
||||
snippet imp
|
||||
implements ${0}
|
||||
snippet ext
|
||||
extends ${0}
|
||||
snippet if
|
||||
if (${1:true}) {
|
||||
${0}
|
||||
}
|
||||
snippet ife
|
||||
if (${1:true}) {
|
||||
${2}
|
||||
} else {
|
||||
${0}
|
||||
}
|
||||
snippet el
|
||||
else
|
||||
snippet sw
|
||||
switch (${1}) {
|
||||
${0}
|
||||
}
|
||||
snippet cs
|
||||
case ${1}:
|
||||
${0}
|
||||
snippet de
|
||||
default:
|
||||
${0}
|
||||
snippet for
|
||||
for (var ${2:i} = 0, len = ${1:things}.length; $2 < len; ${3:++}$2) {
|
||||
${0:$1[$2]}
|
||||
}
|
||||
snippet fore
|
||||
for (final ${2:item} in ${1:itemList}) {
|
||||
${0}
|
||||
}
|
||||
snippet wh
|
||||
while (${1:/* condition */}) {
|
||||
${0}
|
||||
}
|
||||
snippet dowh
|
||||
do {
|
||||
${0}
|
||||
} while (${0:/* condition */});
|
||||
snippet as
|
||||
assert(${0:/* condition */});
|
||||
snippet try
|
||||
try {
|
||||
${0}
|
||||
} catch (${1:Exception e}) {
|
||||
}
|
||||
snippet tryf
|
||||
try {
|
||||
${0}
|
||||
} catch (${1:Exception e}) {
|
||||
} finally {
|
||||
}
|
11
bundle/vim-snippets/snippets/diff.snippets
Normal file
11
bundle/vim-snippets/snippets/diff.snippets
Normal file
@ -0,0 +1,11 @@
|
||||
# DEP-3 (http://dep.debian.net/deps/dep3/) style patch header
|
||||
snippet header DEP-3 style header
|
||||
Description: ${1}
|
||||
Origin: ${2:vendor|upstream|other}, ${3:url of the original patch}
|
||||
Bug: ${4:url in upstream bugtracker}
|
||||
Forwarded: ${5:no|not-needed|url}
|
||||
Author: ${6:`g:snips_author`}
|
||||
Reviewed-by: ${7:name and email}
|
||||
Last-Update: ${8:`strftime("%Y-%m-%d")`}
|
||||
Applied-Upstream: ${0:upstream version|url|commit}
|
||||
|
108
bundle/vim-snippets/snippets/django.snippets
Normal file
108
bundle/vim-snippets/snippets/django.snippets
Normal file
@ -0,0 +1,108 @@
|
||||
# Model Fields
|
||||
|
||||
# Note: Optional arguments are using defaults that match what Django will use
|
||||
# as a default, e.g. with max_length fields. Doing this as a form of self
|
||||
# documentation and to make it easy to know whether you should override the
|
||||
# default or not.
|
||||
|
||||
# Note: Optional arguments that are booleans will use the opposite since you
|
||||
# can either not specify them, or override them, e.g. auto_now_add=False.
|
||||
|
||||
snippet auto
|
||||
${1:FIELDNAME} = models.AutoField(${0})
|
||||
snippet bool
|
||||
${1:FIELDNAME} = models.BooleanField(${0:default=True})
|
||||
snippet char
|
||||
${1:FIELDNAME} = models.CharField(max_length=${2}${0:, blank=True})
|
||||
snippet comma
|
||||
${1:FIELDNAME} = models.CommaSeparatedIntegerField(max_length=${2}${0:, blank=True})
|
||||
snippet date
|
||||
${1:FIELDNAME} = models.DateField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
|
||||
snippet datetime
|
||||
${1:FIELDNAME} = models.DateTimeField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
|
||||
snippet decimal
|
||||
${1:FIELDNAME} = models.DecimalField(max_digits=${2}, decimal_places=${0})
|
||||
snippet email
|
||||
${1:FIELDNAME} = models.EmailField(max_length=${2:75}${0:, blank=True})
|
||||
snippet file
|
||||
${1:FIELDNAME} = models.FileField(upload_to=${2:path/for/upload}${0:, max_length=100})
|
||||
snippet filepath
|
||||
${1:FIELDNAME} = models.FilePathField(path=${2:"/abs/path/to/dir"}${3:, max_length=100}${4:, match="*.ext"}${5:, recursive=True}${0:, blank=True, })
|
||||
snippet float
|
||||
${1:FIELDNAME} = models.FloatField(${0})
|
||||
snippet image
|
||||
${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${0:, max_length=100})
|
||||
snippet int
|
||||
${1:FIELDNAME} = models.IntegerField(${0})
|
||||
snippet ip
|
||||
${1:FIELDNAME} = models.IPAddressField(${0})
|
||||
snippet nullbool
|
||||
${1:FIELDNAME} = models.NullBooleanField(${0})
|
||||
snippet posint
|
||||
${1:FIELDNAME} = models.PositiveIntegerField(${0})
|
||||
snippet possmallint
|
||||
${1:FIELDNAME} = models.PositiveSmallIntegerField(${0})
|
||||
snippet slug
|
||||
${1:FIELDNAME} = models.SlugField(max_length=${2:50}${0:, blank=True})
|
||||
snippet smallint
|
||||
${1:FIELDNAME} = models.SmallIntegerField(${0})
|
||||
snippet text
|
||||
${1:FIELDNAME} = models.TextField(${0:blank=True})
|
||||
snippet time
|
||||
${1:FIELDNAME} = models.TimeField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
|
||||
snippet url
|
||||
${1:FIELDNAME} = models.URLField(${2:verify_exists=False}${3:, max_length=200}${0:, blank=True})
|
||||
snippet xml
|
||||
${1:FIELDNAME} = models.XMLField(schema_path=${2:None}${0:, blank=True})
|
||||
# Relational Fields
|
||||
snippet fk
|
||||
${1:FIELDNAME} = models.ForeignKey(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${0:, to_field=''})
|
||||
snippet m2m
|
||||
${1:FIELDNAME} = models.ManyToManyField(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, symmetrical=False}${6:, through=''}${0:, db_table=''})
|
||||
snippet o2o
|
||||
${1:FIELDNAME} = models.OneToOneField(${2:OtherModel}${3:, parent_link=True}${4:, related_name=''}${5:, limit_choices_to=}${0:, to_field=''})
|
||||
|
||||
# Code Skeletons
|
||||
|
||||
snippet form
|
||||
class ${1:FormName}(forms.Form):
|
||||
"""${2:docstring}"""
|
||||
${0}
|
||||
|
||||
snippet model
|
||||
class ${1:ModelName}(models.Model):
|
||||
"""${2:docstring}"""
|
||||
${3}
|
||||
|
||||
class Meta:
|
||||
${4}
|
||||
|
||||
def __unicode__(self):
|
||||
${5}
|
||||
|
||||
def save(self, force_insert=False, force_update=False):
|
||||
${6}
|
||||
|
||||
@models.permalink
|
||||
def get_absolute_url(self):
|
||||
return ('${7:view_or_url_name}' ${0})
|
||||
|
||||
snippet modeladmin
|
||||
class ${1:ModelName}Admin(admin.ModelAdmin):
|
||||
${0}
|
||||
|
||||
admin.site.register($1, $1Admin)
|
||||
|
||||
snippet tabularinline
|
||||
class ${0:ModelName}Inline(admin.TabularInline):
|
||||
model = $1
|
||||
|
||||
snippet stackedinline
|
||||
class ${0:ModelName}Inline(admin.StackedInline):
|
||||
model = $1
|
||||
|
||||
snippet r2r
|
||||
return render_to_response('${1:template.html}', {
|
||||
${2}
|
||||
}${0:, context_instance=RequestContext(request)}
|
||||
)
|
12
bundle/vim-snippets/snippets/dosini.snippets
Normal file
12
bundle/vim-snippets/snippets/dosini.snippets
Normal file
@ -0,0 +1,12 @@
|
||||
snippet ec
|
||||
; http://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = ${1:space_or_tab}
|
||||
indent_size = ${2:indent_size}
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
130
bundle/vim-snippets/snippets/elixir.snippets
Normal file
130
bundle/vim-snippets/snippets/elixir.snippets
Normal file
@ -0,0 +1,130 @@
|
||||
snippet do
|
||||
do
|
||||
${0}
|
||||
end
|
||||
snippet if if .. do .. end
|
||||
if ${1} do
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet if if .. do: ..
|
||||
if ${1:condition}, do: ${0}
|
||||
|
||||
snippet ife if .. do .. else .. end
|
||||
if ${1:condition} do
|
||||
${2}
|
||||
else
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet ife if .. do: .. else:
|
||||
if ${1:condition}, do: ${2}, else: ${0}
|
||||
|
||||
snippet unless unless .. do .. end
|
||||
unless ${1} do
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet unless unless .. do: ..
|
||||
unless ${1:condition}, do: ${0}
|
||||
|
||||
snippet unlesse unless .. do .. else .. end
|
||||
unless ${1:condition} do
|
||||
${2}
|
||||
else
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet unlesse unless .. do: .. else:
|
||||
unless ${1:condition}, do: ${2}, else: ${0}
|
||||
|
||||
snippet cond
|
||||
cond do
|
||||
${1} ->
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet case
|
||||
case ${1} do
|
||||
${2} ->
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet df
|
||||
def ${1:name}, do: ${2}
|
||||
|
||||
snippet def
|
||||
def ${1:name} do
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet defim
|
||||
defimpl ${1:protocol_name}, for: ${2:data_type} do
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet defma
|
||||
defmacro ${1:name} do
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet defmo
|
||||
defmodule ${1:module_name} do
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet defp
|
||||
defp ${1:name} do
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet defpr
|
||||
defprotocol ${1:name}, [${0:function}]
|
||||
|
||||
snippet defr
|
||||
defrecord ${1:record_name}, ${0:fields}
|
||||
|
||||
snippet doc
|
||||
@doc """
|
||||
${0}
|
||||
"""
|
||||
|
||||
snippet fn
|
||||
fn(${1:args}) -> ${0} end
|
||||
|
||||
snippet fun
|
||||
function do
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet mdoc
|
||||
@moduledoc """
|
||||
${0}
|
||||
"""
|
||||
|
||||
snippet rec
|
||||
receive do
|
||||
${1} ->
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet req
|
||||
require ${0:module_name}
|
||||
|
||||
snippet imp
|
||||
import ${0:module_name}
|
||||
|
||||
snippet ali
|
||||
alias ${0:module_name}
|
||||
|
||||
snippet test
|
||||
test "${1:test_name}" do
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet try try .. rescue .. end
|
||||
try do
|
||||
${1}
|
||||
rescue
|
||||
${2} -> ${0}
|
||||
end
|
353
bundle/vim-snippets/snippets/erlang.snippets
Normal file
353
bundle/vim-snippets/snippets/erlang.snippets
Normal file
@ -0,0 +1,353 @@
|
||||
# module and export all
|
||||
snippet mod
|
||||
-module(${1:`vim_snippets#Filename('', 'my')`}).
|
||||
|
||||
-compile([export_all]).
|
||||
|
||||
start() ->
|
||||
${0}
|
||||
|
||||
stop() ->
|
||||
ok.
|
||||
# define directive
|
||||
snippet def
|
||||
-define(${1:macro}, ${2:body}).
|
||||
# export directive
|
||||
snippet exp
|
||||
-export([${1:function}/${0:arity}]).
|
||||
# include directive
|
||||
snippet inc
|
||||
-include("${1:file}").
|
||||
# include_lib directive
|
||||
snippet incl
|
||||
-include_lib("${1:lib}/include/${1}.hrl").${2}
|
||||
# behavior directive
|
||||
snippet beh
|
||||
-behaviour(${1:behaviour}).
|
||||
# if expression
|
||||
snippet if
|
||||
if
|
||||
${1:guard} ->
|
||||
${0:body}
|
||||
end
|
||||
# case expression
|
||||
snippet case
|
||||
case ${1:expression} of
|
||||
${2:pattern} ->
|
||||
${0:body};
|
||||
end
|
||||
# anonymous function
|
||||
snippet fun
|
||||
fun (${1:Parameters}) -> ${2:body} end
|
||||
# try...catch
|
||||
snippet try
|
||||
try
|
||||
${1}
|
||||
catch
|
||||
${2:_:_} -> ${0:got_some_exception}
|
||||
end
|
||||
# record directive
|
||||
snippet rec
|
||||
-record(${1:record}, {
|
||||
${2:field}=${3:value}}).
|
||||
# todo comment
|
||||
snippet todo
|
||||
%% TODO: ${0}
|
||||
## Snippets below (starting with '%') are in EDoc format.
|
||||
## See http://www.erlang.org/doc/apps/edoc/chapter.html#id56887 for more details
|
||||
# doc comment
|
||||
snippet %d
|
||||
%% @doc ${0}
|
||||
# end of doc comment
|
||||
snippet %e
|
||||
%% @end
|
||||
# specification comment
|
||||
snippet %s
|
||||
%% @spec ${0}
|
||||
# private function marker
|
||||
snippet %p
|
||||
%% @private
|
||||
# OTP application
|
||||
snippet application
|
||||
-module(${1:`vim_snippets#Filename('', 'my')`}).
|
||||
|
||||
-behaviour(application).
|
||||
|
||||
-export([start/2, stop/1]).
|
||||
|
||||
start(_Type, _StartArgs) ->
|
||||
case ${0:root_supervisor}:start_link() of
|
||||
{ok, Pid} ->
|
||||
{ok, Pid};
|
||||
Other ->
|
||||
{error, Other}
|
||||
end.
|
||||
|
||||
stop(_State) ->
|
||||
ok.
|
||||
# OTP supervisor
|
||||
snippet supervisor
|
||||
-module(${1:`vim_snippets#Filename('', 'my')`}).
|
||||
|
||||
-behaviour(supervisor).
|
||||
|
||||
%% API
|
||||
-export([start_link/0]).
|
||||
|
||||
%% Supervisor callbacks
|
||||
-export([init/1]).
|
||||
|
||||
-define(SERVER, ?MODULE).
|
||||
|
||||
start_link() ->
|
||||
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
|
||||
|
||||
init([]) ->
|
||||
Server = {${0:my_server}, {$2, start_link, []},
|
||||
permanent, 2000, worker, [$2]},
|
||||
Children = [Server],
|
||||
RestartStrategy = {one_for_one, 0, 1},
|
||||
{ok, {RestartStrategy, Children}}.
|
||||
# OTP gen_server
|
||||
snippet gen_server
|
||||
-module(${0:`vim_snippets#Filename('', 'my')`}).
|
||||
|
||||
-behaviour(gen_server).
|
||||
|
||||
%% API
|
||||
-export([
|
||||
start_link/0
|
||||
]).
|
||||
|
||||
%% gen_server callbacks
|
||||
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
|
||||
terminate/2, code_change/3]).
|
||||
|
||||
-define(SERVER, ?MODULE).
|
||||
|
||||
-record(state, {}).
|
||||
|
||||
%%%===================================================================
|
||||
%%% API
|
||||
%%%===================================================================
|
||||
|
||||
start_link() ->
|
||||
gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
|
||||
|
||||
%%%===================================================================
|
||||
%%% gen_server callbacks
|
||||
%%%===================================================================
|
||||
|
||||
init([]) ->
|
||||
{ok, #state{}}.
|
||||
|
||||
handle_call(_Request, _From, State) ->
|
||||
Reply = ok,
|
||||
{reply, Reply, State}.
|
||||
|
||||
handle_cast(_Msg, State) ->
|
||||
{noreply, State}.
|
||||
|
||||
handle_info(_Info, State) ->
|
||||
{noreply, State}.
|
||||
|
||||
terminate(_Reason, _State) ->
|
||||
ok.
|
||||
|
||||
code_change(_OldVsn, State, _Extra) ->
|
||||
{ok, State}.
|
||||
|
||||
%%%===================================================================
|
||||
%%% Internal functions
|
||||
%%%===================================================================
|
||||
# common_test test_SUITE
|
||||
snippet testsuite
|
||||
-module(${0:`vim_snippets#Filename('', 'my')`}).
|
||||
|
||||
-include_lib("common_test/include/ct.hrl").
|
||||
|
||||
%% Test server callbacks
|
||||
-export([suite/0, all/0, groups/0,
|
||||
init_per_suite/1, end_per_suite/1,
|
||||
init_per_group/2, end_per_group/2,
|
||||
init_per_testcase/2, end_per_testcase/2]).
|
||||
|
||||
%% Test cases
|
||||
-export([
|
||||
]).
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% COMMON TEST CALLBACK FUNCTIONS
|
||||
%%--------------------------------------------------------------------
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: suite() -> Info
|
||||
%%
|
||||
%% Info = [tuple()]
|
||||
%% List of key/value pairs.
|
||||
%%
|
||||
%% Description: Returns list of tuples to set default properties
|
||||
%% for the suite.
|
||||
%%
|
||||
%% Note: The suite/0 function is only meant to be used to return
|
||||
%% default data values, not perform any other operations.
|
||||
%%--------------------------------------------------------------------
|
||||
suite() ->
|
||||
[{timetrap,{minutes,10}}].
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: init_per_suite(Config0) ->
|
||||
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
|
||||
%%
|
||||
%% Config0 = Config1 = [tuple()]
|
||||
%% A list of key/value pairs, holding the test case configuration.
|
||||
%% Reason = term()
|
||||
%% The reason for skipping the suite.
|
||||
%%
|
||||
%% Description: Initialization before the suite.
|
||||
%%
|
||||
%% Note: This function is free to add any key/value pairs to the Config
|
||||
%% variable, but should NOT alter/remove any existing entries.
|
||||
%%--------------------------------------------------------------------
|
||||
init_per_suite(Config) ->
|
||||
Config.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}
|
||||
%%
|
||||
%% Config0 = Config1 = [tuple()]
|
||||
%% A list of key/value pairs, holding the test case configuration.
|
||||
%%
|
||||
%% Description: Cleanup after the suite.
|
||||
%%--------------------------------------------------------------------
|
||||
end_per_suite(_Config) ->
|
||||
ok.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: init_per_group(GroupName, Config0) ->
|
||||
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
|
||||
%%
|
||||
%% GroupName = atom()
|
||||
%% Name of the test case group that is about to run.
|
||||
%% Config0 = Config1 = [tuple()]
|
||||
%% A list of key/value pairs, holding configuration data for the group.
|
||||
%% Reason = term()
|
||||
%% The reason for skipping all test cases and subgroups in the group.
|
||||
%%
|
||||
%% Description: Initialization before each test case group.
|
||||
%%--------------------------------------------------------------------
|
||||
init_per_group(_GroupName, Config) ->
|
||||
Config.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: end_per_group(GroupName, Config0) ->
|
||||
%% void() | {save_config,Config1}
|
||||
%%
|
||||
%% GroupName = atom()
|
||||
%% Name of the test case group that is finished.
|
||||
%% Config0 = Config1 = [tuple()]
|
||||
%% A list of key/value pairs, holding configuration data for the group.
|
||||
%%
|
||||
%% Description: Cleanup after each test case group.
|
||||
%%--------------------------------------------------------------------
|
||||
end_per_group(_GroupName, _Config) ->
|
||||
ok.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: init_per_testcase(TestCase, Config0) ->
|
||||
%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
|
||||
%%
|
||||
%% TestCase = atom()
|
||||
%% Name of the test case that is about to run.
|
||||
%% Config0 = Config1 = [tuple()]
|
||||
%% A list of key/value pairs, holding the test case configuration.
|
||||
%% Reason = term()
|
||||
%% The reason for skipping the test case.
|
||||
%%
|
||||
%% Description: Initialization before each test case.
|
||||
%%
|
||||
%% Note: This function is free to add any key/value pairs to the Config
|
||||
%% variable, but should NOT alter/remove any existing entries.
|
||||
%%--------------------------------------------------------------------
|
||||
init_per_testcase(_TestCase, Config) ->
|
||||
Config.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: end_per_testcase(TestCase, Config0) ->
|
||||
%% void() | {save_config,Config1} | {fail,Reason}
|
||||
%%
|
||||
%% TestCase = atom()
|
||||
%% Name of the test case that is finished.
|
||||
%% Config0 = Config1 = [tuple()]
|
||||
%% A list of key/value pairs, holding the test case configuration.
|
||||
%% Reason = term()
|
||||
%% The reason for failing the test case.
|
||||
%%
|
||||
%% Description: Cleanup after each test case.
|
||||
%%--------------------------------------------------------------------
|
||||
end_per_testcase(_TestCase, _Config) ->
|
||||
ok.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: groups() -> [Group]
|
||||
%%
|
||||
%% Group = {GroupName,Properties,GroupsAndTestCases}
|
||||
%% GroupName = atom()
|
||||
%% The name of the group.
|
||||
%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
|
||||
%% Group properties that may be combined.
|
||||
%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
|
||||
%% TestCase = atom()
|
||||
%% The name of a test case.
|
||||
%% Shuffle = shuffle | {shuffle,Seed}
|
||||
%% To get cases executed in random order.
|
||||
%% Seed = {integer(),integer(),integer()}
|
||||
%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
|
||||
%% repeat_until_any_ok | repeat_until_any_fail
|
||||
%% To get execution of cases repeated.
|
||||
%% N = integer() | forever
|
||||
%%
|
||||
%% Description: Returns a list of test case group definitions.
|
||||
%%--------------------------------------------------------------------
|
||||
groups() ->
|
||||
[].
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: all() -> GroupsAndTestCases | {skip,Reason}
|
||||
%%
|
||||
%% GroupsAndTestCases = [{group,GroupName} | TestCase]
|
||||
%% GroupName = atom()
|
||||
%% Name of a test case group.
|
||||
%% TestCase = atom()
|
||||
%% Name of a test case.
|
||||
%% Reason = term()
|
||||
%% The reason for skipping all groups and test cases.
|
||||
%%
|
||||
%% Description: Returns the list of groups and test cases that
|
||||
%% are to be executed.
|
||||
%%--------------------------------------------------------------------
|
||||
all() ->
|
||||
[].
|
||||
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% TEST CASES
|
||||
%%--------------------------------------------------------------------
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: TestCase(Config0) ->
|
||||
%% ok | exit() | {skip,Reason} | {comment,Comment} |
|
||||
%% {save_config,Config1} | {skip_and_save,Reason,Config1}
|
||||
%%
|
||||
%% Config0 = Config1 = [tuple()]
|
||||
%% A list of key/value pairs, holding the test case configuration.
|
||||
%% Reason = term()
|
||||
%% The reason for skipping the test case.
|
||||
%% Comment = term()
|
||||
%% A comment about the test case that will be printed in the html log.
|
||||
%%
|
||||
%% Description: Test case function. (The name of it must be specified in
|
||||
%% the all/0 list or in a test case group for the test case
|
||||
%% to be executed).
|
||||
%%--------------------------------------------------------------------
|
||||
|
127
bundle/vim-snippets/snippets/eruby.snippets
Normal file
127
bundle/vim-snippets/snippets/eruby.snippets
Normal file
@ -0,0 +1,127 @@
|
||||
# .erb and .rhmtl files
|
||||
|
||||
# Includes html.snippets
|
||||
|
||||
# Rails *****************************
|
||||
snippet rc
|
||||
<% ${0} %>
|
||||
snippet rce
|
||||
<%= ${1} %>
|
||||
snippet %
|
||||
<% ${0} %>
|
||||
snippet =
|
||||
<%= ${1} %>
|
||||
snippet end
|
||||
<% end %>
|
||||
snippet ead
|
||||
<% ${1}.each do |${2}| %>
|
||||
${0}
|
||||
<% end %>
|
||||
snippet for
|
||||
<% for ${2:item} in ${1} %>
|
||||
${0}
|
||||
<% end %>
|
||||
snippet rp
|
||||
<%= render :partial => '${0:item}' %>
|
||||
snippet rpl
|
||||
<%= render :partial => '${1:item}', :locals => { :${2:name} => '${3:value}'${0} } %>
|
||||
snippet rps
|
||||
<%= render :partial => '${1:item}', :status => ${0:500} %>
|
||||
snippet rpc
|
||||
<%= render :partial => '${1:item}', :collection => ${0:items} %>
|
||||
snippet lia
|
||||
<%= link_to '${1:link text...}', :action => '${0:index}' %>
|
||||
snippet liai
|
||||
<%= link_to '${1:link text...}', :action => '${2:edit}', :id => ${0:@item} %>
|
||||
snippet lic
|
||||
<%= link_to '${1:link text...}', :controller => '${0:items}' %>
|
||||
snippet lica
|
||||
<%= link_to '${1:link text...}', :controller => '${2:items}', :action => '${0:index}' %>
|
||||
snippet licai
|
||||
<%= link_to '${1:link text...}', :controller => '${2:items}', :action => '${3:edit}', :id => ${0:@item} %>
|
||||
snippet yield
|
||||
<%= yield ${1::content_symbol} %>
|
||||
snippet conf
|
||||
<% content_for :${1:head} do %>
|
||||
${0}
|
||||
<% end %>
|
||||
snippet cs
|
||||
<%= collection_select <+object+>, <+method+>, <+collection+>, <+value_method+>, <+text_method+><+, <+[options]+>, <+[html_options]+>+> %>
|
||||
snippet ct
|
||||
<%= content_tag '${1:DIV}', ${2:content}${0:,options} %>
|
||||
snippet ff
|
||||
<%= form_for @${1:model} do |f| %>
|
||||
${0}
|
||||
<% end %>
|
||||
snippet ffi
|
||||
<%= ${1:f}.input :${0:attribute} %>
|
||||
snippet ffcb
|
||||
<%= ${1:f}.check_box :${0:attribute} %>
|
||||
snippet ffe
|
||||
<% error_messages_for :${1:model} %>
|
||||
|
||||
<%= form_for @${2:model} do |f| %>
|
||||
${0}
|
||||
<% end %>
|
||||
snippet ffff
|
||||
<%= ${1:f}.file_field :${0:attribute} %>
|
||||
snippet ffhf
|
||||
<%= ${1:f}.hidden_field :${0:attribute} %>
|
||||
snippet ffl
|
||||
<%= ${1:f}.label :${2:attribute}, '${0:$2}' %>
|
||||
snippet ffpf
|
||||
<%= ${1:f}.password_field :${0:attribute} %>
|
||||
snippet ffrb
|
||||
<%= ${1:f}.radio_button :${2:attribute}, :${0:tag_value} %>
|
||||
snippet ffs
|
||||
<%= ${1:f}.submit "${0:submit}" %>
|
||||
snippet ffta
|
||||
<%= ${1:f}.text_area :${0:attribute} %>
|
||||
snippet fftf
|
||||
<%= ${1:f}.text_field :${0:attribute} %>
|
||||
snippet fields
|
||||
<%= fields_for :${1:model}, @$1 do |${2:f}| %>
|
||||
${0}
|
||||
<% end %>
|
||||
snippet i18
|
||||
I18n.t('${1:type.key}')
|
||||
snippet it
|
||||
<%= image_tag "${1}"${0} %>
|
||||
snippet jit
|
||||
<%= javascript_include_tag ${0::all} %>
|
||||
snippet jsit
|
||||
<%= javascript_include_tag "${0}" %>
|
||||
snippet lim
|
||||
<%= link_to ${1:model}.${2:name}, ${3:$1}_path(${0:$1}) %>
|
||||
snippet linp
|
||||
<%= link_to "${1:Link text...}", ${2:parent}_${3:child}_path(${4:@$2}, ${0:@$3}) %>
|
||||
snippet linpp
|
||||
<%= link_to "${1:Link text...}", ${2:parent}_${3:child}_path(${0:@$2}) %>
|
||||
snippet lip
|
||||
<%= link_to "${1:Link text...}", ${2:model}_path(${0:@$2}) %>
|
||||
snippet lipp
|
||||
<%= link_to "${1:Link text...}", ${0:model}s_path %>
|
||||
snippet lt
|
||||
<%= link_to "${1:name}", ${0:dest} %>
|
||||
snippet ntc
|
||||
<%= number_to_currency(${1}) %>
|
||||
snippet ofcfs
|
||||
<%= options_from_collection_for_select ${1:collection}, ${2:value_method}, ${3:text_method}, ${0:selected_value} %>
|
||||
snippet rf
|
||||
<%= render :file => "${1:file}"${0} %>
|
||||
snippet rt
|
||||
<%= render :template => "${1:file}"${0} %>
|
||||
snippet slt
|
||||
<%= stylesheet_link_tag ${1::all}, :cache => ${0:true} %>
|
||||
snippet sslt
|
||||
<%= stylesheet_link_tag "${0}" %>
|
||||
snippet if
|
||||
<% if ${1} %>
|
||||
${0}
|
||||
<% end %>
|
||||
snippet ife
|
||||
<% if ${1} %>
|
||||
${2}
|
||||
<% else %>
|
||||
${0}
|
||||
<% end %>
|
71
bundle/vim-snippets/snippets/falcon.snippets
Normal file
71
bundle/vim-snippets/snippets/falcon.snippets
Normal file
@ -0,0 +1,71 @@
|
||||
snippet #!
|
||||
#!/usr/bin/env falcon
|
||||
|
||||
# Import
|
||||
snippet imp
|
||||
import ${0:module}
|
||||
|
||||
# Function
|
||||
snippet fun
|
||||
function ${2:function_name}(${3})
|
||||
${0}
|
||||
end
|
||||
|
||||
# Class
|
||||
snippet class
|
||||
class ${1:class_name}(${2:class_params})
|
||||
${0:/* members/methods */}
|
||||
end
|
||||
|
||||
# If
|
||||
snippet if
|
||||
if ${1:condition}
|
||||
${0}
|
||||
end
|
||||
|
||||
# If else
|
||||
snippet ife
|
||||
if ${1:condition}
|
||||
${0}
|
||||
else
|
||||
${1}
|
||||
end
|
||||
|
||||
# If else if
|
||||
snippet eif
|
||||
elif ${1:condition}
|
||||
${0}
|
||||
|
||||
# Switch case
|
||||
snippet switch
|
||||
switch ${1:expression}
|
||||
case ${2:item}
|
||||
case ${0:item}
|
||||
default
|
||||
end
|
||||
|
||||
# Select
|
||||
snippet select
|
||||
select ${1:variable}
|
||||
case ${2:TypeSpec}
|
||||
case ${0:TypeSpec}
|
||||
default
|
||||
end
|
||||
|
||||
# For/in Loop
|
||||
snippet forin
|
||||
for ${1:element} in ${2:container}
|
||||
${0}
|
||||
end
|
||||
|
||||
# For/to Loop
|
||||
snippet forto
|
||||
for ${1:lowerbound} to ${2:upperbound}
|
||||
${0}
|
||||
end
|
||||
|
||||
# While Loop
|
||||
snippet wh
|
||||
while ${1:conidition}
|
||||
${0}
|
||||
end
|
232
bundle/vim-snippets/snippets/go.snippets
Normal file
232
bundle/vim-snippets/snippets/go.snippets
Normal file
@ -0,0 +1,232 @@
|
||||
# shorthand variable declaration
|
||||
snippet v
|
||||
${1} := ${2}
|
||||
# variable initialization
|
||||
snippet vr
|
||||
var ${1:t} ${0:string}
|
||||
# variable declaration
|
||||
snippet var
|
||||
var ${1} ${2} = ${3}
|
||||
# variables declaration
|
||||
snippet vars
|
||||
var (
|
||||
${1} ${2} = ${3}
|
||||
)
|
||||
# append
|
||||
snippet ap
|
||||
append(${1:slice}, ${0:value})
|
||||
# bool
|
||||
snippet bl
|
||||
bool
|
||||
# byte
|
||||
snippet bt
|
||||
byte
|
||||
# break
|
||||
snippet br
|
||||
break
|
||||
# channel
|
||||
snippet ch
|
||||
chan ${0:int}
|
||||
# case
|
||||
snippet cs
|
||||
case ${1:value}:
|
||||
${0}
|
||||
# const
|
||||
snippet c
|
||||
const ${1:NAME} = ${0:0}
|
||||
# constants with iota
|
||||
snippet co
|
||||
const (
|
||||
${1:NAME1} = iota
|
||||
${0:NAME2}
|
||||
)
|
||||
# continue
|
||||
snippet cn
|
||||
continue
|
||||
# defer
|
||||
snippet df
|
||||
defer ${0:func}()
|
||||
# defer recover
|
||||
snippet dfr
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
${0}
|
||||
}
|
||||
}()
|
||||
# gpl
|
||||
snippet gpl
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright (C) ${1:Author}, `strftime("%Y")`
|
||||
*/
|
||||
|
||||
${0}
|
||||
# int
|
||||
snippet i
|
||||
int
|
||||
# import
|
||||
snippet im
|
||||
import (
|
||||
"${1:package}"
|
||||
)
|
||||
# interface
|
||||
snippet in
|
||||
interface{}
|
||||
# full interface snippet
|
||||
snippet inf
|
||||
interface ${1:name} {
|
||||
${2:/* methods */}
|
||||
}
|
||||
# if condition
|
||||
snippet if
|
||||
if ${1:/* condition */} {
|
||||
${2}
|
||||
}
|
||||
# else snippet
|
||||
snippet el
|
||||
else {
|
||||
${1}
|
||||
}
|
||||
# error snippet
|
||||
snippet ir
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
${0}
|
||||
# false
|
||||
snippet f
|
||||
false
|
||||
# fallthrough
|
||||
snippet ft
|
||||
fallthrough
|
||||
# float
|
||||
snippet fl
|
||||
float32
|
||||
# float32
|
||||
snippet f3
|
||||
float32
|
||||
# float64
|
||||
snippet f6
|
||||
float64
|
||||
# if else
|
||||
snippet ie
|
||||
if ${1:/* condition */} {
|
||||
${2}
|
||||
} else {
|
||||
${3}
|
||||
}
|
||||
${0}
|
||||
# for loop
|
||||
snippet fo
|
||||
for ${2:i} := 0; $2 < ${1:count}; $2${3:++} {
|
||||
${4}
|
||||
}
|
||||
${0}
|
||||
# for range loop
|
||||
snippet fr
|
||||
for ${1:k}, ${2:v} := range ${3} {
|
||||
${4}
|
||||
}
|
||||
${0}
|
||||
# function simple
|
||||
snippet fun
|
||||
func ${1:funcName}(${2}) ${3:error} {
|
||||
${4}
|
||||
}
|
||||
${0}
|
||||
# function on receiver
|
||||
snippet fum
|
||||
func (self ${1:type}) ${2:funcName}(${3}) ${4:error} {
|
||||
${5}
|
||||
}
|
||||
${0}
|
||||
# log printf
|
||||
snippet lf
|
||||
log.Printf("%${1:s}", ${2:var})
|
||||
# log printf
|
||||
snippet lp
|
||||
log.Println("${1}")
|
||||
# make
|
||||
snippet mk
|
||||
make(${1:[]string}, ${0:0})
|
||||
# map
|
||||
snippet mp
|
||||
map[${1:string}]${0:int}
|
||||
# main()
|
||||
snippet main
|
||||
func main() {
|
||||
${1}
|
||||
}
|
||||
${0}
|
||||
# new
|
||||
snippet nw
|
||||
new(${0:type})
|
||||
# panic
|
||||
snippet pn
|
||||
panic("${0:msg}")
|
||||
# print
|
||||
snippet pr
|
||||
fmt.Printf("%${1:s}\n", ${2:var})
|
||||
# range
|
||||
snippet rn
|
||||
range ${0}
|
||||
# return
|
||||
snippet rt
|
||||
return ${0}
|
||||
# result
|
||||
snippet rs
|
||||
result
|
||||
# select
|
||||
snippet sl
|
||||
select {
|
||||
case ${1:v1} := <-${2:chan1}
|
||||
${3}
|
||||
case ${4:v2} := <-${5:chan2}
|
||||
${6}
|
||||
default:
|
||||
${0}
|
||||
}
|
||||
# string
|
||||
snippet sr
|
||||
string
|
||||
# struct
|
||||
snippet st
|
||||
struct ${1:name} {
|
||||
${2:/* data */}
|
||||
}
|
||||
${0}
|
||||
# switch
|
||||
snippet sw
|
||||
switch ${1:var} {
|
||||
case ${2:value1}:
|
||||
${3}
|
||||
case ${4:value2}:
|
||||
${5}
|
||||
default:
|
||||
${0}
|
||||
}
|
||||
snippet sp
|
||||
fmt.Sprintf("%${1:s}", ${2:var})
|
||||
# true
|
||||
snippet t
|
||||
true
|
||||
# goroutine named function
|
||||
snippet g
|
||||
go ${1:funcName}(${0})
|
||||
# goroutine anonymous function
|
||||
snippet ga
|
||||
go func(${1} ${2:type}) {
|
||||
${3:/* code */}
|
||||
}(${0})
|
37
bundle/vim-snippets/snippets/haml.snippets
Normal file
37
bundle/vim-snippets/snippets/haml.snippets
Normal file
@ -0,0 +1,37 @@
|
||||
snippet t
|
||||
%table
|
||||
%tr
|
||||
%th
|
||||
${1:headers}
|
||||
%tr
|
||||
%td
|
||||
${0:headers}
|
||||
snippet ul
|
||||
%ul
|
||||
%li
|
||||
${0:item}
|
||||
%li
|
||||
snippet rp
|
||||
= render :partial => "${0:item}"
|
||||
snippet rpc
|
||||
= render :partial => "${1:item}", :collection => ${0:@$1s}
|
||||
snippet rpl
|
||||
= render :partial => "${1:item}", :locals => { :${2:$1} => ${0:@$1}
|
||||
snippet rpo
|
||||
= render :partial => "${1:item}", :object => ${0:@$1}
|
||||
snippet lt
|
||||
= link_to ${1:name}, ${2:dest}
|
||||
snippet mt
|
||||
= mail_to ${1:email_address}, ${2:name}
|
||||
snippet mts
|
||||
= mail_to ${1:email_address}, ${2:name}, :subject => ${3}, :body => ${4}
|
||||
snippet ife
|
||||
- if ${1:condition}
|
||||
${2}
|
||||
- else
|
||||
${0}
|
||||
snippet ifp
|
||||
- if ${1:condition}.presence?
|
||||
${0}
|
||||
snippet ntc
|
||||
= number_to_currency(${1})
|
82
bundle/vim-snippets/snippets/haskell.snippets
Normal file
82
bundle/vim-snippets/snippets/haskell.snippets
Normal file
@ -0,0 +1,82 @@
|
||||
snippet lang
|
||||
{-# LANGUAGE ${0:OverloadedStrings} #-}
|
||||
snippet info
|
||||
-- |
|
||||
-- Module : ${1:Module.Namespace}
|
||||
-- Copyright : ${2:Author} ${3:2011-2012}
|
||||
-- License : ${4:BSD3}
|
||||
--
|
||||
-- Maintainer : ${5:email@something.com}
|
||||
-- Stability : ${6:experimental}
|
||||
-- Portability : ${7:unknown}
|
||||
--
|
||||
-- ${0:Description}
|
||||
--
|
||||
snippet import
|
||||
import ${0:Data.Text}
|
||||
snippet import2
|
||||
import ${1:Data.Text} (${0:head})
|
||||
snippet importq
|
||||
import qualified ${1:Data.Text} as ${0:T}
|
||||
snippet inst
|
||||
instance ${1:Monoid} ${2:Type} where
|
||||
${0}
|
||||
snippet type
|
||||
type ${1:Type} = ${0:Type}
|
||||
snippet data
|
||||
data ${1:Type} = ${2:$1} ${0:Int}
|
||||
snippet newtype
|
||||
newtype ${1:Type} = ${2:$1} ${0:Int}
|
||||
snippet class
|
||||
class ${1:Class} a where
|
||||
${0}
|
||||
snippet module
|
||||
module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` (
|
||||
) where
|
||||
`expand('%') =~ 'Main' ? "\n\nmain = do\n print \"hello world\"" : ""`
|
||||
|
||||
snippet const
|
||||
${1:name} :: ${2:a}
|
||||
$1 = ${0:undefined}
|
||||
snippet fn
|
||||
${1:fn} :: ${2:a} -> ${3:a}
|
||||
$1 ${4} = ${0:undefined}
|
||||
snippet fn2
|
||||
${1:fn} :: ${2:a} -> ${3:a} -> ${4:a}
|
||||
$1 ${5} = ${0:undefined}
|
||||
snippet ap
|
||||
${1:map} ${2:fn} ${0:list}
|
||||
snippet do
|
||||
do
|
||||
|
||||
snippet λ
|
||||
\${1:x} -> ${0}
|
||||
snippet \
|
||||
\${1:x} -> ${0}
|
||||
snippet <-
|
||||
${1:a} <- ${0:m a}
|
||||
snippet ←
|
||||
${1:a} <- ${0:m a}
|
||||
snippet ->
|
||||
${1:m a} -> ${0:a}
|
||||
snippet →
|
||||
${1:m a} -> ${0:a}
|
||||
snippet tup
|
||||
(${1:a}, ${0:b})
|
||||
snippet tup2
|
||||
(${1:a}, ${2:b}, ${0:c})
|
||||
snippet tup3
|
||||
(${1:a}, ${2:b}, ${3:c}, ${0:d})
|
||||
snippet rec
|
||||
${1:Record} { ${2:recFieldA} = ${3:undefined}
|
||||
, ${4:recFieldB} = ${0:undefined}
|
||||
}
|
||||
snippet case
|
||||
case ${1:something} of
|
||||
${2} -> ${0}
|
||||
snippet let
|
||||
let ${1} = ${2}
|
||||
in ${3}
|
||||
snippet where
|
||||
where
|
||||
${1:fn} = ${0:undefined}
|
832
bundle/vim-snippets/snippets/html.snippets
Normal file
832
bundle/vim-snippets/snippets/html.snippets
Normal file
@ -0,0 +1,832 @@
|
||||
# Some useful Unicode entities
|
||||
# Non-Breaking Space
|
||||
snippet nbs
|
||||
|
||||
# ←
|
||||
snippet left
|
||||
←
|
||||
# →
|
||||
snippet right
|
||||
→
|
||||
# ↑
|
||||
snippet up
|
||||
↑
|
||||
# ↓
|
||||
snippet down
|
||||
↓
|
||||
# ↩
|
||||
snippet return
|
||||
↩
|
||||
# ⇤
|
||||
snippet backtab
|
||||
⇤
|
||||
# ⇥
|
||||
snippet tab
|
||||
⇥
|
||||
# ⇧
|
||||
snippet shift
|
||||
⇧
|
||||
# ⌃
|
||||
snippet ctrl
|
||||
⌃
|
||||
# ⌅
|
||||
snippet enter
|
||||
⌅
|
||||
# ⌘
|
||||
snippet cmd
|
||||
⌘
|
||||
# ⌥
|
||||
snippet option
|
||||
⌥
|
||||
# ⌦
|
||||
snippet delete
|
||||
⌦
|
||||
# ⌫
|
||||
snippet backspace
|
||||
⌫
|
||||
# ⎋
|
||||
snippet esc
|
||||
⎋
|
||||
# Generic Doctype
|
||||
snippet doctype HTML 4.01 Strict
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
snippet doctype HTML 4.01 Transitional
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
snippet doctype HTML 5
|
||||
<!DOCTYPE HTML>
|
||||
snippet doctype XHTML 1.0 Frameset
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
snippet doctype XHTML 1.0 Strict
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
snippet doctype XHTML 1.0 Transitional
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
snippet doctype XHTML 1.1
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
# HTML Doctype 4.01 Strict
|
||||
snippet docts
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
# HTML Doctype 4.01 Transitional
|
||||
snippet doct
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
# HTML Doctype 5
|
||||
snippet doct5
|
||||
<!DOCTYPE HTML>
|
||||
# XHTML Doctype 1.0 Frameset
|
||||
snippet docxf
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
||||
# XHTML Doctype 1.0 Strict
|
||||
snippet docxs
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
# XHTML Doctype 1.0 Transitional
|
||||
snippet docxt
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
# XHTML Doctype 1.1
|
||||
snippet docx
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
# Attributes
|
||||
snippet attr
|
||||
${1:attribute}="${0:property}"
|
||||
snippet attr+
|
||||
${1:attribute}="${2:property}" attr+
|
||||
snippet .
|
||||
class="${1}"
|
||||
snippet #
|
||||
id="${1}"
|
||||
snippet alt
|
||||
alt="${1}"
|
||||
snippet charset
|
||||
charset="${1:utf-8}"
|
||||
snippet data
|
||||
data-${1}="${2:$1}"
|
||||
snippet for
|
||||
for="${1}"
|
||||
snippet height
|
||||
height="${1}"
|
||||
snippet href
|
||||
href="${1:#}"
|
||||
snippet lang
|
||||
lang="${1:en}"
|
||||
snippet media
|
||||
media="${1}"
|
||||
snippet name
|
||||
name="${1}"
|
||||
snippet rel
|
||||
rel="${1}"
|
||||
snippet scope
|
||||
scope="${1:row}"
|
||||
snippet src
|
||||
src="${1}"
|
||||
snippet title=
|
||||
title="${1}"
|
||||
snippet type
|
||||
type="${1}"
|
||||
snippet value
|
||||
value="${1}"
|
||||
snippet width
|
||||
width="${1}"
|
||||
# Elements
|
||||
snippet a
|
||||
<a href="${1:#}">${0:$1}</a>
|
||||
snippet a.
|
||||
<a class="${1}" href="${2:#}">${0:$1}</a>
|
||||
snippet a#
|
||||
<a id="${1}" href="${2:#}">${0:$1}</a>
|
||||
snippet a:ext
|
||||
<a href="http://${1:example.com}">${0:$1}</a>
|
||||
snippet a:mail
|
||||
<a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${0:email me}</a>
|
||||
snippet abbr
|
||||
<abbr title="${1}">${0}</abbr>
|
||||
snippet address
|
||||
<address>
|
||||
${0}
|
||||
</address>
|
||||
snippet area
|
||||
<area shape="${1:rect}" coords="${2}" href="${3}" alt="${0}" />
|
||||
snippet area+
|
||||
<area shape="${1:rect}" coords="${2}" href="${3}" alt="${4}" />
|
||||
area+
|
||||
snippet area:c
|
||||
<area shape="circle" coords="${1}" href="${2}" alt="${0}" />
|
||||
snippet area:d
|
||||
<area shape="default" coords="${1}" href="${2}" alt="${0}" />
|
||||
snippet area:p
|
||||
<area shape="poly" coords="${1}" href="${2}" alt="${0}" />
|
||||
snippet area:r
|
||||
<area shape="rect" coords="${1}" href="${2}" alt="${0}" />
|
||||
snippet article
|
||||
<article>
|
||||
${0}
|
||||
</article>
|
||||
snippet article.
|
||||
<article class="${1}">
|
||||
${0}
|
||||
</article>
|
||||
snippet article#
|
||||
<article id="${1}">
|
||||
${0}
|
||||
</article>
|
||||
snippet aside
|
||||
<aside>
|
||||
${0}
|
||||
</aside>
|
||||
snippet aside.
|
||||
<aside class="${1}">
|
||||
${0}
|
||||
</aside>
|
||||
snippet aside#
|
||||
<aside id="${1}">
|
||||
${0}
|
||||
</aside>
|
||||
snippet audio
|
||||
<audio src="${1}>${0}</audio>
|
||||
snippet b
|
||||
<b>${0}</b>
|
||||
snippet base
|
||||
<base href="${1}" target="${0}" />
|
||||
snippet bdi
|
||||
<bdi>${0}</bdo>
|
||||
snippet bdo
|
||||
<bdo dir="${1}">${0}</bdo>
|
||||
snippet bdo:l
|
||||
<bdo dir="ltr">${0}</bdo>
|
||||
snippet bdo:r
|
||||
<bdo dir="rtl">${0}</bdo>
|
||||
snippet blockquote
|
||||
<blockquote>
|
||||
${0}
|
||||
</blockquote>
|
||||
snippet body
|
||||
<body>
|
||||
${0}
|
||||
</body>
|
||||
snippet br
|
||||
<br />
|
||||
snippet button
|
||||
<button type="${1:submit}">${0}</button>
|
||||
snippet button.
|
||||
<button class="${1:button}" type="${2:submit}">${0}</button>
|
||||
snippet button#
|
||||
<button id="${1}" type="${2:submit}">${0}</button>
|
||||
snippet button:s
|
||||
<button type="submit">${0}</button>
|
||||
snippet button:r
|
||||
<button type="reset">${0}</button>
|
||||
snippet canvas
|
||||
<canvas>
|
||||
${0}
|
||||
</canvas>
|
||||
snippet caption
|
||||
<caption>${0}</caption>
|
||||
snippet cite
|
||||
<cite>${0}</cite>
|
||||
snippet code
|
||||
<code>${0}</code>
|
||||
snippet col
|
||||
<col />
|
||||
snippet col+
|
||||
<col />
|
||||
col+
|
||||
snippet colgroup
|
||||
<colgroup>
|
||||
${0}
|
||||
</colgroup>
|
||||
snippet colgroup+
|
||||
<colgroup>
|
||||
<col />
|
||||
col+${0}
|
||||
</colgroup>
|
||||
snippet command
|
||||
<command type="command" label="${1}" icon="${0}" />
|
||||
snippet command:c
|
||||
<command type="checkbox" label="${1}" icon="${0}" />
|
||||
snippet command:r
|
||||
<command type="radio" radiogroup="${1}" label="${2}" icon="${0}" />
|
||||
snippet datagrid
|
||||
<datagrid>
|
||||
${0}
|
||||
</datagrid>
|
||||
snippet datalist
|
||||
<datalist>
|
||||
${0}
|
||||
</datalist>
|
||||
snippet datatemplate
|
||||
<datatemplate>
|
||||
${0}
|
||||
</datatemplate>
|
||||
snippet dd
|
||||
<dd>${0}</dd>
|
||||
snippet dd.
|
||||
<dd class="${1}">${0}</dd>
|
||||
snippet dd#
|
||||
<dd id="${1}">${0}</dd>
|
||||
snippet del
|
||||
<del>${0}</del>
|
||||
snippet details
|
||||
<details>${0}</details>
|
||||
snippet dfn
|
||||
<dfn>${0}</dfn>
|
||||
snippet dialog
|
||||
<dialog>
|
||||
${0}
|
||||
</dialog>
|
||||
snippet div
|
||||
<div>
|
||||
${0}
|
||||
</div>
|
||||
snippet div.
|
||||
<div class="${1}">
|
||||
${0}
|
||||
</div>
|
||||
snippet div#
|
||||
<div id="${1}">
|
||||
${0}
|
||||
</div>
|
||||
snippet dl
|
||||
<dl>
|
||||
${0}
|
||||
</dl>
|
||||
snippet dl.
|
||||
<dl class="${1}">
|
||||
${0}
|
||||
</dl>
|
||||
snippet dl#
|
||||
<dl id="${1}">
|
||||
${0}
|
||||
</dl>
|
||||
snippet dl+
|
||||
<dl>
|
||||
<dt>${1}</dt>
|
||||
<dd>${2}</dd>
|
||||
dt+${0}
|
||||
</dl>
|
||||
snippet dt
|
||||
<dt>${0}</dt>
|
||||
snippet dt.
|
||||
<dt class="${1}">${0}</dt>
|
||||
snippet dt#
|
||||
<dt id="${1}">${0}</dt>
|
||||
snippet dt+
|
||||
<dt>${1}</dt>
|
||||
<dd>${2}</dd>
|
||||
dt+${0}
|
||||
snippet em
|
||||
<em>${0}</em>
|
||||
snippet embed
|
||||
<embed src=${1} type="${0} />
|
||||
snippet fieldset
|
||||
<fieldset>
|
||||
${0}
|
||||
</fieldset>
|
||||
snippet fieldset.
|
||||
<fieldset class="${1}">
|
||||
${0}
|
||||
</fieldset>
|
||||
snippet fieldset#
|
||||
<fieldset id="${1}">
|
||||
${0}
|
||||
</fieldset>
|
||||
snippet fieldset+
|
||||
<fieldset>
|
||||
<legend><span>${1}</span></legend>
|
||||
${2}
|
||||
</fieldset>
|
||||
fieldset+${0}
|
||||
snippet figcaption
|
||||
<figcaption>${0}</figcaption>
|
||||
snippet figure
|
||||
<figure>${0}</figure>
|
||||
snippet footer
|
||||
<footer>
|
||||
${0}
|
||||
</footer>
|
||||
snippet footer.
|
||||
<footer class="${1}">
|
||||
${0}
|
||||
</footer>
|
||||
snippet footer#
|
||||
<footer id="${1}">
|
||||
${0}
|
||||
</footer>
|
||||
snippet form
|
||||
<form action="${1}" method="${2:post}">
|
||||
${0}
|
||||
</form>
|
||||
snippet form.
|
||||
<form class="${1}" action="${2}" method="${3:post}">
|
||||
${0}
|
||||
</form>
|
||||
snippet form#
|
||||
<form id="${1}" action="${2}" method="${3:post}">
|
||||
${0}
|
||||
</form>
|
||||
snippet h1
|
||||
<h1>${0}</h1>
|
||||
snippet h1.
|
||||
<h1 class="${1}">${0}</h1>
|
||||
snippet h1#
|
||||
<h1 id="${1}">${0}</h1>
|
||||
snippet h2
|
||||
<h2>${0}</h2>
|
||||
snippet h2.
|
||||
<h2 class="${1}">${0}</h2>
|
||||
snippet h2#
|
||||
<h2 id="${1}">${0}</h2>
|
||||
snippet h3
|
||||
<h3>${0}</h3>
|
||||
snippet h3.
|
||||
<h3 class="${1}">${0}</h3>
|
||||
snippet h3#
|
||||
<h3 id="${1}">${0}</h3>
|
||||
snippet h4
|
||||
<h4>${0}</h4>
|
||||
snippet h4.
|
||||
<h4 class="${1}">${0}</h4>
|
||||
snippet h4#
|
||||
<h4 id="${1}">${0}</h4>
|
||||
snippet h5
|
||||
<h5>${0}</h5>
|
||||
snippet h5.
|
||||
<h5 class="${1}">${0}</h5>
|
||||
snippet h5#
|
||||
<h5 id="${1}">${0}</h5>
|
||||
snippet h6
|
||||
<h6>${0}</h6>
|
||||
snippet h6.
|
||||
<h6 class="${1}">${0}</h6>
|
||||
snippet h6#
|
||||
<h6 id="${1}">${0}</h6>
|
||||
snippet head
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
|
||||
${0}
|
||||
</head>
|
||||
snippet header
|
||||
<header>
|
||||
${0}
|
||||
</header>
|
||||
snippet header.
|
||||
<header class="${1}">
|
||||
${0}
|
||||
</header>
|
||||
snippet header#
|
||||
<header id="${1}">
|
||||
${0}
|
||||
</header>
|
||||
snippet hgroup
|
||||
<hgroup>
|
||||
${0}
|
||||
</hgroup>
|
||||
snippet hgroup.
|
||||
<hgroup class="${1}>
|
||||
${0}
|
||||
</hgroup>
|
||||
snippet hr
|
||||
<hr />
|
||||
snippet html
|
||||
<html>
|
||||
${0}
|
||||
</html>
|
||||
snippet xhtml
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
${0}
|
||||
</html>
|
||||
snippet html5
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
|
||||
${2:meta}
|
||||
</head>
|
||||
<body>
|
||||
${0:body}
|
||||
</body>
|
||||
</html>
|
||||
snippet i
|
||||
<i>${0}</i>
|
||||
snippet iframe
|
||||
<iframe src="${1}" frameborder="0"></iframe>
|
||||
snippet iframe.
|
||||
<iframe class="${1}" src="${2}" frameborder="0"></iframe>
|
||||
snippet iframe#
|
||||
<iframe id="${1}" src="${2}" frameborder="0"></iframe>
|
||||
snippet img
|
||||
<img src="${1}" alt="${2}" />
|
||||
snippet img.
|
||||
<img class="${1}" src="${2}" alt="${3}" />
|
||||
snippet img#
|
||||
<img id="${1}" src="${2}" alt="${3}" />
|
||||
snippet input
|
||||
<input type="${1:text/submit/hidden/button/image}" name="${2}" id="${3:$2}" value="${4}" />
|
||||
snippet input.
|
||||
<input class="${1}" type="${2:text/submit/hidden/button/image}" name="${3}" id="${4:$3}" value="${5}" />
|
||||
snippet input:text
|
||||
<input type="text" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:submit
|
||||
<input type="submit" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:hidden
|
||||
<input type="hidden" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:button
|
||||
<input type="button" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:image
|
||||
<input type="image" name="${1}" id="${2:$1}" src="${3}" alt="${4}" />
|
||||
snippet input:checkbox
|
||||
<input type="checkbox" name="${1}" id="${2:$1}" />
|
||||
snippet input:radio
|
||||
<input type="radio" name="${1}" id="${2:$1}" />
|
||||
snippet input:color
|
||||
<input type="color" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:date
|
||||
<input type="date" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:datetime
|
||||
<input type="datetime" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:datetime-local
|
||||
<input type="datetime-local" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:email
|
||||
<input type="email" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:file
|
||||
<input type="file" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:month
|
||||
<input type="month" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:number
|
||||
<input type="number" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:password
|
||||
<input type="password" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:range
|
||||
<input type="range" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:reset
|
||||
<input type="reset" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:search
|
||||
<input type="search" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:time
|
||||
<input type="time" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:url
|
||||
<input type="url" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet input:week
|
||||
<input type="week" name="${1}" id="${2:$1}" value="${3}" />
|
||||
snippet ins
|
||||
<ins>${0}</ins>
|
||||
snippet kbd
|
||||
<kbd>${0}</kbd>
|
||||
snippet keygen
|
||||
<keygen>${0}</keygen>
|
||||
snippet label
|
||||
<label for="${0:$1}">${1}</label>
|
||||
snippet label:i
|
||||
<label for="${2:$1}">${1}</label>
|
||||
<input type="${3:text/submit/hidden/button}" name="${4:$2}" id="${5:$2}" value="${6}" />
|
||||
snippet label:s
|
||||
<label for="${2:$1}">${1}</label>
|
||||
<select name="${3:$2}" id="${4:$2}">
|
||||
<option value="${5}">${0:$5}</option>
|
||||
</select>
|
||||
snippet legend
|
||||
<legend>${0}</legend>
|
||||
snippet legend+
|
||||
<legend><span>${0}</span></legend>
|
||||
snippet li
|
||||
<li>${0}</li>
|
||||
snippet li.
|
||||
<li class="${1}">${0}</li>
|
||||
snippet li+
|
||||
<li>${1}</li>
|
||||
li+
|
||||
snippet lia
|
||||
<li><a href="${0:#}">${1}</a></li>
|
||||
snippet lia+
|
||||
<li><a href="${2:#}">${1}</a></li>
|
||||
lia+
|
||||
snippet link
|
||||
<link rel="${1}" href="${2}" title="${3}" type="${4}" />
|
||||
snippet link:atom
|
||||
<link rel="alternate" href="${1:atom.xml}" title="Atom" type="application/atom+xml" />
|
||||
snippet link:css
|
||||
<link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}" />
|
||||
snippet link:favicon
|
||||
<link rel="shortcut icon" href="${1:favicon.ico}" type="image/x-icon" />
|
||||
snippet link:rss
|
||||
<link rel="alternate" href="${1:rss.xml}" title="RSS" type="application/atom+xml" />
|
||||
snippet link:touch
|
||||
<link rel="apple-touch-icon" href="${1:favicon.png}" />
|
||||
snippet map
|
||||
<map name="${1}">
|
||||
${0}
|
||||
</map>
|
||||
snippet map.
|
||||
<map class="${1}" name="${2}">
|
||||
${0}
|
||||
</map>
|
||||
snippet map#
|
||||
<map name="${1}" id="${2:$1}>
|
||||
${0}
|
||||
</map>
|
||||
snippet map+
|
||||
<map name="${1}">
|
||||
<area shape="${2}" coords="${3}" href="${4}" alt="${5}" />${6}
|
||||
</map>
|
||||
snippet mark
|
||||
<mark>${0}</mark>
|
||||
snippet menu
|
||||
<menu>
|
||||
${0}
|
||||
</menu>
|
||||
snippet menu:c
|
||||
<menu type="context">
|
||||
${0}
|
||||
</menu>
|
||||
snippet menu:t
|
||||
<menu type="toolbar">
|
||||
${0}
|
||||
</menu>
|
||||
snippet meta
|
||||
<meta http-equiv="${1}" content="${2}" />
|
||||
snippet meta:compat
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=${1:7,8,edge}" />
|
||||
snippet meta:refresh
|
||||
<meta http-equiv="refresh" content="text/html;charset=UTF-8" />
|
||||
snippet meta:utf
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
||||
snippet meter
|
||||
<meter>${0}</meter>
|
||||
snippet nav
|
||||
<nav>
|
||||
${0}
|
||||
</nav>
|
||||
snippet nav.
|
||||
<nav class="${1}">
|
||||
${0}
|
||||
</nav>
|
||||
snippet nav#
|
||||
<nav id="${1}">
|
||||
${0}
|
||||
</nav>
|
||||
snippet noscript
|
||||
<noscript>
|
||||
${0}
|
||||
</noscript>
|
||||
snippet object
|
||||
<object data="${1}" type="${2}">
|
||||
${3}
|
||||
</object>
|
||||
# Embed QT Movie
|
||||
snippet movie
|
||||
<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
|
||||
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
|
||||
<param name="src" value="$1" />
|
||||
<param name="controller" value="$4" />
|
||||
<param name="autoplay" value="$5" />
|
||||
<embed src="${1:movie.mov}"
|
||||
width="${2:320}" height="${3:240}"
|
||||
controller="${4:true}" autoplay="${5:true}"
|
||||
scale="tofit" cache="true"
|
||||
pluginspage="http://www.apple.com/quicktime/download/" />
|
||||
</object>
|
||||
snippet ol
|
||||
<ol>
|
||||
${0}
|
||||
</ol>
|
||||
snippet ol.
|
||||
<ol class="${1}>
|
||||
${0}
|
||||
</ol>
|
||||
snippet ol#
|
||||
<ol id="${1}>
|
||||
${0}
|
||||
</ol>
|
||||
snippet ol+
|
||||
<ol>
|
||||
<li>${1}</li>
|
||||
li+${0}
|
||||
</ol>
|
||||
snippet opt
|
||||
<option value="${1}">${0:$1}</option>
|
||||
snippet opt+
|
||||
<option value="${1}">${2:$1}</option>
|
||||
opt+${0}
|
||||
snippet optt
|
||||
<option>${0}</option>
|
||||
snippet optgroup
|
||||
<optgroup>
|
||||
<option value="${1}">${2:$1}</option>
|
||||
opt+${0}
|
||||
</optgroup>
|
||||
snippet output
|
||||
<output>${0}</output>
|
||||
snippet p
|
||||
<p>${0}</p>
|
||||
snippet param
|
||||
<param name="${1}" value="${2}" />
|
||||
snippet pre
|
||||
<pre>
|
||||
${0}
|
||||
</pre>
|
||||
snippet progress
|
||||
<progress>${0}</progress>
|
||||
snippet q
|
||||
<q>${0}</q>
|
||||
snippet rp
|
||||
<rp>${0}</rp>
|
||||
snippet rt
|
||||
<rt>${0}</rt>
|
||||
snippet ruby
|
||||
<ruby>
|
||||
<rp><rt>${0}</rt></rp>
|
||||
</ruby>
|
||||
snippet s
|
||||
<s>${0}</s>
|
||||
snippet samp
|
||||
<samp>
|
||||
${0}
|
||||
</samp>
|
||||
snippet script
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
${0}
|
||||
</script>
|
||||
snippet scriptsrc
|
||||
<script src="${0}.js" type="text/javascript" charset="utf-8"></script>
|
||||
snippet section
|
||||
<section>
|
||||
${0}
|
||||
</section>
|
||||
snippet section.
|
||||
<section class="${1}">
|
||||
${0}
|
||||
</section>
|
||||
snippet section#
|
||||
<section id="${1}">
|
||||
${0}
|
||||
</section>
|
||||
snippet select
|
||||
<select name="${1}" id="${2:$1}">
|
||||
${0}
|
||||
</select>
|
||||
snippet select.
|
||||
<select name="${1}" id="${2:$1}" class="${3}>
|
||||
${0}
|
||||
</select>
|
||||
snippet select+
|
||||
<select name="${1}" id="${2:$1}">
|
||||
<option value="${3}">${4:$3}</option>
|
||||
opt+${0}
|
||||
</select>
|
||||
snippet small
|
||||
<small>${0}</small>
|
||||
snippet source
|
||||
<source src="${1}" type="${2}" media="${0}" />
|
||||
snippet span
|
||||
<span>${0}</span>
|
||||
snippet span.
|
||||
<span class="${1}">${0}</span>
|
||||
snippet span#
|
||||
<span id="${1}">${0}</span>
|
||||
snippet strong
|
||||
<strong>${0}</strong>
|
||||
snippet style
|
||||
<style type="text/css" media="${1:all}">
|
||||
${0}
|
||||
</style>
|
||||
snippet sub
|
||||
<sub>${0}</sub>
|
||||
snippet summary
|
||||
<summary>
|
||||
${0}
|
||||
</summary>
|
||||
snippet sup
|
||||
<sup>${0}</sup>
|
||||
snippet table
|
||||
<table>
|
||||
${0}
|
||||
</table>
|
||||
snippet table.
|
||||
<table class="${1}">
|
||||
${0}
|
||||
</table>
|
||||
snippet table#
|
||||
<table id="${1}">
|
||||
${0}
|
||||
</table>
|
||||
snippet tbody
|
||||
<tbody>
|
||||
${0}
|
||||
</tbody>
|
||||
snippet td
|
||||
<td>${0}</td>
|
||||
snippet td.
|
||||
<td class="${1}">${0}</td>
|
||||
snippet td#
|
||||
<td id="${1}">${0}</td>
|
||||
snippet td+
|
||||
<td>${1}</td>
|
||||
td+${0}
|
||||
snippet textarea
|
||||
<textarea name="${1}" id=${2:$1} rows="${3:8}" cols="${4:40}">${5}</textarea>
|
||||
snippet tfoot
|
||||
<tfoot>
|
||||
${0}
|
||||
</tfoot>
|
||||
snippet th
|
||||
<th>${0}</th>
|
||||
snippet th.
|
||||
<th class="${1}">${0}</th>
|
||||
snippet th#
|
||||
<th id="${1}">${0}</th>
|
||||
snippet th+
|
||||
<th>${1}</th>
|
||||
th+${0}
|
||||
snippet thead
|
||||
<thead>
|
||||
${0}
|
||||
</thead>
|
||||
snippet time
|
||||
<time datetime="${1}" pubdate="${2:$1}">${0:$1}</time>
|
||||
snippet title
|
||||
<title>${0:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
|
||||
snippet tr
|
||||
<tr>
|
||||
${0}
|
||||
</tr>
|
||||
snippet tr+
|
||||
<tr>
|
||||
<td>${1}</td>
|
||||
td+${0}
|
||||
</tr>
|
||||
snippet track
|
||||
<track src="${1}" srclang="${2}" label="${3}" default="${4:default}>${5}</track>
|
||||
snippet ul
|
||||
<ul>
|
||||
${0}
|
||||
</ul>
|
||||
snippet ul.
|
||||
<ul class="${1}">
|
||||
${0}
|
||||
</ul>
|
||||
snippet ul#
|
||||
<ul id="${1}">
|
||||
${0}
|
||||
</ul>
|
||||
snippet ul+
|
||||
<ul>
|
||||
<li>${1}</li>
|
||||
li+${0}
|
||||
</ul>
|
||||
snippet var
|
||||
<var>${0}</var>
|
||||
snippet video
|
||||
<video src="${1} height="${2}" width="${3}" preload="${5:none}" autoplay="${6:autoplay}>${7}</video>
|
||||
snippet wbr
|
||||
<wbr />
|
72
bundle/vim-snippets/snippets/html_minimal.snippets
Normal file
72
bundle/vim-snippets/snippets/html_minimal.snippets
Normal file
@ -0,0 +1,72 @@
|
||||
# file containing most useful mappings only
|
||||
# when editing this file please be aware that there is ZenCoding and sparkup
|
||||
|
||||
# html 5 is recommended from now on
|
||||
snippet html5
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>$2</title>
|
||||
$3
|
||||
</head>
|
||||
<body>
|
||||
$4
|
||||
</body>
|
||||
</html>
|
||||
|
||||
# ==== TAGS
|
||||
# you always need these:
|
||||
snippet .
|
||||
class="${1}"
|
||||
snippet n
|
||||
name="${1}"
|
||||
snippet r
|
||||
rel="${1}"
|
||||
snippet t
|
||||
title="${1}"
|
||||
|
||||
# not using # because id is faster to type
|
||||
snippet id
|
||||
id="${1}"
|
||||
snippet idn
|
||||
id="${1}" name="${0:$1}"
|
||||
|
||||
snippet label_and_input
|
||||
<label for="${0:$1}">${1}</label>
|
||||
<input type="${3:text}" name="${4:$2}" id="${5:$2}" value="${6}">
|
||||
|
||||
|
||||
# FORMS
|
||||
# use idn . or n to add id
|
||||
snippet input
|
||||
<input type="${1:text}" value="${2}" ${3}>
|
||||
snippet submit
|
||||
<input type="submit" value="${2}" ${3}>
|
||||
snippet textarea
|
||||
<textarea $1>$2</textarea>
|
||||
|
||||
# if you need id or class use snippets above
|
||||
snippet form
|
||||
<form method="${1:post/get}" action="$2">
|
||||
$3
|
||||
</form>
|
||||
|
||||
# other tags
|
||||
snippet br
|
||||
<br/>
|
||||
snippet a
|
||||
<a href="#" $2>$3</a>
|
||||
snippet img
|
||||
<img src="$1" alt="$2"/>
|
||||
# JS/CSS
|
||||
snippet css_file
|
||||
<link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}">
|
||||
snippet css_block
|
||||
<style type='text/css'>
|
||||
</style>
|
||||
snippet script_block
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
</script>
|
||||
snippet script_file
|
||||
<script src="${1}" type="text/javascript"></script>
|
141
bundle/vim-snippets/snippets/htmldjango.snippets
Normal file
141
bundle/vim-snippets/snippets/htmldjango.snippets
Normal file
@ -0,0 +1,141 @@
|
||||
# Generic tags
|
||||
|
||||
snippet %
|
||||
{% ${1} %}
|
||||
snippet %%
|
||||
{% ${1:tag_name} %}
|
||||
${0}
|
||||
{% end$1 %}
|
||||
snippet {
|
||||
{{ ${1} }}
|
||||
# Template Tags
|
||||
|
||||
snippet autoescape
|
||||
{% autoescape ${1:off} %}
|
||||
${0}
|
||||
{% endautoescape %}
|
||||
snippet block
|
||||
{% block ${1} %}
|
||||
${0}
|
||||
{% endblock %}
|
||||
snippet #
|
||||
{# ${0:comment} #}
|
||||
snippet comment
|
||||
{% comment %}
|
||||
${0}
|
||||
{% endcomment %}
|
||||
snippet cycle
|
||||
{% cycle ${1:val1} ${2:val2} ${3:as ${4}} %}
|
||||
snippet debug
|
||||
{% debug %}
|
||||
snippet extends
|
||||
{% extends "${0:base.html}" %}
|
||||
snippet filter
|
||||
{% filter ${1} %}
|
||||
${0}
|
||||
{% endfilter %}
|
||||
snippet firstof
|
||||
{% firstof ${1} %}
|
||||
snippet for
|
||||
{% for ${1} in ${2} %}
|
||||
${0}
|
||||
{% endfor %}
|
||||
snippet empty
|
||||
{% empty %}
|
||||
${0}
|
||||
snippet if
|
||||
{% if ${1} %}
|
||||
${0}
|
||||
{% endif %}
|
||||
snippet el
|
||||
{% else %}
|
||||
${1}
|
||||
snippet eif
|
||||
{% elif ${1} %}
|
||||
${0}
|
||||
snippet ifchanged
|
||||
{% ifchanged %}${1}{% endifchanged %}
|
||||
snippet ifequal
|
||||
{% ifequal ${1} ${2} %}
|
||||
${0}
|
||||
{% endifequal %}
|
||||
snippet ifnotequal
|
||||
{% ifnotequal ${1} ${2} %}
|
||||
${0}
|
||||
{% endifnotequal %}
|
||||
snippet include
|
||||
{% include "${0}" %}
|
||||
snippet load
|
||||
{% load ${0} %}
|
||||
snippet now
|
||||
{% now "${0:jS F Y H:i}" %}
|
||||
snippet regroup
|
||||
{% regroup ${1} by ${2} as ${0} %}
|
||||
snippet spaceless
|
||||
{% spaceless %}${0}{% endspaceless %}
|
||||
snippet ssi
|
||||
{% ssi ${0} %}
|
||||
snippet trans
|
||||
{% trans "${0:string}" %}
|
||||
snippet url
|
||||
{% url ${1} as ${0} %}
|
||||
snippet widthratio
|
||||
{% widthratio ${1:this_value} ${2:max_value} ${0:100} %}
|
||||
snippet with
|
||||
{% with ${1} as ${2} %}
|
||||
${0}
|
||||
{% endwith %}
|
||||
|
||||
# Template Filters
|
||||
|
||||
# Note: Since SnipMate can't determine which template filter you are
|
||||
# expanding without the "|" character, these do not add the "|"
|
||||
# character. These save a few keystrokes still.
|
||||
|
||||
# Note: Template tags that take no arguments are not implemented.
|
||||
|
||||
snippet add
|
||||
add:"${0}"
|
||||
snippet center
|
||||
center:"${0}"
|
||||
snippet cut
|
||||
cut:"${0}"
|
||||
snippet date
|
||||
date:"${0}"
|
||||
snippet default
|
||||
default:"${0}"
|
||||
snippet defaultifnone
|
||||
default_if_none:"${0}"
|
||||
snippet dictsort
|
||||
dictsort:"${0}"
|
||||
snippet dictsortrev
|
||||
dictsortreversed:"${0}"
|
||||
snippet divisibleby
|
||||
divisibleby:"${0}"
|
||||
snippet floatformat
|
||||
floatformat:"${0}"
|
||||
snippet getdigit
|
||||
get_digit:"${0}"
|
||||
snippet join
|
||||
join:"${0}"
|
||||
snippet lengthis
|
||||
length_is:"${0}"
|
||||
snippet pluralize
|
||||
pluralize:"${0}"
|
||||
snippet removetags
|
||||
removetags:"${0}"
|
||||
snippet slice
|
||||
slice:"${0}"
|
||||
snippet stringformat
|
||||
stringformat:"${0}"
|
||||
snippet time
|
||||
time:"${0}"
|
||||
snippet truncatewords
|
||||
truncatewords:${0}
|
||||
snippet truncatewordshtml
|
||||
truncatewords_html:${0}
|
||||
snippet urlizetrunc
|
||||
urlizetrunc:${0}
|
||||
snippet wordwrap
|
||||
wordwrap:${0}
|
||||
|
55
bundle/vim-snippets/snippets/htmltornado.snippets
Normal file
55
bundle/vim-snippets/snippets/htmltornado.snippets
Normal file
@ -0,0 +1,55 @@
|
||||
# Generic tags
|
||||
|
||||
snippet {
|
||||
{{ ${0} }}
|
||||
|
||||
# Template tags
|
||||
|
||||
snippet extends
|
||||
{% extends "${0:base.html}" %}
|
||||
snippet autoescape
|
||||
{% autoescape ${0:xhtml_escape | None} %}
|
||||
snippet apply
|
||||
{% apply ${1:function} %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet block
|
||||
{% block ${1} %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet for
|
||||
{% for ${1:item} in ${2} %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet from
|
||||
{% from ${1:x} import ${0:y} %}
|
||||
snippet if
|
||||
{% if ${1:condition} %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet eif
|
||||
{% elif ${0:condition} %}
|
||||
snippet el
|
||||
{% else %}
|
||||
snippet import
|
||||
{% import ${0:module} %}
|
||||
snippet include
|
||||
{% include "${0:filename}" %}
|
||||
snippet module
|
||||
{% module ${0:expression} %}
|
||||
snippet raw
|
||||
{% raw ${0:expression} %}
|
||||
snippet set
|
||||
{% set ${1:x} = ${0:y} %}
|
||||
snippet try
|
||||
{% try %}
|
||||
${1}
|
||||
{% except %}
|
||||
${2}
|
||||
{% finallly %}
|
||||
${0}
|
||||
{% end %}
|
||||
snippet wh
|
||||
{% while ${1:condition} %}
|
||||
${0}
|
||||
{% end %}
|
240
bundle/vim-snippets/snippets/java.snippets
Normal file
240
bundle/vim-snippets/snippets/java.snippets
Normal file
@ -0,0 +1,240 @@
|
||||
## Access Modifiers
|
||||
snippet po
|
||||
protected
|
||||
snippet pu
|
||||
public
|
||||
snippet pr
|
||||
private
|
||||
##
|
||||
## Annotations
|
||||
snippet before
|
||||
@Before
|
||||
static void ${1:intercept}(${2:args}) { ${0} }
|
||||
snippet mm
|
||||
@ManyToMany
|
||||
${0}
|
||||
snippet mo
|
||||
@ManyToOne
|
||||
${0}
|
||||
snippet om
|
||||
@OneToMany${1:(cascade=CascadeType.ALL)}
|
||||
${0}
|
||||
snippet oo
|
||||
@OneToOne
|
||||
${1}
|
||||
##
|
||||
## Basic Java packages and import
|
||||
snippet im
|
||||
import
|
||||
snippet j.b
|
||||
java.beans.
|
||||
snippet j.i
|
||||
java.io.
|
||||
snippet j.m
|
||||
java.math.
|
||||
snippet j.n
|
||||
java.net.
|
||||
snippet j.u
|
||||
java.util.
|
||||
##
|
||||
## Class
|
||||
snippet cl
|
||||
class ${1:`vim_snippets#Filename("", "untitled")`} ${0}
|
||||
snippet in
|
||||
interface ${1:`vim_snippets#Filename("", "untitled")`} ${2:extends Parent}
|
||||
snippet tc
|
||||
public class ${1:`vim_snippets#Filename()`} extends ${0:TestCase}
|
||||
##
|
||||
## Class Enhancements
|
||||
snippet ext
|
||||
extends
|
||||
snippet imp
|
||||
implements
|
||||
##
|
||||
## Comments
|
||||
snippet /*
|
||||
/*
|
||||
* ${0}
|
||||
*/
|
||||
##
|
||||
## Constants
|
||||
snippet co
|
||||
static public final ${1:String} ${2:var} = ${3};
|
||||
snippet cos
|
||||
static public final String ${1:var} = "${2}";
|
||||
##
|
||||
## Control Statements
|
||||
snippet case
|
||||
case ${1}:
|
||||
${0}
|
||||
snippet def
|
||||
default:
|
||||
${0}
|
||||
snippet el
|
||||
else
|
||||
snippet eif
|
||||
else if (${1}) ${0}
|
||||
snippet if
|
||||
if (${1}) ${0}
|
||||
snippet sw
|
||||
switch (${1}) {
|
||||
${0}
|
||||
}
|
||||
##
|
||||
## Create a Method
|
||||
snippet m
|
||||
${1:void} ${2:method}(${3}) ${4:throws }
|
||||
##
|
||||
## Create a Variable
|
||||
snippet v
|
||||
${1:String} ${2:var}${3: = null}${4};
|
||||
##
|
||||
## Enhancements to Methods, variables, classes, etc.
|
||||
snippet ab
|
||||
abstract
|
||||
snippet fi
|
||||
final
|
||||
snippet st
|
||||
static
|
||||
snippet sy
|
||||
synchronized
|
||||
##
|
||||
## Error Methods
|
||||
snippet err
|
||||
System.err.print("${0:Message}");
|
||||
snippet errf
|
||||
System.err.printf("${1:Message}", ${0:exception});
|
||||
snippet errln
|
||||
System.err.println("${0:Message}");
|
||||
##
|
||||
## Exception Handling
|
||||
snippet as
|
||||
assert ${1:test} : "${2:Failure message}";
|
||||
snippet ca
|
||||
catch(${1:Exception} ${2:e}) ${0}
|
||||
snippet thr
|
||||
throw
|
||||
snippet ths
|
||||
throws
|
||||
snippet try
|
||||
try {
|
||||
${0}
|
||||
} catch(${1:Exception} ${2:e}) {
|
||||
}
|
||||
snippet tryf
|
||||
try {
|
||||
${0}
|
||||
} catch(${1:Exception} ${2:e}) {
|
||||
} finally {
|
||||
}
|
||||
##
|
||||
## Find Methods
|
||||
snippet findall
|
||||
List<${1:listName}> ${2:items} = ${1}.findAll();
|
||||
snippet findbyid
|
||||
${1:var} ${2:item} = ${1}.findById(${3});
|
||||
##
|
||||
## Javadocs
|
||||
snippet /**
|
||||
/**
|
||||
* ${0}
|
||||
*/
|
||||
snippet @au
|
||||
@author `system("grep \`id -un\` /etc/passwd | cut -d \":\" -f5 | cut -d \",\" -f1")`
|
||||
snippet @br
|
||||
@brief ${0:Description}
|
||||
snippet @fi
|
||||
@file ${0:`vim_snippets#Filename()`}.java
|
||||
snippet @pa
|
||||
@param ${0:param}
|
||||
snippet @re
|
||||
@return ${0:param}
|
||||
##
|
||||
## Logger Methods
|
||||
snippet debug
|
||||
Logger.debug(${1:param});
|
||||
snippet error
|
||||
Logger.error(${1:param});
|
||||
snippet info
|
||||
Logger.info(${1:param});
|
||||
snippet warn
|
||||
Logger.warn(${1:param});
|
||||
##
|
||||
## Loops
|
||||
snippet enfor
|
||||
for (${1} : ${2}) ${0}
|
||||
snippet for
|
||||
for (${1}; ${2}; ${3}) ${0}
|
||||
snippet wh
|
||||
while (${1}) ${0}
|
||||
##
|
||||
## Main method
|
||||
snippet main
|
||||
public static void main (String[] args) {
|
||||
${0}
|
||||
}
|
||||
##
|
||||
## Print Methods
|
||||
snippet print
|
||||
System.out.print("${0:Message}");
|
||||
snippet printf
|
||||
System.out.printf("${1:Message}", ${0:args});
|
||||
snippet println
|
||||
System.out.println(${0});
|
||||
##
|
||||
## Render Methods
|
||||
snippet ren
|
||||
render(${1:param});
|
||||
snippet rena
|
||||
renderArgs.put("${1}", ${2});
|
||||
snippet renb
|
||||
renderBinary(${1:param});
|
||||
snippet renj
|
||||
renderJSON(${1:param});
|
||||
snippet renx
|
||||
renderXml(${1:param});
|
||||
##
|
||||
## Setter and Getter Methods
|
||||
snippet set
|
||||
${1:public} void set${3:}(${2:String} ${0:}){
|
||||
this.$4 = $4;
|
||||
}
|
||||
snippet get
|
||||
${1:public} ${2:String} get${3:}(){
|
||||
return this.${0:};
|
||||
}
|
||||
##
|
||||
## Terminate Methods or Loops
|
||||
snippet re
|
||||
return
|
||||
snippet br
|
||||
break;
|
||||
##
|
||||
## Test Methods
|
||||
snippet t
|
||||
public void test${1:Name}() throws Exception {
|
||||
${0}
|
||||
}
|
||||
snippet test
|
||||
@Test
|
||||
public void test${1:Name}() throws Exception {
|
||||
${0}
|
||||
}
|
||||
##
|
||||
## Utils
|
||||
snippet Sc
|
||||
Scanner
|
||||
##
|
||||
## Miscellaneous
|
||||
snippet action
|
||||
public static void ${1:index}(${2:args}) { ${0} }
|
||||
snippet rnf
|
||||
notFound(${1:param});
|
||||
snippet rnfin
|
||||
notFoundIfNull(${1:param});
|
||||
snippet rr
|
||||
redirect(${1:param});
|
||||
snippet ru
|
||||
unauthorized(${1:param});
|
||||
snippet unless
|
||||
(unless=${1:param});
|
@ -0,0 +1,589 @@
|
||||
snippet add
|
||||
${1:obj}.add('${2:selector expression}')
|
||||
snippet addClass
|
||||
${1:obj}.addClass('${2:class name}')
|
||||
snippet after
|
||||
${1:obj}.after('${2:Some text <b>and bold!</b>}')
|
||||
snippet ajax
|
||||
$.ajax({
|
||||
url: '${1:mydomain.com/url}',
|
||||
type: '${2:POST}',
|
||||
dataType: '${3:xml/html/script/json}',
|
||||
data: $.param( $('${4:Element or Expression}') ),
|
||||
complete: function (jqXHR, textStatus) {
|
||||
${5:// callback}
|
||||
},
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
${6:// success callback}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
${0:// error callback}
|
||||
}
|
||||
});
|
||||
snippet ajaxcomplete
|
||||
${1:obj}.ajaxComplete(function (${1:e}, xhr, settings) {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet ajaxerror
|
||||
${1:obj}.ajaxError(function (${1:e}, xhr, settings, thrownError) {
|
||||
${2:// error callback}
|
||||
});
|
||||
${0}
|
||||
snippet ajaxget
|
||||
$.get('${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
function (data, textStatus, jqXHR) {
|
||||
${0:// success callback}
|
||||
}
|
||||
);
|
||||
snippet ajaxpost
|
||||
$.post('${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
function (data, textStatus, jqXHR) {
|
||||
${0:// success callback}
|
||||
}
|
||||
);
|
||||
snippet ajaxprefilter
|
||||
$.ajaxPrefilter(function (${1:options}, ${2:originalOptions}, jqXHR) {
|
||||
${0: // Modify options, control originalOptions, store jqXHR, etc}
|
||||
});
|
||||
snippet ajaxsend
|
||||
${1:obj}.ajaxSend(function (${1:request, settings}) {
|
||||
${2:// error callback}
|
||||
});
|
||||
${0}
|
||||
snippet ajaxsetup
|
||||
$.ajaxSetup({
|
||||
url: "${1:mydomain.com/url}",
|
||||
type: "${2:POST}",
|
||||
dataType: "${3:xml/html/script/json}",
|
||||
data: $.param( $("${4:Element or Expression}") ),
|
||||
complete: function (jqXHR, textStatus) {
|
||||
${5:// callback}
|
||||
},
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
${6:// success callback}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
${0:// error callback}
|
||||
}
|
||||
});
|
||||
snippet ajaxstart
|
||||
$.ajaxStart(function () {
|
||||
${1:// handler for when an AJAX call is started and no other AJAX calls are in progress};
|
||||
});
|
||||
${0}
|
||||
snippet ajaxstop
|
||||
$.ajaxStop(function () {
|
||||
${1:// handler for when all AJAX calls have been completed};
|
||||
});
|
||||
${0}
|
||||
snippet ajaxsuccess
|
||||
$.ajaxSuccess(function (${1:e}, xhr, settings) {
|
||||
${2:// handler for when any AJAX call is successfully completed};
|
||||
});
|
||||
${0}
|
||||
snippet andself
|
||||
${1:obj}.andSelf()
|
||||
snippet animate
|
||||
${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed})
|
||||
snippet append
|
||||
${1:obj}.append('${2:Some text <b>and bold!</b>}')
|
||||
snippet appendTo
|
||||
${1:obj}.appendTo('${2:selector expression}')
|
||||
snippet attr
|
||||
${1:obj}.attr('${2:attribute}', '${3:value}')
|
||||
snippet attrm
|
||||
${1:obj}.attr({'${2:attr1}': '${3:value1}', '${4:attr2}': '${5:value2}'})
|
||||
snippet before
|
||||
${1:obj}.before('${2:Some text <b>and bold!</b>}')
|
||||
snippet bind
|
||||
${1:obj}.bind('${2:event name}', function (${3:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet blur
|
||||
${1:obj}.blur(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet C
|
||||
$.Callbacks()
|
||||
snippet Cadd
|
||||
${1:callbacks}.add(${2:callbacks})
|
||||
snippet Cdis
|
||||
${1:callbacks}.disable()
|
||||
snippet Cempty
|
||||
${1:callbacks}.empty()
|
||||
snippet Cfire
|
||||
${1:callbacks}.fire(${2:args})
|
||||
snippet Cfired
|
||||
${1:callbacks}.fired()
|
||||
snippet Cfirew
|
||||
${1:callbacks}.fireWith(${2:this}, ${3:args})
|
||||
snippet Chas
|
||||
${1:callbacks}.has(${2:callback})
|
||||
snippet Clock
|
||||
${1:callbacks}.lock()
|
||||
snippet Clocked
|
||||
${1:callbacks}.locked()
|
||||
snippet Crem
|
||||
${1:callbacks}.remove(${2:callbacks})
|
||||
snippet change
|
||||
${1:obj}.change(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet children
|
||||
${1:obj}.children('${2:selector expression}')
|
||||
snippet clearq
|
||||
${1:obj}.clearQueue(${2:'queue name'})
|
||||
snippet click
|
||||
${1:obj}.click(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet clone
|
||||
${1:obj}.clone()
|
||||
snippet contains
|
||||
$.contains(${1:container}, ${0:contents});
|
||||
snippet css
|
||||
${1:obj}.css('${2:attribute}', '${3:value}')
|
||||
snippet csshooks
|
||||
$.cssHooks['${1:CSS prop}'] = {
|
||||
get: function (elem, computed, extra) {
|
||||
${2: // handle getting the CSS property}
|
||||
},
|
||||
set: function (elem, value) {
|
||||
${0: // handle setting the CSS value}
|
||||
}
|
||||
};
|
||||
snippet cssm
|
||||
${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'})
|
||||
snippet D
|
||||
$.Deferred()
|
||||
snippet Dalways
|
||||
${1:deferred}.always(${2:callbacks})
|
||||
snippet Ddone
|
||||
${1:deferred}.done(${2:callbacks})
|
||||
snippet Dfail
|
||||
${1:deferred}.fail(${2:callbacks})
|
||||
snippet Disrej
|
||||
${1:deferred}.isRejected()
|
||||
snippet Disres
|
||||
${1:deferred}.isResolved()
|
||||
snippet Dnotify
|
||||
${1:deferred}.notify(${2:args})
|
||||
snippet Dnotifyw
|
||||
${1:deferred}.notifyWith(${2:this}, ${3:args})
|
||||
snippet Dpipe
|
||||
${1:deferred}.then(${2:doneFilter}, ${3:failFilter}, ${4:progressFilter})
|
||||
snippet Dprog
|
||||
${1:deferred}.progress(${2:callbacks})
|
||||
snippet Dprom
|
||||
${1:deferred}.promise(${2:target})
|
||||
snippet Drej
|
||||
${1:deferred}.reject(${2:args})
|
||||
snippet Drejw
|
||||
${1:deferred}.rejectWith(${2:this}, ${3:args})
|
||||
snippet Dres
|
||||
${1:deferred}.resolve(${2:args})
|
||||
snippet Dresw
|
||||
${1:deferred}.resolveWith(${2:this}, ${3:args})
|
||||
snippet Dstate
|
||||
${1:deferred}.state()
|
||||
snippet Dthen
|
||||
${1:deferred}.then(${2:doneCallbacks}, ${3:failCallbacks}, ${4:progressCallbacks})
|
||||
snippet Dwhen
|
||||
$.when(${1:deferreds})
|
||||
snippet data
|
||||
${1:obj}.data(${2:obj})
|
||||
snippet dataa
|
||||
$.data('${1:selector expression}', '${2:key}'${3:, 'value'})
|
||||
snippet dblclick
|
||||
${1:obj}.dblclick(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet delay
|
||||
${1:obj}.delay('${2:slow/400/fast}'${3:, 'queue name'})
|
||||
snippet dele
|
||||
${1:obj}.delegate('${2:selector expression}', '${3:event name}', function (${4:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet deq
|
||||
${1:obj}.dequeue(${2:'queue name'})
|
||||
snippet deqq
|
||||
$.dequeue('${1:selector expression}'${2:, 'queue name'})
|
||||
snippet detach
|
||||
${1:obj}.detach('${2:selector expression}')
|
||||
snippet die
|
||||
${1:obj}.die(${2:event}, ${3:handler})
|
||||
snippet each
|
||||
${1:obj}.each(function (index) {
|
||||
${0:this.innerHTML = this + " is the element, " + index + " is the position";}
|
||||
});
|
||||
snippet el
|
||||
$('<${1}/>'${2:, {}})
|
||||
snippet eltrim
|
||||
$.trim('${1:string}')
|
||||
snippet empty
|
||||
${1:obj}.empty()
|
||||
snippet end
|
||||
${1:obj}.end()
|
||||
snippet eq
|
||||
${1:obj}.eq(${2:element index})
|
||||
snippet error
|
||||
${1:obj}.error(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet eventsmap
|
||||
{
|
||||
:f${0}
|
||||
}
|
||||
snippet extend
|
||||
$.extend(${1:true, }${2:target}, ${3:obj})
|
||||
snippet fadein
|
||||
${1:obj}.fadeIn('${2:slow/400/fast}')
|
||||
snippet fadeinc
|
||||
${1:obj}.fadeIn('slow/400/fast', function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet fadeout
|
||||
${1:obj}.fadeOut('${2:slow/400/fast}')
|
||||
snippet fadeoutc
|
||||
${1:obj}.fadeOut('slow/400/fast', function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet fadeto
|
||||
${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5})
|
||||
snippet fadetoc
|
||||
${1:obj}.fadeTo('slow/400/fast', ${2:0.5}, function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet filter
|
||||
${1:obj}.filter('${2:selector expression}')
|
||||
snippet filtert
|
||||
${1:obj}.filter(function (${2:index}) {
|
||||
${3}
|
||||
})
|
||||
snippet find
|
||||
${1:obj}.find('${2:selector expression}')
|
||||
snippet focus
|
||||
${1:obj}.focus(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet focusin
|
||||
${1:obj}.focusIn(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet focusout
|
||||
${1:obj}.focusOut(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet get
|
||||
${1:obj}.get(${2:element index})
|
||||
snippet getjson
|
||||
$.getJSON('${1:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
function (data, textStatus, jqXHR) {
|
||||
${0:// success callback}
|
||||
}
|
||||
);
|
||||
snippet getscript
|
||||
$.getScript('${1:mydomain.com/url}', function (script, textStatus, jqXHR) {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet grep
|
||||
$.grep(${1:array}, function (item, index) {
|
||||
${2}
|
||||
}${0:, true});
|
||||
snippet hasc
|
||||
${1:obj}.hasClass('${2:className}')
|
||||
snippet hasd
|
||||
$.hasData('${0:selector expression}');
|
||||
snippet height
|
||||
${1:obj}.height(${2:integer})
|
||||
snippet hide
|
||||
${1:obj}.hide('${2:slow/400/fast}')
|
||||
snippet hidec
|
||||
${1:obj}.hide('${2:slow/400/fast}', function () {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet hover
|
||||
${1:obj}.hover(function (${2:e}) {
|
||||
${3:// event handler}
|
||||
}, function ($2) {
|
||||
${4:// event handler}
|
||||
});
|
||||
snippet html
|
||||
${1:obj}.html('${2:Some text <b>and bold!</b>}')
|
||||
snippet inarr
|
||||
$.inArray(${1:value}, ${0:array});
|
||||
snippet insa
|
||||
${1:obj}.insertAfter('${2:selector expression}')
|
||||
snippet insb
|
||||
${1:obj}.insertBefore('${2:selector expression}')
|
||||
snippet is
|
||||
${1:obj}.is('${2:selector expression}')
|
||||
snippet isarr
|
||||
$.isArray(${1:obj})
|
||||
snippet isempty
|
||||
$.isEmptyObject(${1:obj})
|
||||
snippet isfunc
|
||||
$.isFunction(${1:obj})
|
||||
snippet isnum
|
||||
$.isNumeric(${1:value})
|
||||
snippet isobj
|
||||
$.isPlainObject(${1:obj})
|
||||
snippet iswin
|
||||
$.isWindow(${1:obj})
|
||||
snippet isxml
|
||||
$.isXMLDoc(${1:node})
|
||||
snippet jj
|
||||
$('${1:selector}')
|
||||
snippet kdown
|
||||
${1:obj}.keydown(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet kpress
|
||||
${1:obj}.keypress(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet kup
|
||||
${1:obj}.keyup(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet last
|
||||
${1:obj}.last('${1:selector expression}')
|
||||
snippet live
|
||||
${1:obj}.live('${2:events}', function (${3:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet load
|
||||
${1:obj}.load(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet loadf
|
||||
${1:obj}.load('${2:mydomain.com/url}',
|
||||
${2:{ param1: value1 },}
|
||||
function (responseText, textStatus, xhr) {
|
||||
${0:// success callback}
|
||||
}
|
||||
});
|
||||
snippet makearray
|
||||
$.makeArray(${0:obj});
|
||||
snippet map
|
||||
${1:obj}.map(function (${2:index}, ${3:element}) {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet mapp
|
||||
$.map(${1:arrayOrObject}, function (${2:value}, ${3:indexOrKey}) {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet merge
|
||||
$.merge(${1:target}, ${0:original});
|
||||
snippet mdown
|
||||
${1:obj}.mousedown(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet menter
|
||||
${1:obj}.mouseenter(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mleave
|
||||
${1:obj}.mouseleave(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mmove
|
||||
${1:obj}.mousemove(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mout
|
||||
${1:obj}.mouseout(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mover
|
||||
${1:obj}.mouseover(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet mup
|
||||
${1:obj}.mouseup(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet next
|
||||
${1:obj}.next('${2:selector expression}')
|
||||
snippet nexta
|
||||
${1:obj}.nextAll('${2:selector expression}')
|
||||
snippet nextu
|
||||
${1:obj}.nextUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet not
|
||||
${1:obj}.not('${2:selector expression}')
|
||||
snippet off
|
||||
${1:obj}.off('${2:events}', '${3:selector expression}'${4:, handler})
|
||||
snippet offset
|
||||
${1:obj}.offset()
|
||||
snippet offsetp
|
||||
${1:obj}.offsetParent()
|
||||
snippet on
|
||||
${1:obj}.on('${2:events}', '${3:selector expression}', function (${4:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet one
|
||||
${1:obj}.one('${2:event name}', function (${3:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet outerh
|
||||
${1:obj}.outerHeight()
|
||||
snippet outerw
|
||||
${1:obj}.outerWidth()
|
||||
snippet param
|
||||
$.param(${1:obj})
|
||||
snippet parent
|
||||
${1:obj}.parent('${2:selector expression}')
|
||||
snippet parents
|
||||
${1:obj}.parents('${2:selector expression}')
|
||||
snippet parentsu
|
||||
${1:obj}.parentsUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet parsejson
|
||||
$.parseJSON(${1:data})
|
||||
snippet parsexml
|
||||
$.parseXML(${1:data})
|
||||
snippet pos
|
||||
${1:obj}.position()
|
||||
snippet prepend
|
||||
${1:obj}.prepend('${2:Some text <b>and bold!</b>}')
|
||||
snippet prependto
|
||||
${1:obj}.prependTo('${2:selector expression}')
|
||||
snippet prev
|
||||
${1:obj}.prev('${2:selector expression}')
|
||||
snippet preva
|
||||
${1:obj}.prevAll('${2:selector expression}')
|
||||
snippet prevu
|
||||
${1:obj}.prevUntil('${2:selector expression}'${3:, 'filter expression'})
|
||||
snippet promise
|
||||
${1:obj}.promise(${2:'fx'}, ${3:target})
|
||||
snippet prop
|
||||
${1:obj}.prop('${2:property name}')
|
||||
snippet proxy
|
||||
$.proxy(${1:function}, ${2:this})
|
||||
snippet pushstack
|
||||
${1:obj}.pushStack(${2:elements})
|
||||
snippet queue
|
||||
${1:obj}.queue(${2:name}${3:, newQueue})
|
||||
snippet queuee
|
||||
$.queue(${1:element}${2:, name}${3:, newQueue})
|
||||
snippet ready
|
||||
$(function () {
|
||||
${0}
|
||||
});
|
||||
snippet rem
|
||||
${1:obj}.remove()
|
||||
snippet rema
|
||||
${1:obj}.removeAttr('${2:attribute name}')
|
||||
snippet remc
|
||||
${1:obj}.removeClass('${2:class name}')
|
||||
snippet remd
|
||||
${1:obj}.removeData('${2:key name}')
|
||||
snippet remdd
|
||||
$.removeData(${1:element}${2:, 'key name}')
|
||||
snippet remp
|
||||
${1:obj}.removeProp('${2:property name}')
|
||||
snippet repa
|
||||
${1:obj}.replaceAll(${2:target})
|
||||
snippet repw
|
||||
${1:obj}.replaceWith(${2:content})
|
||||
snippet reset
|
||||
${1:obj}.reset(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet resize
|
||||
${1:obj}.resize(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet scroll
|
||||
${1:obj}.scroll(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet scrolll
|
||||
${1:obj}.scrollLeft(${2:value})
|
||||
snippet scrollt
|
||||
${1:obj}.scrollTop(${2:value})
|
||||
snippet sdown
|
||||
${1:obj}.slideDown('${2:slow/400/fast}')
|
||||
snippet sdownc
|
||||
${1:obj}.slideDown('${2:slow/400/fast}', function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet select
|
||||
${1:obj}.select(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet serialize
|
||||
${1:obj}.serialize()
|
||||
snippet serializea
|
||||
${1:obj}.serializeArray()
|
||||
snippet show
|
||||
${1:obj}.show('${2:slow/400/fast}')
|
||||
snippet showc
|
||||
${1:obj}.show('${2:slow/400/fast}', function () {
|
||||
${0:// callback}
|
||||
});
|
||||
snippet sib
|
||||
${1:obj}.siblings('${2:selector expression}')
|
||||
snippet size
|
||||
${1:obj}.size()
|
||||
snippet slice
|
||||
${1:obj}.slice(${2:start}${3:, end})
|
||||
snippet stoggle
|
||||
${1:obj}.slideToggle('${2:slow/400/fast}')
|
||||
snippet stop
|
||||
${1:obj}.stop('${2:queue}', ${3:false}, ${4:false})
|
||||
snippet submit
|
||||
${1:obj}.submit(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet sup
|
||||
${1:obj}.slideUp('${2:slow/400/fast}')
|
||||
snippet supc
|
||||
${1:obj}.slideUp('${2:slow/400/fast}', function () {
|
||||
${0:// callback};
|
||||
});
|
||||
snippet text
|
||||
${1:obj}.text(${2:'some text'})
|
||||
snippet this
|
||||
$(this)
|
||||
snippet toarr
|
||||
${0:obj}.toArray()
|
||||
snippet tog
|
||||
${1:obj}.toggle(function (${2:e}) {
|
||||
${3:// event handler}
|
||||
}, function ($2) {
|
||||
${4:// event handler}
|
||||
});
|
||||
${0}
|
||||
snippet togclass
|
||||
${1:obj}.toggleClass('${2:class name}')
|
||||
snippet togsh
|
||||
${1:obj}.toggle('${2:slow/400/fast}')
|
||||
snippet trig
|
||||
${1:obj}.trigger('${2:event name}')
|
||||
snippet trigh
|
||||
${1:obj}.triggerHandler('${2:event name}')
|
||||
snippet $trim
|
||||
$.trim(${1:str})
|
||||
snippet $type
|
||||
$.type(${1:obj})
|
||||
snippet unbind
|
||||
${1:obj}.unbind('${2:event name}')
|
||||
snippet undele
|
||||
${1:obj}.undelegate(${2:selector expression}, ${3:event}, ${4:handler})
|
||||
snippet uniq
|
||||
$.unique(${1:array})
|
||||
snippet unload
|
||||
${1:obj}.unload(function (${2:e}) {
|
||||
${0:// event handler}
|
||||
});
|
||||
snippet unwrap
|
||||
${1:obj}.unwrap()
|
||||
snippet val
|
||||
${1:obj}.val('${2:text}')
|
||||
snippet width
|
||||
${1:obj}.width(${2:integer})
|
||||
snippet wrap
|
||||
${1:obj}.wrap('${2:<div class="extra-wrapper"></div>}')
|
@ -0,0 +1,30 @@
|
||||
snippet .attr
|
||||
.attr("${1}", ${2})
|
||||
snippet .style
|
||||
.style("${1}", ${2})
|
||||
snippet axis
|
||||
d3.svg.axis()
|
||||
.orient(${1})
|
||||
.scale(${2})
|
||||
snippet fd
|
||||
function(d) { ${1} }
|
||||
snippet fdi
|
||||
function(d, i) { ${1} }
|
||||
snippet marginconvention
|
||||
var ${1:margin} = { top: ${2:10}, right: ${3:10}, bottom: ${4:10}, left: ${5:10} };
|
||||
var ${6:width} = ${7:970} - $1.left - $1.right;
|
||||
var ${8:height} = ${9:500} - $1.top - $1.bottom;
|
||||
|
||||
var ${10:svg} = d3.select("${11}").append("svg")
|
||||
.attr("width", $6)
|
||||
.attr("height", $8)
|
||||
.append("g")
|
||||
.attr("transform", "translate(" + $1.left + "," + $1.top + ")")
|
||||
snippet nest
|
||||
d3.nest()
|
||||
.key(${1})
|
||||
.entries(${2})
|
||||
snippet scale
|
||||
d3.scale.linear()
|
||||
.domain(${1})
|
||||
.range(${2})
|
200
bundle/vim-snippets/snippets/javascript/javascript.snippets
Normal file
200
bundle/vim-snippets/snippets/javascript/javascript.snippets
Normal file
@ -0,0 +1,200 @@
|
||||
# Prototype
|
||||
snippet proto
|
||||
${1:class_name}.prototype.${2:method_name} =
|
||||
function(${3:first_argument}) {
|
||||
${0:// body...}
|
||||
};
|
||||
# Function
|
||||
snippet fun
|
||||
function ${1:function_name}(${2:argument}) {
|
||||
${0:// body...}
|
||||
}
|
||||
# Anonymous Function
|
||||
snippet f
|
||||
function (${1}) {
|
||||
${0}
|
||||
}${2:;}
|
||||
# Immediate function
|
||||
snippet (f
|
||||
(function (${1}) {
|
||||
${0}
|
||||
}(${2}));
|
||||
# if
|
||||
snippet if
|
||||
if (${1:true}) {
|
||||
${0}
|
||||
}
|
||||
# if ... else
|
||||
snippet ife
|
||||
if (${1:true}) {
|
||||
${2}
|
||||
} else {
|
||||
${0}
|
||||
}
|
||||
# tertiary conditional
|
||||
snippet ter
|
||||
${1:/* condition */} ? ${2:a} : ${0:b}
|
||||
# switch
|
||||
snippet switch
|
||||
switch (${1:expression}) {
|
||||
case '${3:case}':
|
||||
${4}
|
||||
break;
|
||||
${0}
|
||||
default:
|
||||
${2}
|
||||
}
|
||||
# case
|
||||
snippet case
|
||||
case '${1:case}':
|
||||
${2}
|
||||
break;
|
||||
${0}
|
||||
# for (...) {...}
|
||||
snippet for
|
||||
for (var ${2:i} = 0, l = ${1:arr}.length; $2 < l; $2 ++) {
|
||||
var ${3:v} = $1[$2];${0:}
|
||||
}
|
||||
# for (...) {...} (Improved Native For-Loop)
|
||||
snippet forr
|
||||
for (var ${2:i} = ${1:arr}.length - 1; $2 >= 0; $2 --) {
|
||||
var ${3:v} = $1[$2];${0:}
|
||||
}
|
||||
# while (...) {...}
|
||||
snippet wh
|
||||
while (${1:/* condition */}) {
|
||||
${0}
|
||||
}
|
||||
# try
|
||||
snippet try
|
||||
try {
|
||||
${1}
|
||||
} catch (${2:e}) {
|
||||
${0:/* handle error */}
|
||||
}
|
||||
# do...while
|
||||
snippet do
|
||||
do {
|
||||
${0}
|
||||
} while (${1:/* condition */});
|
||||
# Object Method
|
||||
snippet :f
|
||||
${1:method_name}: function (${2:attribute}) {
|
||||
${0}
|
||||
}${3:,}
|
||||
# setTimeout function
|
||||
snippet timeout
|
||||
setTimeout(function () {${0}}${2}, ${1:10});
|
||||
# Get Elements
|
||||
snippet get
|
||||
getElementsBy${1:TagName}('${2}')
|
||||
# Get Element
|
||||
snippet gett
|
||||
getElementBy${1:Id}('${2}')
|
||||
# console.log (Firebug)
|
||||
snippet cl
|
||||
console.log(${0});
|
||||
# return
|
||||
snippet ret
|
||||
return ${0:result}
|
||||
# for (property in object ) { ... }
|
||||
snippet fori
|
||||
for (var ${1:prop} in ${2:Things}) {
|
||||
${0:$2[$1]}
|
||||
}
|
||||
# hasOwnProperty
|
||||
snippet has
|
||||
hasOwnProperty(${0})
|
||||
# docstring
|
||||
snippet /**
|
||||
/**
|
||||
* ${0:description}
|
||||
*
|
||||
*/
|
||||
snippet @par
|
||||
@param {${1:type}} ${2:name} ${0:description}
|
||||
snippet @ret
|
||||
@return {${1:type}} ${0:description}
|
||||
# JSON.parse
|
||||
snippet jsonp
|
||||
JSON.parse(${0:jstr});
|
||||
# JSON.stringify
|
||||
snippet jsons
|
||||
JSON.stringify(${0:object});
|
||||
# self-defining function
|
||||
snippet sdf
|
||||
var ${1:function_name} = function (${2:argument}) {
|
||||
${3}
|
||||
|
||||
$1 = function ($2) {
|
||||
${0}
|
||||
};
|
||||
};
|
||||
# singleton
|
||||
snippet sing
|
||||
function ${1:Singleton} (${2:argument}) {
|
||||
// the cached instance
|
||||
var instance;
|
||||
|
||||
// rewrite the constructor
|
||||
$1 = function $1($2) {
|
||||
return instance;
|
||||
};
|
||||
|
||||
// carry over the prototype properties
|
||||
$1.prototype = this;
|
||||
|
||||
// the instance
|
||||
instance = new $1();
|
||||
|
||||
// reset the constructor pointer
|
||||
instance.constructor = $1;
|
||||
|
||||
${0}
|
||||
|
||||
return instance;
|
||||
}
|
||||
# Crockford's object function
|
||||
snippet obj
|
||||
function object(o) {
|
||||
function F() {}
|
||||
F.prototype = o;
|
||||
return new F();
|
||||
}
|
||||
# Define multiple properties
|
||||
snippet props
|
||||
var ${1:my_object} = Object.defineProperties(
|
||||
${2:new Object()},
|
||||
{
|
||||
${3:property} : {
|
||||
get : function $1_$3_getter() {
|
||||
// getter code
|
||||
},
|
||||
set : function $1_$3_setter(value) {
|
||||
// setter code
|
||||
},
|
||||
value : ${4:value},
|
||||
writeable : ${5:boolean},
|
||||
enumerable : ${6:boolean},
|
||||
configurable : ${0:boolean}
|
||||
}
|
||||
}
|
||||
);
|
||||
# Define single property
|
||||
snippet prop
|
||||
Object.defineProperty(
|
||||
${1:object},
|
||||
"${2:property}",
|
||||
{
|
||||
get : function $1_$2_getter() {
|
||||
// getter code
|
||||
},
|
||||
set : function $1_$2_setter(value) {
|
||||
// setter code
|
||||
},
|
||||
value : ${3:value},
|
||||
writeable : ${4:boolean},
|
||||
enumerable : ${5:boolean},
|
||||
configurable : ${0:boolean}
|
||||
}
|
||||
);
|
99
bundle/vim-snippets/snippets/jsp.snippets
Normal file
99
bundle/vim-snippets/snippets/jsp.snippets
Normal file
@ -0,0 +1,99 @@
|
||||
snippet @page
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
snippet jstl
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
snippet jstl:c
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
snippet jstl:fn
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
snippet cpath
|
||||
${pageContext.request.contextPath}
|
||||
snippet cout
|
||||
<c:out value="${1}" default="${0}" />
|
||||
snippet cset
|
||||
<c:set var="${1}" value="${0}" />
|
||||
snippet cremove
|
||||
<c:remove var="${1}" scope="${0:page}" />
|
||||
snippet ccatch
|
||||
<c:catch var="${0}" />
|
||||
snippet cif
|
||||
<c:if test="${${1}}">
|
||||
${0}
|
||||
</c:if>
|
||||
snippet cchoose
|
||||
<c:choose>
|
||||
${0}
|
||||
</c:choose>
|
||||
snippet cwhen
|
||||
<c:when test="${${1}}">
|
||||
${0}
|
||||
</c:when>
|
||||
snippet cother
|
||||
<c:otherwise>
|
||||
${0}
|
||||
</c:otherwise>
|
||||
snippet cfore
|
||||
<c:forEach items="${${1}}" var="${2}" varStatus="${3}">
|
||||
${0:<c:out value="$2" />}
|
||||
</c:forEach>
|
||||
snippet cfort
|
||||
<c:set var="${1}">${2:item1,item2,item3}</c:set>
|
||||
<c:forTokens var="${3}" items="${$1}" delims="${4:,}">
|
||||
${0:<c:out value="$3" />}
|
||||
</c:forTokens>
|
||||
snippet cparam
|
||||
<c:param name="${1}" value="${0}" />
|
||||
snippet cparam+
|
||||
<c:param name="${1}" value="${2}" />
|
||||
cparam+${0}
|
||||
snippet cimport
|
||||
<c:import url="${1}" />
|
||||
snippet cimport+
|
||||
<c:import url="${1}">
|
||||
<c:param name="${2}" value="${3}" />
|
||||
cparam+${0}
|
||||
</c:import>
|
||||
snippet curl
|
||||
<c:url value="${1}" var="${2}" />
|
||||
<a href="${$2}">${0}</a>
|
||||
snippet curl+
|
||||
<c:url value="${1}" var="${2}">
|
||||
<c:param name="${4}" value="${5}" />
|
||||
cparam+${0}
|
||||
</c:url>
|
||||
<a href="${$2}">${3}</a>
|
||||
snippet credirect
|
||||
<c:redirect url="${0}" />
|
||||
snippet contains
|
||||
${fn:contains(${1:string}, ${0:substr})}
|
||||
snippet contains:i
|
||||
${fn:containsIgnoreCase(${1:string}, ${0:substr})}
|
||||
snippet endswith
|
||||
${fn:endsWith(${1:string}, ${0:suffix})}
|
||||
snippet escape
|
||||
${fn:escapeXml(${0:string})}
|
||||
snippet indexof
|
||||
${fn:indexOf(${1:string}, ${0:substr})}
|
||||
snippet join
|
||||
${fn:join(${1:collection}, ${0:delims})}
|
||||
snippet length
|
||||
${fn:length(${0:collection_or_string})}
|
||||
snippet replace
|
||||
${fn:replace(${1:string}, ${2:substr}, ${0:replace})}
|
||||
snippet split
|
||||
${fn:split(${1:string}, ${0:delims})}
|
||||
snippet startswith
|
||||
${fn:startsWith(${1:string}, ${0:prefix})}
|
||||
snippet substr
|
||||
${fn:substring(${1:string}, ${2:begin}, ${0:end})}
|
||||
snippet substr:a
|
||||
${fn:substringAfter(${1:string}, ${0:substr})}
|
||||
snippet substr:b
|
||||
${fn:substringBefore(${1:string}, ${0:substr})}
|
||||
snippet lc
|
||||
${fn:toLowerCase(${0:string})}
|
||||
snippet uc
|
||||
${fn:toUpperCase(${0:string})}
|
||||
snippet trim
|
||||
${fn:trim(${0:string})}
|
5
bundle/vim-snippets/snippets/ledger.snippets
Normal file
5
bundle/vim-snippets/snippets/ledger.snippets
Normal file
@ -0,0 +1,5 @@
|
||||
# Ledger <http://ledger-cli.org/>
|
||||
snippet ent
|
||||
`strftime("%Y/%m/%d")` ${1:transaction}
|
||||
${2:account} ${3:value}
|
||||
${0:account}
|
108
bundle/vim-snippets/snippets/ls.snippets
Normal file
108
bundle/vim-snippets/snippets/ls.snippets
Normal file
@ -0,0 +1,108 @@
|
||||
# Closure loop
|
||||
snippet forinlet
|
||||
for ${1:name} in ${2:array}
|
||||
let $1
|
||||
${3}
|
||||
# Array comprehension
|
||||
snippet fora
|
||||
for ${1:name} in ${2:array}
|
||||
${3}
|
||||
# Object comprehension
|
||||
snippet foro
|
||||
for ${1:key}, ${2:value} of ${3:object}
|
||||
${4}
|
||||
# Range comprehension (inclusive)
|
||||
snippet forr
|
||||
for ${1:name} from ${2:start} to ${3:finish}
|
||||
${4}
|
||||
snippet forrb
|
||||
for ${1:name} from ${2:start} to ${3:finish} by ${4:step}
|
||||
${5}
|
||||
# Range comprehension (exclusive)
|
||||
snippet forrex
|
||||
for ${1:name} from ${2:start} til ${3:finish}
|
||||
${4}
|
||||
snippet forrexb
|
||||
for ${1:name} from ${2:start} til ${3:finish} by ${4:step}
|
||||
${5}
|
||||
# Function
|
||||
snippet fun
|
||||
(${1:args}) ->
|
||||
${2}
|
||||
# Function (bound)
|
||||
snippet bfun
|
||||
(${1:args}) ~>
|
||||
${2}
|
||||
# Class
|
||||
snippet cla class ..
|
||||
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
${2}
|
||||
snippet cla class .. constructor: ..
|
||||
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
(${2:args}) ->
|
||||
${3}
|
||||
|
||||
${4}
|
||||
snippet cla class .. extends ..
|
||||
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
|
||||
${3}
|
||||
snippet cla class .. extends .. constructor: ..
|
||||
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
|
||||
(${3:args}) ->
|
||||
${4}
|
||||
|
||||
${5}
|
||||
# If
|
||||
snippet if
|
||||
if ${1:condition}
|
||||
${2}
|
||||
# If __ Else
|
||||
snippet ife
|
||||
if ${1:condition}
|
||||
${2}
|
||||
else
|
||||
${3}
|
||||
# Else if
|
||||
snippet elif
|
||||
else if ${1:condition}
|
||||
${2}
|
||||
# Ternary If
|
||||
snippet ifte
|
||||
if ${1:condition} then ${2:value} else ${3:other}
|
||||
# Unless
|
||||
snippet unl
|
||||
${1:action} unless ${2:condition}
|
||||
# Switch
|
||||
snippet swi
|
||||
switch ${1:object}
|
||||
case ${2:value}
|
||||
${3}
|
||||
default void
|
||||
snippet mat
|
||||
match ${1:object}
|
||||
| ${2:value} => ${3}
|
||||
| otherwise => void
|
||||
|
||||
# Log
|
||||
snippet log
|
||||
console.log ${1}
|
||||
# stringify
|
||||
snippet str
|
||||
JSON.stringify ${1}, void, 2
|
||||
|
||||
# Try __ Catch
|
||||
snippet try
|
||||
try
|
||||
${1}
|
||||
catch ${2:error}
|
||||
${3}
|
||||
# Require
|
||||
snippet req
|
||||
${2:$1} = require '${1}'${3}
|
||||
# Require!
|
||||
snippet req!
|
||||
require! ${1}
|
||||
|
||||
# Export
|
||||
snippet exp
|
||||
${1:root} = exports ? this
|
21
bundle/vim-snippets/snippets/lua.snippets
Normal file
21
bundle/vim-snippets/snippets/lua.snippets
Normal file
@ -0,0 +1,21 @@
|
||||
snippet #!
|
||||
#!/usr/bin/env lua
|
||||
$1
|
||||
snippet local
|
||||
local ${1:x} = ${0:1}
|
||||
snippet fun
|
||||
function ${1:fname}(${2:...})
|
||||
${0:-- body}
|
||||
end
|
||||
snippet for
|
||||
for ${1:i}=${2:1},${3:10} do
|
||||
${0:print(i)}
|
||||
end
|
||||
snippet forp
|
||||
for ${1:i},${2:v} in pairs(${3:table_name}) do
|
||||
${0:-- body}
|
||||
end
|
||||
snippet fori
|
||||
for ${1:i},${2:v} in ipairs(${3:table_name}) do
|
||||
${0:-- body}
|
||||
end
|
4
bundle/vim-snippets/snippets/make.snippets
Normal file
4
bundle/vim-snippets/snippets/make.snippets
Normal file
@ -0,0 +1,4 @@
|
||||
snippet ifeq
|
||||
ifeq (${1:cond0},${2:cond1})
|
||||
${0}
|
||||
endif
|
54
bundle/vim-snippets/snippets/mako.snippets
Normal file
54
bundle/vim-snippets/snippets/mako.snippets
Normal file
@ -0,0 +1,54 @@
|
||||
snippet def
|
||||
<%def name="${1:name}">
|
||||
${0:}
|
||||
</%def>
|
||||
snippet call
|
||||
<%call expr="${1:name}">
|
||||
${0:}
|
||||
</%call>
|
||||
snippet doc
|
||||
<%doc>
|
||||
${0:}
|
||||
</%doc>
|
||||
snippet text
|
||||
<%text>
|
||||
${0:}
|
||||
</%text>
|
||||
snippet for
|
||||
% for ${1:i} in ${2:iter}:
|
||||
${0:}
|
||||
% endfor
|
||||
snippet if if
|
||||
% if ${1:condition}:
|
||||
${0:}
|
||||
% endif
|
||||
snippet ife if/else
|
||||
% if ${1:condition}:
|
||||
${2:}
|
||||
% else:
|
||||
${0:}
|
||||
% endif
|
||||
snippet try
|
||||
% try:
|
||||
${1:}
|
||||
% except${2:}:
|
||||
${0:pass}
|
||||
% endtry
|
||||
snippet wh
|
||||
% while ${1:}:
|
||||
${0:}
|
||||
% endwhile
|
||||
snippet $
|
||||
${ ${0:} }
|
||||
snippet <%
|
||||
<% ${0:} %>
|
||||
snippet <!%
|
||||
<!% ${0:} %>
|
||||
snippet inherit
|
||||
<%inherit file="${0:filename}" />
|
||||
snippet include
|
||||
<%include file="${0:filename}" />
|
||||
snippet namespace
|
||||
<%namespace file="${0:name}" />
|
||||
snippet page
|
||||
<%page args="${0:}" />
|
87
bundle/vim-snippets/snippets/markdown.snippets
Normal file
87
bundle/vim-snippets/snippets/markdown.snippets
Normal file
@ -0,0 +1,87 @@
|
||||
# Markdown
|
||||
|
||||
# Includes octopress (http://octopress.org/) snippets
|
||||
|
||||
snippet [
|
||||
[${1:text}](http://${2:address} "${0:title}")
|
||||
snippet [*
|
||||
[${1:link}](${2:`@*`} "${3:title}")
|
||||
|
||||
snippet [:
|
||||
[${1:id}]: http://${2:url} "${0:title}"
|
||||
snippet [:*
|
||||
[${1:id}]: ${2:`@*`} "${0:title}"
|
||||
|
||||
snippet 
|
||||
snippet 
|
||||
|
||||
snippet ![:
|
||||
![${1:id}]: ${2:url} "${0:title}"
|
||||
snippet ![:*
|
||||
![${1:id}]: ${2:`@*`} "${0:title}"
|
||||
|
||||
snippet ===
|
||||
`repeat('=', strlen(getline(line(".") - 1)) - strlen(getline('.')))`
|
||||
|
||||
${0}
|
||||
snippet ---
|
||||
`repeat('-', strlen(getline(line(".") - 1)) - strlen(getline('.')))`
|
||||
|
||||
${0}
|
||||
|
||||
snippet blockquote
|
||||
{% blockquote %}
|
||||
${0:quote}
|
||||
{% endblockquote %}
|
||||
|
||||
snippet blockquote-author
|
||||
{% blockquote ${1:author}, ${2:title} %}
|
||||
${0:quote}
|
||||
{% endblockquote %}
|
||||
|
||||
snippet blockquote-link
|
||||
{% blockquote ${1:author} ${2:URL} ${3:link_text} %}
|
||||
${0:quote}
|
||||
{% endblockquote %}
|
||||
|
||||
snippet bt-codeblock-short
|
||||
```
|
||||
${0:code_snippet}
|
||||
```
|
||||
|
||||
snippet bt-codeblock-full
|
||||
``` ${1:language} ${2:title} ${3:URL} ${4:link_text}
|
||||
${0:code_snippet}
|
||||
```
|
||||
|
||||
snippet codeblock-short
|
||||
{% codeblock %}
|
||||
${0:code_snippet}
|
||||
{% endcodeblock %}
|
||||
|
||||
snippet codeblock-full
|
||||
{% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %}
|
||||
${0:code_snippet}
|
||||
{% endcodeblock %}
|
||||
|
||||
snippet gist-full
|
||||
{% gist ${1:gist_id} ${0:filename} %}
|
||||
|
||||
snippet gist-short
|
||||
{% gist ${0:gist_id} %}
|
||||
|
||||
snippet img
|
||||
{% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${0:alt_text} %}
|
||||
|
||||
snippet youtube
|
||||
{% youtube ${0:video_id} %}
|
||||
|
||||
# The quote should appear only once in the text. It is inherently part of it.
|
||||
# See http://octopress.org/docs/plugins/pullquote/ for more info.
|
||||
|
||||
snippet pullquote
|
||||
{% pullquote %}
|
||||
${1:text} {" ${2:quote} "} ${0:text}
|
||||
{% endpullquote %}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user