Merge pull request #352 from feju/master

Various new snippets and fixes
This commit is contained in:
Honza Pokorny 2014-04-30 05:58:14 -03:00
commit 995ab73c95
3 changed files with 22 additions and 15 deletions

View File

@ -88,7 +88,7 @@ lapply(${1:list}, ${0:function})
endsnippet endsnippet
snippet sapply "sapply function" snippet sapply "sapply function"
lapply(${1:list}, ${0:function}) sapply(${1:list}, ${0:function})
endsnippet endsnippet
snippet vapply "vapply function" snippet vapply "vapply function"

View File

@ -35,7 +35,7 @@ for (${1:item} in ${2:list}) {
# functions # functions
snippet fun snippet fun
${1:name} = function (${2:variables}) { ${1:name} <- function (${2:variables}) {
${0} ${0}
} }
snippet ret snippet ret
@ -110,7 +110,7 @@ snippet pl
snippet ggp snippet ggp
ggplot(${1:data}, aes(${0:aesthetics})) ggplot(${1:data}, aes(${0:aesthetics}))
snippet img 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} ${0:plot}
dev.off() dev.off()

View File

@ -34,6 +34,7 @@ snippet center
# Align(ed) # Align(ed)
snippet ali snippet ali
\begin{align${1:ed}} \begin{align${1:ed}}
\label{eq:${2}}
${0} ${0}
\end{align$1} \end{align$1}
# Gather(ed) # Gather(ed)
@ -44,6 +45,7 @@ snippet gat
# Equation # Equation
snippet eq snippet eq
\begin{equation} \begin{equation}
\label{eq:${2}}
${0} ${0}
\end{equation} \end{equation}
# Equation # Equation
@ -61,6 +63,9 @@ snippet eqnarray
\begin{eqnarray} \begin{eqnarray}
${0} ${0}
\end{eqnarray} \end{eqnarray}
# Label
snippet lab
\label{${1:eq:}${2:fig:}${3:tab:}${0}}
# Enumerate # Enumerate
snippet enum snippet enum
\begin{enumerate} \begin{enumerate}
@ -169,14 +174,18 @@ snippet index
\index{${1:index}} ${0} \index{${1:index}} ${0}
#Citations #Citations
snippet citen snippet citen
\cite{$1} ${0} \citen{${1}} ${0}
# bibtex commands # natbib citations
snippet citep snippet citep
\citep{$1} ${0} \citep{${1}} ${0}
snippet citet snippet citet
\citet{$1} ${0} \citet{${1}} ${0}
snippet cite snippet cite
\cite[${1}]{${2}} ${0} \cite[${1}]{${2}} ${0}
snippet citea
\citeauthor{${1}} ${0}
snippet citey
\citeyear{${1}} ${0}
snippet fcite snippet fcite
\footcite[${1}]{${2}}${0} \footcite[${1}]{${2}}${0}
#Formating text: italic, bold, underline, small capital, emphase .. #Formating text: italic, bold, underline, small capital, emphase ..
@ -230,9 +239,7 @@ snippet sum
snippet lim snippet lim
\lim_{${1:x \to +\infty}} ${0} \lim_{${1:x \to +\infty}} ${0}
snippet frame snippet frame
\begin{frame}[<+->] \begin{frame}[${1:t}]{${2:title}}
\frametitle{${1:title}}
${0} ${0}
\end{frame} \end{frame}
snippet block snippet block