mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -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}
|
||||
|
@ -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
|
||||
|
@ -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}
|
||||
|
@ -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}
|
||||
|
@ -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>
|
||||
|
@ -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>
|
@ -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;
|
||||
##
|
||||
|
@ -13,7 +13,7 @@ snippet fun
|
||||
snippet f
|
||||
function (${1}) {
|
||||
${0}
|
||||
}${2:;}
|
||||
}
|
||||
# Immediate function
|
||||
snippet (f
|
||||
(function (${1}) {
|
||||
|
102
sources_non_forked/vim-snippets/snippets/julia.snippets
Normal file
102
sources_non_forked/vim-snippets/snippets/julia.snippets
Normal 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}
|
@ -40,7 +40,7 @@ snippet i
|
||||
snippet t.
|
||||
$this->
|
||||
snippet f
|
||||
function ${1:foo}(${2:array }${3:$bar})
|
||||
function ${1}(${3})
|
||||
{
|
||||
${0}
|
||||
}
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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.
|
||||
|
125
sources_non_forked/vim-snippets/snippets/rust.snippets
Normal file
125
sources_non_forked/vim-snippets/snippets/rust.snippets
Normal 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};
|
36
sources_non_forked/vim-snippets/snippets/scheme.snippets
Normal file
36
sources_non_forked/vim-snippets/snippets/scheme.snippets
Normal 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}))
|
@ -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}
|
||||
|
@ -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}
|
||||
|
@ -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}'
|
||||
|
Reference in New Issue
Block a user