1
0
mirror of https://github.com/amix/vimrc synced 2025-08-02 02:44:59 +08:00

Updated plugins

This commit is contained in:
amix
2014-07-02 12:18:18 +01:00
parent 6a16a9393c
commit 1dba960b75
156 changed files with 2657 additions and 1234 deletions

View File

@ -46,6 +46,19 @@ If you have VimL only (vim without python support) your best option is using
minor bugs found in the engine.
Q: Should "snipmate be deprecated in favour of UltiSnips"?
A: No, because snimpate is VimL, and UltiSnips requires Python.
Some people want to use snippets without having to install Vim with Python
support. Yes - this sucks.
One solution would be: Use snippets if they are good enough, but allow overriding them
in UltiSnips. This would avoid most duplication while still serving most users.
AFAIK there is a nested-placeholder branch for snipmate too. snipmate is still
improved by Adnan Zafar. So maybe time is not ready to make a final decision yet.
[github issue/discussion](https://github.com/honza/vim-snippets/issues/363)
Installation
------------
@ -70,8 +83,8 @@ 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].
I know that I should be reading the docs of the snippet engine, just let me copy paste into my .vimrc:
[See this pull request](https://github.com/honza/vim-snippets/pull/307/files).
TROUBLE
=======
@ -117,6 +130,13 @@ 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
*folding markers*:
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.
Currently all snippets from UltiSnips have been put into UltiSnips - some work
on merging should be done (dropping duplicates etc). Also see engines section above.
Related repositories
--------------------
@ -193,20 +213,6 @@ This list is kept up-to-date on a best effort basis.
* 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
-------

View File

@ -16,7 +16,7 @@ endsnippet
snippet #if "#if #endif" b
#if ${1:0}
${VISUAL}${0:${VISUAL/(.*)/(?1::code)/}}
${VISUAL}${0}
#endif
endsnippet
@ -40,7 +40,7 @@ endsnippet
snippet main "main() (main)"
int main(int argc, char *argv[])
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
return 0;
}
endsnippet
@ -48,14 +48,14 @@ endsnippet
snippet for "for loop (for)"
for (${2:i} = 0; $2 < ${1:count}; ${3:++$2})
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
snippet fori "for int loop (fori)"
for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2})
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
@ -74,7 +74,7 @@ else:
snip.rv = snip.c`}
#define $1
${0}
${VISUAL}${0}
#endif /* end of include guard: $1 */
@ -86,13 +86,13 @@ endsnippet
snippet wh "while loop"
while(${1:/* condition */}) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
snippet do "do...while loop (do)"
do {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
} while(${1:/* condition */});
endsnippet
@ -103,26 +103,26 @@ endsnippet
snippet if "if .. (if)"
if (${1:/* condition */})
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
snippet el "else .. (else)"
else {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
snippet eli "else if .. (eli)"
else if (${1:/* condition */}) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
snippet ife "if .. else (ife)"
if (${1:/* condition */})
{
${2:/* code */}
${2}
}
else
{
@ -144,7 +144,7 @@ endsnippet
snippet fun "function" b
${1:void} ${2:function_name}(${3})
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet

View File

@ -27,7 +27,7 @@ endsnippet
snippet ns "namespace .. (namespace)"
namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`}
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}${1/.+/ \/* /m}$1${1/.+/ *\/ /m}
endsnippet

View File

@ -106,14 +106,14 @@ endsnippet
snippet if "if .. (if)"
if(${1:/*condition*/})
{
${VISUAL}${0:/*code*/}
${VISUAL}${0}
}
endsnippet
snippet ife "if .. else (ife)" b
if(${1:/*condition*/})
{
${2:/*code*/}
${2}
}
else
{
@ -124,14 +124,14 @@ endsnippet
snippet el "else (el)" b
else
{
${VISUAL}${1:/*code*/}
${VISUAL}${1}
}
endsnippet
snippet elif "else if (elif)" b
else if(${1:/*condition*/})
{
${VISUAL}${0:/*code*/}
${VISUAL}${0}
}
endsnippet
@ -139,10 +139,10 @@ snippet sw "switch (sw)"
switch(${1:/*var*/})
{
case ${2:/*value*/}:
${3:/*code*/}
${3}
break;
case ${4:/*value*/}:
${5:/*code*/}
${5}
break;
${7:/*more cases*/}
default:
@ -151,13 +151,13 @@ switch(${1:/*var*/})
endsnippet
snippet fsw "final switch (fsw)"
switch(${1:/*var*/})
final switch(${1:/*var*/})
{
case ${2:/*value*/}:
${3:/*code*/}
${3}
break;
case ${4:/*value*/}:
${5:/*code*/}
${5}
break;
${7:/*more cases*/}
}
@ -165,7 +165,7 @@ endsnippet
snippet case "case (case)" b
case ${1:/*value*/}:
${2:/*code*/}
${2}
break;
endsnippet
@ -178,42 +178,42 @@ endsnippet
snippet do "do while (do)" b
do
{
${VISUAL}${2:/*code*/}
${VISUAL}${2}
} while(${1:/*condition*/});
endsnippet
snippet wh "while (wh)" b
while(${1:/*condition*/})
{
${VISUAL}${2:/*code*/}
${VISUAL}${2}
}
endsnippet
snippet for "for (for)" b
for (${4:size_t} ${2:i} = 0; $2 < ${1:count}; ${3:++$2})
{
${VISUAL}${0:/*code*/}
${VISUAL}${0}
}
endsnippet
snippet forever "forever (forever)" b
for(;;)
{
${VISUAL}${0:/*code*/}
${VISUAL}${0}
}
endsnippet
snippet fore "foreach (fore)"
foreach(${1:/*elem*/}; ${2:/*range*/})
{
${VISUAL}${3:/*code*/}
${VISUAL}${3}
}
endsnippet
snippet forif "foreach if (forif)" b
foreach(${1:/*elem*/}; ${2:/*range*/}) if(${3:/*condition*/})
{
${VISUAL}${4:/*code*/}
${VISUAL}${4}
}
endsnippet
@ -249,21 +249,21 @@ endsnippet
snippet fun "function definition (fun)"
${1:void} ${2:/*function name*/}(${3:/*args*/}) ${4:@safe pure nothrow}
{
${VISUAL}${5:/*code*/}
${VISUAL}${5}
}
endsnippet
snippet void "void function definition (void)"
void ${1:/*function name*/}(${2:/*args*/}) ${3:@safe pure nothrow}
{
${VISUAL}${4:/*code*/}
${VISUAL}${4}
}
endsnippet
snippet this "ctor (this)" w
this(${1:/*args*/})
{
${VISUAL}${2:/*code*/}
${VISUAL}${2}
}
endsnippet
@ -295,7 +295,7 @@ endsnippet
snippet scope "scope (scope)" b
scope(${1:exit})
{
${VISUAL}${2:/*code*/}
${VISUAL}${2}
}
endsnippet
@ -304,7 +304,7 @@ endsnippet
snippet with "with (with)"
with(${1})
{
${VISUAL}${2:/*code*/}
${VISUAL}${2}
}
endsnippet
@ -405,14 +405,14 @@ endsnippet
snippet version "version (version)" b
version(${1:/*version name*/})
{
${VISUAL}${2:/*code*/}
${VISUAL}${2}
}
endsnippet
snippet debug "debug" b
debug
{
${VISUAL}${1:/*code*/}
${VISUAL}${1}
}
endsnippet
@ -422,7 +422,7 @@ endsnippet
snippet temp "template (temp)" b
template ${2:/*name*/}(${1:/*args*/})
{
${3:/*code*/}
${3}
}
endsnippet
@ -440,7 +440,7 @@ endsnippet
snippet unittest "unittest (unittest)" b
unittest
{
${1:/*code*/}
${1}
}
endsnippet
@ -450,21 +450,21 @@ endsnippet
snippet opDis "opDispatch (opDis)" b
${1:/*return type*/} opDispatch(string s)()
{
${2:/*code*/};
${2};
}
endsnippet
snippet op= "opAssign (op=)" b
void opAssign(${1} rhs) ${2:@safe pure nothrow}
{
${2:/*code*/}
${2}
}
endsnippet
snippet opCmp "opCmp (opCmp)" b
int opCmp(${1} rhs) @safe const pure nothrow
{
${2:/*code*/}
${2}
}
endsnippet
@ -484,7 +484,7 @@ endsnippet
snippet toString "toString (toString)" b
string toString() @safe const pure nothrow
{
${1:/*code*/}
${1}
}
endsnippet

View File

@ -52,6 +52,12 @@ for ${1:condition}${1/(.+)/ /}{
}
endsnippet
snippet fori "Integer for loop" b
for ${1:i} := 0; $1 < ${2:N}; $1++ {
${0:${VISUAL}}
}
endsnippet
snippet forr "For range loop" b
for ${2:name} := range ${1:collection} {
${0:${VISUAL}}

View File

@ -60,7 +60,7 @@ abstract $0
endsnippet
snippet as "assert" b
assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};$0
assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};
endsnippet
snippet at "assert true" b
@ -68,7 +68,7 @@ assertTrue(${1:actual});
endsnippet
snippet af "assert false" b
assertFalse(${1:actual});$0
assertFalse(${1:actual});
endsnippet
snippet ae "assert equals" b
@ -141,7 +141,7 @@ if len(args) > 0:
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]
snip.rv += "\n\t\tthis.%s = %s;" % (i[1], i[1])
if len(args) == 0:
snip.rv += "\n"`
}
@ -224,7 +224,7 @@ $0
endsnippet
snippet im "import" b
import ${1:java}.${2:util}.$0
import ${1:java}.${2:util}.$0;
endsnippet
snippet in "interface" b
@ -269,7 +269,7 @@ if len(args) > 0:
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]
snip.rv += "\n\t\tthis.%s = %s;" % (i[1], i[1])
if len(args) == 0:
snip.rv += "\n"`
}

View File

@ -79,6 +79,14 @@ setTimeout(function() {
}${2:.bind(${3:this})}, ${1:10});
endsnippet
snippet fi "for prop in obj using hasOwnProperty" b
for (${1:prop} in ${2:obj}){
if ($2.hasOwnProperty($1)) {
${VISUAL}$0
}
}
endsnippet
# Snippets for Console Debug Output
snippet ca "console.assert" b
@ -121,6 +129,10 @@ snippet cl "console.log" b
console.log(${1:"${2:value}"});
endsnippet
snippet cd "console.debug" b
console.debug(${1:"${2:value}"});
endsnippet
snippet cprof "console.profile" b
console.profile("${1:label}");
${VISUAL}$0

View File

@ -0,0 +1,25 @@
priority -50
snippet iti "it (js, inject)" b
it('${1:description}', inject(function($2) {
$0
}));
endsnippet
snippet befi "before each (js, inject)" b
beforeEach(inject(function($1) {
$0
}));
endsnippet
snippet aconf "angular config" i
config(function($1) {
$0
});
endsnippet
snippet acont "angular controller" i
controller('${1:name}', function($2) {
$0
});
endsnippet

View File

@ -0,0 +1,34 @@
# Documentation
snippet docf "function documentation" b
#' @description
#'
#' ${1:function description}
#'
#' ${2:@param ${3:name}::${4:Type} ${5:Description}}
#'
#' ${6:@returns ${7:name}::${8:Type} ${9:Description}}
#'
#' @examples
#'
#' ${10: function call examples}
endsnippet
snippet doct "type definition" b
#' @description
#'
#' ${1:type description}
#'
#' ${2:@field ${3:name}::${4:Type} ${5:Description}}
#'
#' @examples
#'
#' ${10: constructor examples}
endsnippet
snippet par "function parameter documentation" b
#' @param ${1:name}::${2:Type} ${0:Description}
endsnippet
snippet fld "type field documentation" b
#' @field ${1:name}::${2:Type} ${0:Description}
endsnippet

View File

@ -39,4 +39,15 @@ snippet img "Image"
![${1:pic alt}](${2:path}${3/.+/ "/}${3:opt title}${3/.+/"/})$0
endsnippet
snippet ilc "Inline Code" i
\`$1\`$0
endsnippet
snippet cbl "Codeblock" b
\`\`\`
$1
\`\`\`
$0
endsnippet
# vim:ft=snippets:

View File

@ -0,0 +1,3 @@
priority -49
extends markdown

View File

@ -3,6 +3,28 @@
priority -50
snippet classn "Basic class with namespace snippet" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
if m:
snip.rv = m.group().replace('/', '\\')
`;
/**
* ${1:@author `whoami`}
*/
class `!p
snip.rv = re.match(r'.*(?=\.)', fn).group()
`$2
{
public function __construct(${3:$options})
{
${4:// code}
}$0
}
endsnippet
snippet contr "Symfony2 controller" b
namespace `!p
abspath = os.path.abspath(path)

View File

@ -1,9 +1,42 @@
priority -50
global !p
import os
from vimsnippets import complete
FIELD_TYPES = [
'character',
'data.frame',
'integer',
'list',
'logical',
'matrix',
'numeric',
'vector']
endglobal
snippet #! "Hashbang for Rscript (#!)" b
#!/usr/bin/env Rscript
endsnippet
snippet setwd "Set workingdir" b
setwd("${1:`!p snip.rv = os.getcwd()`}")
endsnippet
snippet as "Apply type on variable" w
as.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`(${2}${VISUAL})
endsnippet
snippet is "Test type on variable" w
is.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`(${2}${VISUAL})
endsnippet
snippet dl "Download and install a package" b
download.file("${1:${VISUAL:url to package}}", destfile = "${2:${1/.*\/(\S*)$/(?1:$1)/ga}}")
install.packages("$2", type = "source", repos = NULL)
library("${3:${2/^(\w+)_.*$/(?1:$1)/ga}}")
endsnippet
snippet lib "Import a library"
library(${0:package})
endsnippet
@ -48,7 +81,7 @@ while(${1}) {
endsnippet
snippet for "for loop"
for ({${1:item} in ${2:list}) {
for (${1:item} in ${2:list}) {
${3}
}
endsnippet
@ -88,7 +121,7 @@ lapply(${1:list}, ${0:function})
endsnippet
snippet sapply "sapply function"
lapply(${1:list}, ${0:function})
sapply(${1:list}, ${0:function})
endsnippet
snippet vapply "vapply function"

View File

@ -2,45 +2,70 @@
# Rust Snippets #
#######################################################################
###############
# Functions #
###############
snippet fn "A function, optionally with arguments and return type."
priority -50
snippet fn "A function, optionally with arguments and return type." b
fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
snippet test "Test function"
snippet test "Test function" b
#[test]
fn ${1:test_function_name}() {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet new "A new function"
pub fn new(${2}) -> ${1:Name} {
${VISUAL}${0}return $1 { ${3} };
}
endsnippet
snippet main "The main function"
pub fn main() {
${VISUAL}${0}
}
endsnippet
snippet bench "Bench function" b
#[bench]
fn ${1:bench_function_name}(b: &mut test::Bencher) {
b.iter(|| {
${VISUAL}${0}
})
}
endsnippet
snippet let "A let statement"
snippet new "A new function" b
pub fn new(${2}) -> ${1:Name} {
${VISUAL}${0}return $1 { ${3} };
}
endsnippet
snippet main "The main function" b
pub fn main() {
${VISUAL}${0}
}
endsnippet
snippet let "A let statement" b
let ${1:name}${3} = ${VISUAL}${2};
endsnippet
snippet lmut "let mut = .." b
let mut ${1:name}${3} = ${VISUAL}${2};
endsnippet
snippet pri "print!(..)" b
print!("${1}"${2/..*/, /}${2});
endsnippet
snippet pln "println!(..)" b
println!("${1}"${2/..*/, /}${2});
endsnippet
snippet fmt "format!(..)"
format!("${1}"${2/..*/, /}${2});
endsnippet
snippet macro "macro_rules!" b
macro_rules! ${1:name} (
(${2:matcher}) => (
${3}
)
)
endsnippet
snippet ec "extern crate ..." b
extern crate ${1:sync};
@ -51,10 +76,10 @@ snippet ecl "...extern crate log;" b
#[phase(syntax, link)] extern crate log;
endsnippet
snippet mod "A mod." b
snippet mod "A module" b
mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
} /* $1 */
${VISUAL}${0}
}
endsnippet
snippet crate "Create header information" b
@ -78,24 +103,45 @@ snippet feat "#![feature(..)]" b
#![feature(${1:macro_rules})]
endsnippet
snippet der "#[deriving(..)]" b
#[deriving(${1:Show})]
endsnippet
snippet attr "#[..]" b
#[${1:inline}]
endsnippet
##################
# Common types #
##################
snippet opt "Option<..>"
Option<${1:int}>
endsnippet
snippet res "Result<.., ..>"
Result<${1:~str}, ${2:()}>
Result<${1:int}, ${2:()}>
endsnippet
snippet if "if .. (if)" b
if ${1:/* condition */} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
if ${1} {
${VISUAL}${0}
}
endsnippet
snippet el "else .. (el)"
else {
${VISUAL}${0}
}
endsnippet
snippet eli "else if .. (eli)"
else if ${1} {
${VISUAL}${0}
}
endsnippet
snippet ife "if .. else (ife)"
if ${1} {
${2}
} else {
${3}
}
endsnippet
@ -105,21 +151,27 @@ match ${1} {
}
endsnippet
snippet loop "loop {}" b
loop {
${VISUAL}${0}
}
endsnippet
snippet while "while .. {}" b
while ${1:condition} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
while ${1} {
${VISUAL}${0}
}
endsnippet
snippet for "for .. in .." b
for ${1:i} in ${2:range(0u, 10)} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
snippet spawn "spawn(proc() { .. });" b
spawn(proc() {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
});
endsnippet
@ -131,26 +183,23 @@ snippet duplex "Duplex stream" b
let (${1:from_child}, ${2:to_child}) = sync::duplex();
endsnippet
#####################
# TODO commenting #
#####################
snippet todo "A Todo comment"
// [TODO]: ${1:Description} - `!v strftime("%Y-%m-%d %I:%M%P")`
endsnippet
snippet fixme "FIXME comment"
// FIXME: ${1}
endsnippet
############
# Struct #
############
snippet st "Struct" b
struct ${1:`!p snip.rv = snip.basename.title() or "name"`} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
${VISUAL}${0}
}
endsnippet
snippet stn "Struct with new constructor." b
pub struct ${1:`!p snip.rv = snip.basename.title() or "name"`} {
${3:/* code */}
pub struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
${3}
}
impl $1 {
@ -162,48 +211,36 @@ impl $1 {
}
endsnippet
##########
# Enum #
##########
snippet enum "An enum" b
enum ${1:enum_name} {
enum ${1:Name} {
${VISUAL}${0},
}
endsnippet
snippet type "A type" b
type ${1:NewName} = ${VISUAL}${0};
endsnippet
##########
# Impl #
##########
snippet imp "An impl" b
impl ${1:Name} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
snippet drop "Drop implementation" b
impl Drop for ${1:Name} {
fn drop(&mut self) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
}
endsnippet
############
# Traits #
############
snippet trait "Trait block" b
snippet trait "Trait definition" b
trait ${1:Name} {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
${VISUAL}${0}
}
endsnippet
#############
# Statics #
#############
snippet ss "A static string."
static ${1}: &'static str = "${VISUAL}${0}";
endsnippet

View File

@ -8,7 +8,7 @@ snippet "b(egin)?" "begin{} / end{}" br
\end{$1}
endsnippet
snippet tab
snippet tab "tabular / array environment" b
\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)/}}

View File

@ -3,58 +3,22 @@ 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"
snippet gvar "Global / configuration variable" b
if !exists("g:${1:MyUltraImportantVar}")
let g:$1 = ${2:"${3:<tab>}"}
endif
endsnippet
snippet guard
snippet guard "script reload guard" b
if exists('${1:did_`!p snip.rv = snip.fn.replace('.','_')`}') || &cp${2: || version < 700}
finish
endif
let $1 = 1${3}
endsnippet
snippet f
snippet f "function" b
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:

View File

@ -84,6 +84,24 @@ snippet LGPL3
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 AGPL3
${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 Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
${0}
snippet BSD2
${1:one line to give the program's name and a brief description}

View File

@ -965,3 +965,23 @@ snippet z:a
z-index: auto;
snippet zoo
zoom: 1;
snippet :h
:hover
snippet :fc
:first-child
snippet :lc
:last-child
snippet :nc
:nth-child(${0})
snippet :nlc
:nth-last-child(${0})
snippet :oc
:only-child
snippet :a
:after
snippet :b
:before
snippet ::a
::after
snippet ::b
::before

View File

@ -6,122 +6,95 @@ 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
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}

View File

@ -230,3 +230,15 @@ snippet ga
go func(${1} ${2:type}) {
${3:/* code */}
}(${0})
snippet test test function
func Test${1:name}(t *testing.T) {
${2}
}
${0}
snippet bench benchmark function
func Benchmark${1:name}(b *testing.B) {
for i := 0; i < b.N; i++ {
${2}
}
}
${0}

View File

@ -147,6 +147,8 @@ 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 ac
<a href="`@+`">${0:`@+`}</a>
snippet abbr
<abbr title="${1}">${0}</abbr>
snippet address
@ -449,7 +451,8 @@ snippet html5
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
${2:meta}
</head>

View File

@ -1,72 +0,0 @@
# 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>

View File

@ -1,10 +1,10 @@
## Access Modifiers
snippet po
protected
protected ${0}
snippet pu
public
public ${0}
snippet pr
private
private ${0}
##
## Annotations
snippet before
@ -25,7 +25,7 @@ snippet oo
##
## Basic Java packages and import
snippet im
import
import ${0}
snippet j.b
java.beans.
snippet j.i
@ -39,17 +39,17 @@ snippet j.u
##
## Class
snippet cl
class ${1:`vim_snippets#Filename("", "untitled")`} ${0}
class ${1:`vim_snippets#Filename("$1", "untitled")`} ${0}
snippet in
interface ${1:`vim_snippets#Filename("", "untitled")`} ${2:extends Parent}
interface ${1:`vim_snippets#Filename("$1", "untitled")`} ${2:extends Parent}
snippet tc
public class ${1:`vim_snippets#Filename()`} extends ${0:TestCase}
public class ${1:`vim_snippets#Filename("$1")`} extends ${0:TestCase}
##
## Class Enhancements
snippet ext
extends
extends ${0}
snippet imp
implements
implements ${0}
##
## Comments
snippet /*
@ -89,15 +89,40 @@ snippet m
snippet v
${1:String} ${2:var}${3: = null}${4};
##
## Declaration for ArrayList
snippet d.al
List<${1:Object}> ${2:list} = new ArrayList<$1>();${0}
## Declaration for HashMap
snippet d.hm
Map<${1:Object}, ${2:Object}> ${3:map} = new HashMap<$1, $2>();${0}
## Declaration for HashSet
snippet d.hs
Set<${1:Object}> ${2:set} = new HashSet<$1>();${0}
## Declaration for Stack
snippet d.st
Stack<${1:Object}> ${2:stack} = new Stack<$1>();${0}
##
## Singleton Pattern
snippet singlet
private static class Holder {
private static final ${1:`vim_snippets#Filename("$1")`} INSTANCE = new $1();
}
private $1() { }
public static $1 getInstance() {
return Holder.INSTANCE;
}
##
## Enhancements to Methods, variables, classes, etc.
snippet ab
abstract
abstract ${0}
snippet fi
final
final ${0}
snippet st
static
static ${0}
snippet sy
synchronized
synchronized ${0}
##
## Error Methods
snippet err
@ -110,12 +135,30 @@ snippet errln
## Exception Handling
snippet as
assert ${1:test} : "${2:Failure message}";
snippet ae
assertEquals("${1:Failure message}", ${2:expected}, ${3:actual});
snippet aae
assertArrayEquals("${1:Failure message}", ${2:expecteds}, ${3:actuals});
snippet af
assertFalse("${1:Failure message}", ${2:condition});
snippet at
assertTrue("${1:Failure message}", ${2:condition});
snippet an
assertNull("${1:Failure message}", ${2:object});
snippet ann
assertNotNull("${1:Failure message}", ${2:object});
snippet ass
assertSame("${1:Failure message}", ${2:expected}, ${3:actual});
snippet asns
assertNotSame("${1:Failure message}", ${2:expected}, ${3:actual});
snippet fa
fail("${1:Failure message}");
snippet ca
catch(${1:Exception} ${2:e}) ${0}
snippet thr
throw
throw ${0}
snippet ths
throws
throws ${0}
snippet try
try {
${0}
@ -144,7 +187,7 @@ snippet @au
snippet @br
@brief ${0:Description}
snippet @fi
@file ${0:`vim_snippets#Filename()`}.java
@file ${0:`vim_snippets#Filename("$1")`}.java
snippet @pa
@param ${0:param}
snippet @re
@ -206,7 +249,7 @@ snippet get
##
## Terminate Methods or Loops
snippet re
return
return ${0}
snippet br
break;
##

View File

@ -13,7 +13,7 @@ snippet fun
snippet f
function (${1}) {
${0}
}${2:;}
}
# Immediate function
snippet (f
(function (${1}) {

View File

@ -0,0 +1,102 @@
snippet #!
#!/usr/bin/env julia
# Functions
snippet fun function definition
function ${1}(${2})
${0}
end
snippet ret return
return(${0})
# Printing to console
snippet pr print
print("${1}")
${0}
snippet prl print line
println("${1}")
${0}
# Includes
snippet use load a package
using ${0}
snippet incl include source code
include("${1}")
${0}
# Loops
snippet forc for loop iterating over iterable container
for ${1} in ${2}
${0}
end
snippet for standard for loop
for ${1} = ${2}
${0}
end
snippet fornest nested for loop
for ${1} = ${2}, ${3} = ${4}
${0}
end
snippet wh while loop
while ${1} ${2:<=} ${3}
${0}
end
# Conditionals
snippet if if statement
if ${1}
${0}
end
snippet el else part of statement
else
${0}
snippet eif else if part of if statement
else if ${1}
${0}
snippet ife full if-else statement
if ${1}
${2}
else
${0}
end
snippet tern ternary operator
${1} ? ${2} : ${3:nothing}
# Exceptions
snippet try try catch
try
${1}
catch ${2}
${0}
end
snippet fin finally statement
finally
${0}
snippet thr throw
throw(${1})
${0}
# Messages
snippet in
info("${1}")
${0}
snippet wa
warn("${1}")
${0}
snippet err
error("${1}")
${0}

View File

@ -40,7 +40,7 @@ snippet i
snippet t.
$this->
snippet f
function ${1:foo}(${2:array }${3:$bar})
function ${1}(${3})
{
${0}
}

View File

@ -23,9 +23,19 @@ snippet ei
${0}
}
# loops
snippet wh
while(${1}) {
${2}
}
snippet for
for (${1:item} in ${2:list}) {
${3}
}
# functions
snippet fun
${1:name} = function (${2:variables}) {
${1:name} <- function (${2:variables}) {
${0}
}
snippet ret
@ -39,7 +49,7 @@ snippet c
snippet li
list(${0:items})
snippet mat
matrix(${1:data}, nrow=${2:rows}, ncol=${0:cols})
matrix(${1:data}, nrow = ${2:rows}, ncol = ${0:cols})
# apply functions
snippet apply
@ -100,7 +110,7 @@ snippet pl
snippet ggp
ggplot(${1:data}, aes(${0:aesthetics}))
snippet img
${1:(jpeg,bmp,png,tiff)}(filename="${2:filename}", width=${3}, height=${4}, unit="${5}")
${1:(jpeg,bmp,png,tiff)}(filename = '${2:filename}', width = ${3}, height = ${4}, unit = '${5}')
${0:plot}
dev.off()

View File

@ -1030,9 +1030,9 @@ snippet aft
${0}
end
snippet let
let(:${1:object}) ${0}
let(:${1:object}) { ${0} }
snippet let!
let!(:${1:object}) ${0}
let!(:${1:object}) { ${0} }
snippet subj
subject { ${0} }
snippet s.

View File

@ -0,0 +1,125 @@
#################
# Rust Snippets #
#################
# Functions
snippet fn
fn ${1:function_name}(${2}) {
${0}
}
snippet fn-
fn ${1:function_name}(${2}) -> ${3} {
${0}
}
snippet test
#[test]
fn ${1:test_function_name}() {
${0}
}
snippet new
pub fn new(${2}) -> ${1:Name} {
${0}return $1 { ${3} };
}
snippet main
pub fn main() {
${0}
}
snippet let
let ${1:name}${3} = ${2};
snippet pln
println!("${1}");
snippet pln,
println!("${1}", ${2});
snippet ec
extern crate ${1:sync};
snippet ecl
#![feature(phase)]
#[phase(syntax, link)] extern crate log;
snippet mod
mod ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
${0}
} /* $1 */
snippet crate
// Crate ID
#![crate_id = "${1:crate_name}#${2:0.0.1}"]
// Additional metadata attributes
#![desc = "${3:Descrption.}"]
#![license = "${4:BSD}"]
#![comment = "${5:Comment.}"]
// Specify the output type
#![crate_type = "${6:lib}"]
snippet allow
#[allow(${1:unused_variable})]
snippet feat
#![feature(${1:macro_rules})]
# Common types
snippet opt
Option<${1:int}>
snippet res
Result<${1:~str}, ${2:()}>
snippet if
if ${1:/* condition */} {
${0}
}
snippet mat
match ${1} {
${2} => ${3},
}
snippet while
while ${1:condition} {
${0}
}
snippet for
for ${1:i} in ${2:range(0u, 10)} {
${0}
}
snippet spawn
spawn(proc() {
${0}
});
snippet chan
let (${1:tx}, ${2:rx}): (Sender<${3:int}>, Receiver<${4:int}>) = channel();
snippet duplex
let (${1:from_child}, ${2:to_child}) = sync::duplex();
# TODO commenting
snippet todo
// [TODO]: ${1:Description}
# Struct
snippet st
struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
${0}
}
impl $1 {
pub fn new(${2}) -> $1 {
${4}return $1 {
${5}
};
}
}
# Enum
snippet enum
enum ${1:enum_name} {
${0},
}
# Impl
snippet imp
impl ${1:Name} {
${0}
}
snippet drop
impl Drop for ${1:Name} {
fn drop(&mut self) {
${0}
}
}
# Traits
snippet trait
trait ${1:Name} {
${0}
}
# Statics
snippet ss
static ${1}: &'static str = "${0}";
snippet stat
static ${1}: ${2:uint} = ${0};

View File

@ -0,0 +1,36 @@
snippet +
(+ ${1}
${0})
snippet -
(- ${1}
${0})
snippet /
(/ ${1}
${0})
snippet *
(* ${1}
${0})
# Definition
snippet def
(define (${1:name})
(${0:definition}))
# Definition with lambda
snippet defl
(define ${1:name}
(lambda (x)(${0:definition})))
# Condition
snippet cond
(cond ((${1:predicate}) (${2:action}))
((${3:predicate}) (${0:action})))
# If statement
snippet if
(if (${1:predicate})
(${2:true-action})
(${0:false-action}))

View File

@ -81,7 +81,7 @@ snippet getopt
done
shift $(($OPTIND-1))
snippet root
if [ $(id -u) -ne 0 ]; then exec sudo $0; fi
if [ \$(id -u) -ne 0 ]; then exec sudo \$0; fi
snippet fun
${1:function_name}() {
${0:#function_body}

View File

@ -1,215 +1,224 @@
#PREAMBLE
#newcommand
snippet nc
snippet nc \newcommand
\newcommand{\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0}
#usepackage
snippet up
snippet up \usepackage
\usepackage[${1:options}]{${2:package}} ${0}
#newunicodechar
snippet nuc
snippet nuc \newunicodechar
\newunicodechar{${1}}{${2:\ensuremath}${3:tex-substitute}}} ${0}
#DeclareMathOperator
snippet dmo
snippet dmo \DeclareMathOperator
\DeclareMathOperator{${1}}{${2}} ${0}
#DOCUMENT
# \begin{}...\end{}
snippet begin
snippet begin \begin{} ... \end{} block
\begin{${1:env}}
${0}
\end{$1}
# Tabular
snippet tab
snippet tab tabular (or arbitrary) environment
\begin{${1:tabular}}{${2:c}}
${0}
${0}
\end{$1}
snippet thm
snippet thm thm (or arbitrary) environment with optional argument
\begin[${1:author}]{${2:thm}}
${0}
${0}
\end{$2}
snippet center
snippet center center environment
\begin{center}
${0}
\end{center}
# Align(ed)
snippet ali
snippet ali align(ed) environment
\begin{align${1:ed}}
\label{eq:${2}}
${0}
\end{align$1}
# Gather(ed)
snippet gat
snippet gat gather(ed) environment
\begin{gather${1:ed}}
${0}
\end{gather$1}
# Equation
snippet eq
snippet eq equation environment
\begin{equation}
\label{eq:${2}}
${0}
\end{equation}
# Equation
snippet eq*
snippet eq* unnumbered equation environment
\begin{equation*}
${0}
\end{equation*}
# Unnumbered Equation
snippet \
snippet \ unnumbered equation: \[ ... \]
\[
${0}
\]
# Equation array
snippet eqnarray
snippet eqnarray eqnarray environment
\begin{eqnarray}
${0}
\end{eqnarray}
# Label
snippet lab \label
\label{${1:eq:}${2:fig:}${3:tab:}${0}}
# Enumerate
snippet enum
snippet enum enumerate environment
\begin{enumerate}
\item ${0}
\end{enumerate}
# Itemize
snippet itemize
snippet itemize itemize environment
\begin{itemize}
\item ${0}
\end{itemize}
snippet item
snippet item \item
\item ${1}
# Description
snippet desc
snippet desc description environment
\begin{description}
\item[${1}] ${0}
\end{description}
# Endless new item
snippet ]i
snippet ]i \item (recursive)
\item ${1}
${0:]i}
${0:]i}
# Matrix
snippet mat
snippet mat smart matrix environment
\begin{${1:p/b/v/V/B/small}matrix}
${0}
\end{$1matrix}
# Cases
snippet cas
snippet cas cases environment
\begin{cases}
${1:equation}, &\text{ if }${2:case}\\
${0}
\end{cases}
# Split
snippet spl
snippet spl split environment
\begin{split}
${0}
\end{split}
# Part
snippet part
snippet part document \part
\part{${1:part name}} % (fold)
\label{prt:${2:$1}}
${0}
% part $2 (end)
# Chapter
snippet cha
snippet cha \chapter
\chapter{${1:chapter name}}
\label{cha:${2:$1}}
${0}
# Section
snippet sec
snippet sec \section
\section{${1:section name}}
\label{sec:${2:$1}}
${0}
# Section without number
snippet sec*
snippet sec* \section*
\section*{${1:section name}}
\label{sec:${2:$1}}
${0}
# Sub Section
snippet sub
snippet sub \subsection
\subsection{${1:subsection name}}
\label{sub:${2:$1}}
${0}
# Sub Section without number
snippet sub*
snippet sub* \subsection*
\subsection*{${1:subsection name}}
\label{sub:${2:$1}}
${0}
# Sub Sub Section
snippet subs
snippet subs \subsubsection
\subsubsection{${1:subsubsection name}}
\label{ssub:${2:$1}}
${0}
# Sub Sub Section without number
snippet subs*
snippet subs* \subsubsection*
\subsubsection*{${1:subsubsection name}}
\label{ssub:${2:$1}}
${0}
# Paragraph
snippet par
snippet par \paragraph
\paragraph{${1:paragraph name}}
\label{par:${2:$1}}
${0}
# Sub Paragraph
snippet subp
snippet subp \subparagraph
\subparagraph{${1:subparagraph name}}
\label{subp:${2:$1}}
${0}
snippet ni
snippet ni \noindent
\noindent
${0}
#References
snippet itd
snippet itd description \item
\item[${1:description}] ${0:item}
snippet figure
snippet figure reference to a figure
${1:Figure}~\ref{${2:fig:}}
snippet table
snippet table reference to a table
${1:Table}~\ref{${2:tab:}}
snippet listing
snippet listing reference to a listing
${1:Listing}~\ref{${2:list}}
snippet section
snippet section reference to a section
${1:Section}~\ref{sec:${2}} ${0}
snippet page
snippet page reference to a page
${1:page}~\pageref{${2}} ${0}
snippet index
snippet index \index
\index{${1:index}} ${0}
#Citations
snippet citen
\cite{$1} ${0}
# bibtex commands
snippet citep
\citep{$1} ${0}
snippet citet
\citet{$1} ${0}
snippet cite
snippet citen \citen
\citen{${1}} ${0}
# natbib citations
snippet citep \citep
\citep{${1}} ${0}
snippet citet \citet
\citet{${1}} ${0}
snippet cite \cite[]{}
\cite[${1}]{${2}} ${0}
snippet fcite
snippet citea \citeauthor
\citeauthor{${1}} ${0}
snippet citey \citeyear
\citeyear{${1}} ${0}
snippet fcite \footcite[]{}
\footcite[${1}]{${2}}${0}
#Formating text: italic, bold, underline, small capital, emphase ..
snippet it
snippet it italic text
\textit{${0:text}}
snippet bf
snippet bf bold face text
\textbf{${0:text}}
snippet under
snippet under underline text
\underline{${0:text}}
snippet emp
snippet emp emphasize text
\emph{${0:text}}
snippet sc
snippet sc small caps text
\textsc{${0:text}}
#Choosing font
snippet sf
snippet sf sans serife text
\textsf{${0:text}}
snippet rm
snippet rm roman font text
\textrm{${0:text}}
snippet tt
snippet tt typewriter (monospace) text
\texttt{${0:text}}
#misc
snippet ft
snippet ft \footnote
\footnote{${0:text}}
snippet fig
snippet fig figure environment (includegraphics)
\begin{figure}
\begin{center}
\includegraphics[scale=${1}]{Figures/${2}}
\includegraphics[scale=${1}]{Figures/${2}}
\end{center}
\caption{${3}}
\label{fig:${4}}
\end{figure}
${0}
snippet tikz
snippet tikz figure environment (tikzpicture)
\begin{figure}
\begin{center}
\begin{tikzpicture}[scale=${1:1}]
@ -221,33 +230,31 @@ snippet tikz
\end{figure}
${0}
#math
snippet stackrel
snippet stackrel \stackrel{}{}
\stackrel{${1:above}}{${2:below}} ${0}
snippet frac
snippet frac \frac{}{}
\frac{${1:num}}{${2:denom}} ${0}
snippet sum
snippet sum \sum^{}_{}
\sum^{${1:n}}_{${2:i=1}} ${0}
snippet lim
snippet lim \lim_{}
\lim_{${1:x \to +\infty}} ${0}
snippet frame
\begin{frame}[<+->]
\frametitle{${1:title}}
snippet frame frame environment
\begin{frame}[${1:t}]{${2:title}}
${0}
\end{frame}
snippet block
snippet block block environment
\begin{block}{${1:title}}
${0}
\end{block}
snippet alert
snippet alert alertblock environment
\begin{alertblock}{${1:title}}
${0}
\end{alertblock}
snippet example
snippet example exampleblock environment
\begin{exampleblock}{${1:title}}
${0}
\end{exampleblock}
snippet col2
snippet col2 two-column environment
\begin{columns}
\begin{column}{0.5\textwidth}
${1}

View File

@ -1,50 +1,52 @@
snippet header
snippet header standard Vim script file header
" File: ${1:`expand('%:t')`}
" Author: ${2:`g:snips_author`}
" Description: ${3}
${0:" Last Modified: `strftime("%B %d, %Y")`}
snippet guard
snippet guard script reload guard
if exists('${1:did_`vim_snippets#Filename()`}') || &cp${2: || version < 700}
finish
endif
let $1 = 1${0}
snippet f
snippet f function
fun! ${1:`expand('%') =~ 'autoload' ? substitute(matchstr(expand('%:p'),'autoload/\zs.*\ze.vim'),'[/\\]','#','g').'#' : ''`}${2:function_name}(${3})
${0}
endf
snippet t
snippet t try ... catch statement
try
${1}
catch ${2}
${0}
endtry
snippet for
snippet for for ... in loop
for ${1} in ${2}
${0}
endfor
snippet forkv
snippet forkv for [key, value] in loop
for [${1},${2}] in items(${3})
${0}
unlet $1 $2
endfor
snippet wh
snippet wh while loop
while ${1}
${0}
endw
snippet if
snippet if if statement
if ${1}
${0}
endif
snippet ife
snippet ife if ... else statement
if ${1}
${2}
else
${0}
endif
snippet au
snippet au augroup ... autocmd block
augroup ${1:AU_NAME}
" this one is which you're most likely to use?
autocmd ${2:BufRead,BufNewFile} ${3:*.ext,*.ext3|<buffer[=N]>} ${0}
augroup end
snippet bun
Bundle '${0}'
snippet bun Vundle.vim Plugin definition
Plugin '${0}'
snippet plug Vundle.vim Plugin definition
Plugin '${0}'