From 56324b8d1aba82b209ba5426cf4dd1d2ba61d9dc Mon Sep 17 00:00:00 2001 From: Felix Jung Date: Thu, 6 Mar 2014 15:15:01 +0100 Subject: [PATCH 1/7] Added label snippet and added labels to ali and eq --- snippets/tex.snippets | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index f3c090e..53abc04 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -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} From 7ce665eeac8d3ca32d80a471f67e9ab5db340c86 Mon Sep 17 00:00:00 2001 From: Felix Jung Date: Thu, 6 Mar 2014 16:59:09 +0100 Subject: [PATCH 2/7] Fixed citation snippets and added citea and citey --- snippets/tex.snippets | 148 ++++++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 72 deletions(-) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index 53abc04..c5c2002 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -14,174 +14,178 @@ snippet dmo #DOCUMENT # \begin{}...\end{} -snippet begin + snippet begin \begin{${1:env}} - ${0} + ${0} \end{$1} # Tabular -snippet tab + snippet tab \begin{${1:tabular}}{${2:c}} ${0} \end{$1} -snippet thm + snippet thm \begin[${1:author}]{${2:thm}} ${0} \end{$2} -snippet center + snippet center \begin{center} - ${0} + ${0} \end{center} # Align(ed) -snippet ali + snippet ali \begin{align${1:ed}} - \label{eq:${2}} - ${0} + \label{eq:${2}} + ${0} \end{align$1} # Gather(ed) -snippet gat + snippet gat \begin{gather${1:ed}} - ${0} + ${0} \end{gather$1} # Equation -snippet eq + snippet eq \begin{equation} - \label{eq:${2}} - ${0} + \label{eq:${2}} + ${0} \end{equation} # Equation -snippet eq* + snippet eq* \begin{equation*} - ${0} + ${0} \end{equation*} # Unnumbered Equation -snippet \ - \[ + snippet \ + \[ ${0} - \] + \] # Equation array -snippet eqnarray - \begin{eqnarray} + snippet eqnarray + \begin{eqnarray} ${0} - \end{eqnarray} + \end{eqnarray} # Label -snippet lab - \label{${1:eq:}${2:fig:}${3:tab:}${0}} + snippet lab + \label{${1:eq:}${2:fig:}${3:tab:}${0}} # Enumerate -snippet enum - \begin{enumerate} + snippet enum + \begin{enumerate} \item ${0} - \end{enumerate} + \end{enumerate} # Itemize -snippet itemize - \begin{itemize} + snippet itemize + \begin{itemize} \item ${0} - \end{itemize} -snippet item - \item ${1} + \end{itemize} + snippet item + \item ${1} # Description -snippet desc - \begin{description} + snippet desc + \begin{description} \item[${1}] ${0} - \end{description} + \end{description} # Endless new item -snippet ]i - \item ${1} - ${0:]i} + snippet ]i + \item ${1} + ${0:]i} # Matrix -snippet mat - \begin{${1:p/b/v/V/B/small}matrix} + snippet mat + \begin{${1:p/b/v/V/B/small}matrix} ${0} - \end{$1matrix} + \end{$1matrix} # Cases -snippet cas - \begin{cases} + snippet cas + \begin{cases} ${1:equation}, &\text{ if }${2:case}\\ - ${0} - \end{cases} + ${0} + \end{cases} # Split -snippet spl - \begin{split} - ${0} - \end{split} + snippet spl + \begin{split} + ${0} + \end{split} # Part -snippet part - \part{${1:part name}} % (fold) + snippet part +\part{${1:part name}} % (fold) \label{prt:${2:$1}} ${0} - % part $2 (end) +% part $2 (end) # Chapter -snippet cha + snippet cha \chapter{${1:chapter name}} \label{cha:${2:$1}} ${0} # Section -snippet sec + snippet sec \section{${1:section name}} \label{sec:${2:$1}} ${0} # Section without number -snippet sec* + snippet sec* \section*{${1:section name}} \label{sec:${2:$1}} ${0} # Sub Section -snippet sub + snippet sub \subsection{${1:subsection name}} \label{sub:${2:$1}} ${0} # Sub Section without number -snippet sub* + snippet sub* \subsection*{${1:subsection name}} \label{sub:${2:$1}} ${0} # Sub Sub Section -snippet subs + snippet subs \subsubsection{${1:subsubsection name}} \label{ssub:${2:$1}} ${0} # Sub Sub Section without number -snippet subs* + snippet subs* \subsubsection*{${1:subsubsection name}} \label{ssub:${2:$1}} ${0} # Paragraph -snippet par + snippet par \paragraph{${1:paragraph name}} \label{par:${2:$1}} ${0} # Sub Paragraph -snippet subp + snippet subp \subparagraph{${1:subparagraph name}} \label{subp:${2:$1}} ${0} -snippet ni + snippet ni \noindent ${0} #References -snippet itd + snippet itd \item[${1:description}] ${0:item} -snippet figure + snippet figure ${1:Figure}~\ref{${2:fig:}} -snippet table + snippet table ${1:Table}~\ref{${2:tab:}} -snippet listing + snippet listing ${1:Listing}~\ref{${2:list}} -snippet section + snippet section ${1:Section}~\ref{sec:${2}} ${0} -snippet page + snippet page ${1:page}~\pageref{${2}} ${0} -snippet index + snippet index \index{${1:index}} ${0} #Citations snippet citen - \cite{$1} ${0} + \citen{${1}} ${0} # bibtex commands 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 .. From ab0e535cb16527e1532a52b61fde9f3bb3dec9da Mon Sep 17 00:00:00 2001 From: Felix Jung Date: Thu, 6 Mar 2014 17:10:53 +0100 Subject: [PATCH 3/7] Fixed indentation issue --- snippets/tex.snippets | 138 +++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index c5c2002..dbb5651 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -14,163 +14,163 @@ snippet dmo #DOCUMENT # \begin{}...\end{} - snippet begin +snippet begin \begin{${1:env}} - ${0} + ${0} \end{$1} # Tabular - snippet tab +snippet tab \begin{${1:tabular}}{${2:c}} - ${0} + ${0} \end{$1} - snippet thm +snippet thm \begin[${1:author}]{${2:thm}} - ${0} + ${0} \end{$2} - snippet center +snippet center \begin{center} - ${0} + ${0} \end{center} # Align(ed) - snippet ali +snippet ali \begin{align${1:ed}} \label{eq:${2}} - ${0} + ${0} \end{align$1} # Gather(ed) - snippet gat +snippet gat \begin{gather${1:ed}} - ${0} + ${0} \end{gather$1} # Equation - snippet eq +snippet eq \begin{equation} \label{eq:${2}} - ${0} + ${0} \end{equation} # Equation - snippet eq* +snippet eq* \begin{equation*} - ${0} + ${0} \end{equation*} # Unnumbered Equation - snippet \ - \[ +snippet \ + \[ ${0} - \] + \] # Equation array - snippet eqnarray - \begin{eqnarray} +snippet eqnarray + \begin{eqnarray} ${0} - \end{eqnarray} + \end{eqnarray} # Label - snippet lab - \label{${1:eq:}${2:fig:}${3:tab:}${0}} +snippet lab + \label{${1:eq:}${2:fig:}${3:tab:}${0}} # Enumerate - snippet enum - \begin{enumerate} +snippet enum + \begin{enumerate} \item ${0} - \end{enumerate} + \end{enumerate} # Itemize - snippet itemize - \begin{itemize} +snippet itemize + \begin{itemize} \item ${0} - \end{itemize} - snippet item - \item ${1} + \end{itemize} +snippet item + \item ${1} # Description - snippet desc - \begin{description} +snippet desc + \begin{description} \item[${1}] ${0} - \end{description} + \end{description} # Endless new item - snippet ]i - \item ${1} +snippet ]i + \item ${1} ${0:]i} # Matrix - snippet mat - \begin{${1:p/b/v/V/B/small}matrix} +snippet mat + \begin{${1:p/b/v/V/B/small}matrix} ${0} - \end{$1matrix} + \end{$1matrix} # Cases - snippet cas - \begin{cases} +snippet cas + \begin{cases} ${1:equation}, &\text{ if }${2:case}\\ - ${0} - \end{cases} + ${0} + \end{cases} # Split - snippet spl - \begin{split} - ${0} - \end{split} +snippet spl + \begin{split} + ${0} + \end{split} # Part - snippet part -\part{${1:part name}} % (fold) +snippet part + \part{${1:part name}} % (fold) \label{prt:${2:$1}} ${0} -% part $2 (end) + % part $2 (end) # Chapter - snippet cha +snippet cha \chapter{${1:chapter name}} \label{cha:${2:$1}} ${0} # Section - snippet sec +snippet sec \section{${1:section name}} \label{sec:${2:$1}} ${0} # Section without number - snippet sec* +snippet sec* \section*{${1:section name}} \label{sec:${2:$1}} ${0} # Sub Section - snippet sub +snippet sub \subsection{${1:subsection name}} \label{sub:${2:$1}} ${0} # Sub Section without number - snippet sub* +snippet sub* \subsection*{${1:subsection name}} \label{sub:${2:$1}} ${0} # Sub Sub Section - snippet subs +snippet subs \subsubsection{${1:subsubsection name}} \label{ssub:${2:$1}} ${0} # Sub Sub Section without number - snippet subs* +snippet subs* \subsubsection*{${1:subsubsection name}} \label{ssub:${2:$1}} ${0} # Paragraph - snippet par +snippet par \paragraph{${1:paragraph name}} \label{par:${2:$1}} ${0} # Sub Paragraph - snippet subp +snippet subp \subparagraph{${1:subparagraph name}} \label{subp:${2:$1}} ${0} - snippet ni +snippet ni \noindent ${0} #References - snippet itd +snippet itd \item[${1:description}] ${0:item} - snippet figure +snippet figure ${1:Figure}~\ref{${2:fig:}} - snippet table +snippet table ${1:Table}~\ref{${2:tab:}} - snippet listing +snippet listing ${1:Listing}~\ref{${2:list}} - snippet section +snippet section ${1:Section}~\ref{sec:${2}} ${0} - snippet page +snippet page ${1:page}~\pageref{${2}} ${0} - snippet index +snippet index \index{${1:index}} ${0} #Citations snippet citen @@ -212,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}} From fc50b1584eb5c3d2525814c085186508b1773612 Mon Sep 17 00:00:00 2001 From: Felix Jung Date: Fri, 21 Mar 2014 14:21:33 +0100 Subject: [PATCH 4/7] Syntax changes in accordance with Google. --- snippets/r.snippets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets/r.snippets b/snippets/r.snippets index c7ca5ac..bcc6733 100644 --- a/snippets/r.snippets +++ b/snippets/r.snippets @@ -25,7 +25,7 @@ snippet ei # functions snippet fun - ${1:name} = function (${2:variables}) { + ${1:name} <- function (${2:variables}) { ${0} } snippet ret @@ -39,7 +39,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 +100,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() From aefcab679da99811a7f180d6b201eec8ba75e155 Mon Sep 17 00:00:00 2001 From: Felix Jung Date: Wed, 16 Apr 2014 14:50:14 +0200 Subject: [PATCH 5/7] Changed frame snippet --- snippets/tex.snippets | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index dbb5651..d72bdaa 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -239,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 From 0561ba640a5fa03a450e043d010721ca07d45077 Mon Sep 17 00:00:00 2001 From: Felix Jung Date: Wed, 30 Apr 2014 10:14:30 +0200 Subject: [PATCH 6/7] Fixed sapply snippet --- UltiSnips/r.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/r.snippets b/UltiSnips/r.snippets index 2d67594..74ecc1d 100644 --- a/UltiSnips/r.snippets +++ b/UltiSnips/r.snippets @@ -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" From 18d24cbdf85b86e29833bf8640ec93b74652a926 Mon Sep 17 00:00:00 2001 From: Felix Jung Date: Wed, 30 Apr 2014 10:14:49 +0200 Subject: [PATCH 7/7] Indenting label in align environment --- snippets/tex.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index d72bdaa..8304953 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -34,7 +34,7 @@ snippet center # Align(ed) snippet ali \begin{align${1:ed}} - \label{eq:${2}} + \label{eq:${2}} ${0} \end{align$1} # Gather(ed) @@ -175,7 +175,7 @@ snippet index #Citations snippet citen \citen{${1}} ${0} -# bibtex commands +# natbib citations snippet citep \citep{${1}} ${0} snippet citet