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
snippet sapply "sapply function"
lapply(${1:list}, ${0:function})
sapply(${1:list}, ${0:function})
endsnippet
snippet vapply "vapply function"

View File

@ -35,7 +35,7 @@ for (${1:item} in ${2:list}) {
# functions
snippet fun
${1:name} = function (${2:variables}) {
${1:name} <- function (${2:variables}) {
${0}
}
snippet ret
@ -49,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
@ -110,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

@ -21,11 +21,11 @@ snippet begin
# Tabular
snippet tab
\begin{${1:tabular}}{${2:c}}
${0}
${0}
\end{$1}
snippet thm
\begin[${1:author}]{${2:thm}}
${0}
${0}
\end{$2}
snippet center
\begin{center}
@ -34,6 +34,7 @@ snippet center
# Align(ed)
snippet ali
\begin{align${1:ed}}
\label{eq:${2}}
${0}
\end{align$1}
# Gather(ed)
@ -44,6 +45,7 @@ snippet gat
# Equation
snippet eq
\begin{equation}
\label{eq:${2}}
${0}
\end{equation}
# Equation
@ -61,6 +63,9 @@ snippet eqnarray
\begin{eqnarray}
${0}
\end{eqnarray}
# Label
snippet lab
\label{${1:eq:}${2:fig:}${3:tab:}${0}}
# Enumerate
snippet enum
\begin{enumerate}
@ -81,7 +86,7 @@ snippet desc
# Endless new item
snippet ]i
\item ${1}
${0:]i}
${0:]i}
# Matrix
snippet mat
\begin{${1:p/b/v/V/B/small}matrix}
@ -169,14 +174,18 @@ snippet index
\index{${1:index}} ${0}
#Citations
snippet citen
\cite{$1} ${0}
# bibtex commands
\citen{${1}} ${0}
# natbib citations
snippet citep
\citep{$1} ${0}
\citep{${1}} ${0}
snippet citet
\citet{$1} ${0}
\citet{${1}} ${0}
snippet cite
\cite[${1}]{${2}} ${0}
snippet citea
\citeauthor{${1}} ${0}
snippet citey
\citeyear{${1}} ${0}
snippet fcite
\footcite[${1}]{${2}}${0}
#Formating text: italic, bold, underline, small capital, emphase ..
@ -203,7 +212,7 @@ snippet ft
snippet fig
\begin{figure}
\begin{center}
\includegraphics[scale=${1}]{Figures/${2}}
\includegraphics[scale=${1}]{Figures/${2}}
\end{center}
\caption{${3}}
\label{fig:${4}}
@ -230,9 +239,7 @@ snippet sum
snippet lim
\lim_{${1:x \to +\infty}} ${0}
snippet frame
\begin{frame}[<+->]
\frametitle{${1:title}}
\begin{frame}[${1:t}]{${2:title}}
${0}
\end{frame}
snippet block