mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -77,7 +77,7 @@ endsnippet
|
||||
# DATES #
|
||||
#########
|
||||
snippet date "YYYY-MM-DD" w
|
||||
`!v strftime("%F")`
|
||||
`!v strftime("%Y-%m-%d")`
|
||||
endsnippet
|
||||
|
||||
snippet ddate "Month DD, YYYY" w
|
||||
@ -85,7 +85,7 @@ snippet ddate "Month DD, YYYY" w
|
||||
endsnippet
|
||||
|
||||
snippet diso "ISO format datetime" w
|
||||
`!v strftime("%F %H:%M:%S%z")`
|
||||
`!v strftime("%Y-%m-%d %H:%M:%S%z")`
|
||||
endsnippet
|
||||
|
||||
snippet time "hh:mm" w
|
||||
|
@ -26,7 +26,7 @@ endglobal
|
||||
# TextMate Snippets #
|
||||
###########################################################################
|
||||
snippet get "Get Elements"
|
||||
getElement${1/(T)|.*/(?1:s)/}By${1:T}${1/(T)|(I)|.*/(?1:agName)(?2:d)/}('$2')
|
||||
getElement${1/(T)|(C)|.*/(?1:s)(?2:s)/}By${1:T}${1/(T)|(I)|(C).*/(?1:agName)(?2:d)(?3:lassName)/}('$2')
|
||||
endsnippet
|
||||
|
||||
snippet '':f "object method string"
|
||||
@ -68,7 +68,7 @@ ${1:var }${2:function_name} = function $2`!p snip.rv = space_before_function_par
|
||||
}`!p snip.rv = semi(snip)`
|
||||
endsnippet
|
||||
|
||||
snippet af "Anonymous Function" i
|
||||
snippet anf "Anonymous Function" i
|
||||
function`!p snip.rv = space_before_function_paren(snip)`($1) {
|
||||
${VISUAL}$0
|
||||
}
|
||||
|
@ -126,63 +126,75 @@ snippet cha "Chapter" b
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet sec "Section" b
|
||||
\section{${1:section name}}%
|
||||
snippet sec "Section"
|
||||
\section{${1:${VISUAL:section name}}}%
|
||||
\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet sec* "Section" b
|
||||
\section*{${1:section name}}%
|
||||
snippet sec* "Section"
|
||||
\section*{${1:${VISUAL: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}}%
|
||||
snippet sub "Subsection"
|
||||
\subsection{${1:${VISUAL:subsection name}}}%
|
||||
\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet sub* "Subsection" b
|
||||
\subsection*{${1:subsection name}}%
|
||||
snippet sub* "Subsection"
|
||||
\subsection*{${1:${VISUAL: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}}%
|
||||
snippet ssub "Subsubsection"
|
||||
\subsubsection{${1:${VISUAL:subsubsection name}}}%
|
||||
\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ssub* "Subsubsection" b
|
||||
\subsubsection*{${1:subsubsection name}}%
|
||||
snippet ssub* "Subsubsection"
|
||||
\subsubsection*{${1:${VISUAL: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}}%
|
||||
snippet par "Paragraph"
|
||||
\paragraph{${1:${VISUAL: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}}%
|
||||
snippet subp "Subparagraph"
|
||||
\subparagraph{${1:${VISUAL:subparagraph name}}}%
|
||||
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ac "Acroynm normal" b
|
||||
\ac{${1:acronym}}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet acl "Acroynm expanded" b
|
||||
\acl{${1:acronym}}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
snippet ni "Non-indented paragraph" b
|
||||
\noindent
|
||||
$0
|
||||
@ -197,9 +209,15 @@ snippet lp "Long parenthesis"
|
||||
endsnippet
|
||||
|
||||
snippet "mint(ed)?( (\S+))?" "Minted code typeset" br
|
||||
\begin{minted}{${1:`!p
|
||||
\begin{listing}
|
||||
\begin{minted}[linenos,numbersep=5pt,frame=lines,framesep=2mm]{${1:`!p
|
||||
snip.rv = match.group(3) if match.group(2) is not None else "language"`}}
|
||||
${2:${VISUAL:code}}
|
||||
\end{minted}$0
|
||||
\end{minted}
|
||||
\caption{${3:caption name}}
|
||||
\label{lst:${4:${3/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
\end{listing}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
# vim:ft=snippets:
|
||||
|
@ -3,6 +3,7 @@ priority -50
|
||||
##############
|
||||
# MATH STUFF #
|
||||
##############
|
||||
|
||||
snippet eq "Equation" b
|
||||
\begin{equation}
|
||||
$0
|
||||
@ -15,6 +16,18 @@ snippet eqnn "Equation without number" b
|
||||
\end{equation*}
|
||||
endsnippet
|
||||
|
||||
snippet al "Align" b
|
||||
\begin{align}
|
||||
$0
|
||||
\end{align}
|
||||
endsnippet
|
||||
|
||||
snippet alnn "Align without numbers" b
|
||||
\begin{align*}
|
||||
$0
|
||||
\end{align*}
|
||||
endsnippet
|
||||
|
||||
snippet eqa "Equation array" b
|
||||
\begin{eqnarray}
|
||||
$1 & $2 & $0
|
||||
@ -25,10 +38,10 @@ 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}}
|
||||
\frac{${1:${VISUAL}}}{${2}}
|
||||
endsnippet
|
||||
|
||||
snippet mat "Smart Matrix"
|
||||
@ -53,4 +66,20 @@ snippet lr[ "left[ right]" w
|
||||
\left[ ${1:${VISUAL}} \right]
|
||||
endsnippet
|
||||
|
||||
#################
|
||||
# PHYSICS STUFF #
|
||||
#################
|
||||
|
||||
snippet dv "Derivative" w
|
||||
\dv[${1:${VISUAL}}]{${2}}{${3}}
|
||||
endsnippet
|
||||
|
||||
snippet pdv "Partial Derivative" w
|
||||
\pdv[${1:${VISUAL}}]{${2}}{${3}}
|
||||
endsnippet
|
||||
|
||||
snippet SI "SI-Unit" w
|
||||
\SI{${1:${VISUAL}}}{${2}}
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
||||
|
@ -198,13 +198,13 @@ snippet dfun2
|
||||
{
|
||||
${12}
|
||||
}
|
||||
# function definition with two parameters
|
||||
# function definition with three parameters
|
||||
snippet fun3
|
||||
${1:void} ${2:function_name}(${3:Type} ${4:Parameter}, ${5:Type} ${6:Parameter}, ${7:Type} ${8:Parameter})
|
||||
{
|
||||
${9}
|
||||
}
|
||||
# function definition with two parameters with Doxygen documentation
|
||||
# function definition with three parameters with Doxygen documentation
|
||||
snippet dfun3
|
||||
/*! \brief ${1:Brief function description here}
|
||||
*
|
||||
|
@ -133,6 +133,11 @@ snippet fum
|
||||
${6}
|
||||
}
|
||||
${0}
|
||||
# http handler function on reciever
|
||||
snippet fumh
|
||||
func (${1:receiver} ${2:type}) ${3:funcName}(${4:w} http.ResponseWriter, ${5:r} *http.Request) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# log printf
|
||||
snippet lf
|
||||
log.Printf("%${1:s}", ${2:var})
|
||||
|
@ -50,27 +50,6 @@ snippet esc
|
||||
# comment
|
||||
snippet //
|
||||
<!-- ${1} -->${0}
|
||||
# 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"
|
||||
@ -872,7 +851,9 @@ snippet ul+
|
||||
snippet var
|
||||
<var>${0}</var>
|
||||
snippet video
|
||||
<video src="${1} height="${2}" width="${3}" preload="${5:none}" autoplay="${6:autoplay}>${7}</video>
|
||||
<video src="${1}" height="${2}" width="${3}" preload="${4:none}" autoplay="${5:autoplay}">${6}</video>
|
||||
snippet video.
|
||||
<video class="${1}" src="${2}" height="${3}" width="${4}" preload="${5:none}" autoplay="${6:autoplay}">${7}</video>
|
||||
snippet wbr
|
||||
<wbr />
|
||||
snippet viewport
|
||||
|
@ -1,5 +1,7 @@
|
||||
snippet ir
|
||||
import React from 'react';
|
||||
snippet irc
|
||||
import React, {Component} from 'react';
|
||||
snippet ird
|
||||
import ReactDOM from 'react-dom';
|
||||
snippet cdm
|
||||
|
@ -10,7 +10,7 @@ snippet fun
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# Anonymous Function
|
||||
snippet f "" w
|
||||
snippet anf "" w
|
||||
function(${1}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
|
@ -47,6 +47,14 @@ snippet cl
|
||||
${5:super($1, self).__init__()}
|
||||
self.$4 = $4
|
||||
${0}
|
||||
snippet cla
|
||||
class ${1:class_name}:
|
||||
"""${0:description}"""
|
||||
snippet clai
|
||||
class ${1:class_name}:
|
||||
"""${2:description}"""
|
||||
def __init__(self, ${3:args}):
|
||||
${0}
|
||||
# New Function
|
||||
snippet def
|
||||
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||
@ -63,6 +71,9 @@ snippet adeff
|
||||
async def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||
${0}
|
||||
# New Method
|
||||
snippet defi
|
||||
def __init__(self, ${1:args}):
|
||||
${0}
|
||||
snippet defm
|
||||
def ${1:mname}(self, ${2:arg}):
|
||||
${0}
|
||||
|
@ -5,17 +5,13 @@ snippet doc
|
||||
snippet let
|
||||
let ${1} = ${0};
|
||||
snippet fn
|
||||
let ${1} => {
|
||||
${0}
|
||||
};
|
||||
snippet fn0
|
||||
let ${1} () => {
|
||||
let ${1} = (${2}) => {
|
||||
${0}
|
||||
};
|
||||
snippet fun
|
||||
fun ${1} => ${0}
|
||||
snippet ty
|
||||
type ${1} = ${1};
|
||||
type ${1} = ${0};
|
||||
snippet mod
|
||||
module ${1} = {
|
||||
${0}
|
||||
@ -25,11 +21,13 @@ snippet modty
|
||||
${0}
|
||||
};
|
||||
snippet sw
|
||||
switch ${1} {
|
||||
switch (${1}) {
|
||||
| ${2} => ${0}
|
||||
}
|
||||
snippet |
|
||||
| ${1} => ${0}
|
||||
snippet p
|
||||
|> ${0}
|
||||
snippet if
|
||||
if (${1}) {
|
||||
${2}
|
||||
|
@ -688,6 +688,8 @@ snippet expb
|
||||
expect { ${1:object} }.to ${0}
|
||||
snippet experr
|
||||
expect { ${1:object} }.to raise_error ${2:StandardError}, /${0:message_regex}/
|
||||
snippet allow
|
||||
allow(${1:object}).to ${0}
|
||||
snippet shared
|
||||
shared_examples ${0:'shared examples name'}
|
||||
snippet ibl
|
||||
|
@ -191,3 +191,16 @@ snippet as "assert!"
|
||||
assert!(${1:predicate});
|
||||
snippet ase "assert_eq!"
|
||||
assert_eq!(${1:expected}, ${2:actual});
|
||||
# Implementations
|
||||
snippet asref "AsRef trait implementation"
|
||||
impl AsRef<${1:Ref}> for ${2:Type} {
|
||||
fn as_ref(&self) -> &${3:$1} {
|
||||
&self.${0:field}
|
||||
}
|
||||
}
|
||||
snippet asmut "AsMut trait implementation"
|
||||
impl AsMut<${1:Ref}> for ${2:Type} {
|
||||
fn as_mut(&mut self) -> &mut ${3:$1} {
|
||||
&mut self.${0:field}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user