Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion UltiSnips/r.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions snippets/r.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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()

Expand Down
29 changes: 18 additions & 11 deletions snippets/tex.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -34,6 +34,7 @@ snippet center
# Align(ed)
snippet ali
\begin{align${1:ed}}
\label{eq:${2}}
${0}
\end{align$1}
# Gather(ed)
Expand All @@ -44,6 +45,7 @@ snippet gat
# Equation
snippet eq
\begin{equation}
\label{eq:${2}}
${0}
\end{equation}
# Equation
Expand All @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -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 ..
Expand All @@ -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}}
Expand All @@ -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
Expand Down