Skip to content

Commit

Permalink
Merge pull request honza#360 from lucc/descriptions
Browse files Browse the repository at this point in the history
tex,vim: add snippet descriptions
  • Loading branch information
SirVer committed May 12, 2014
2 parents 1406df6 + 2672bde commit 4ed4091
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion UltiSnips/tex.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ snippet "b(egin)?" "begin{} / end{}" br
\end{$1}
endsnippet

snippet tab
snippet tab "tabular / array environment" b
\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
$0${2/((?<=.)c|l|r)|./(?1: & )/g}
\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
Expand Down
6 changes: 3 additions & 3 deletions UltiSnips/vim.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ priority -50
###########################################################################
# SnipMate Snippets #
###########################################################################
snippet gvar "Global / configuration variable"
snippet gvar "Global / configuration variable" b
if !exists("g:${1:MyUltraImportantVar}")
let g:$1 = ${2:"${3:<tab>}"}
endif
endsnippet

snippet guard
snippet guard "script reload guard" b
if exists('${1:did_`!p snip.rv = snip.fn.replace('.','_')`}') || &cp${2: || version < 700}
finish
endif
let $1 = 1${3}
endsnippet

snippet f
snippet f "function" b
fun ${1:function_name}(${2})
${3:" code}
endf
Expand Down
136 changes: 68 additions & 68 deletions snippets/tex.snippets
Original file line number Diff line number Diff line change
@@ -1,215 +1,215 @@
#PREAMBLE
#newcommand
snippet nc
snippet nc \newcommand
\newcommand{\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0}
#usepackage
snippet up
snippet up \usepackage
\usepackage[${1:options}]{${2:package}} ${0}
#newunicodechar
snippet nuc
snippet nuc \newunicodechar
\newunicodechar{${1}}{${2:\ensuremath}${3:tex-substitute}}} ${0}
#DeclareMathOperator
snippet dmo
snippet dmo \DeclareMathOperator
\DeclareMathOperator{${1}}{${2}} ${0}

#DOCUMENT
# \begin{}...\end{}
snippet begin
snippet begin \begin{} ... \end{} block
\begin{${1:env}}
${0}
\end{$1}
# Tabular
snippet tab
snippet tab tabular (or arbitrary) environment
\begin{${1:tabular}}{${2:c}}
${0}
\end{$1}
snippet thm
snippet thm thm (or arbitrary) environment with optional argument
\begin[${1:author}]{${2:thm}}
${0}
\end{$2}
snippet center
snippet center center environment
\begin{center}
${0}
\end{center}
# Align(ed)
snippet ali
snippet ali align(ed) environment
\begin{align${1:ed}}
\label{eq:${2}}
${0}
\end{align$1}
# Gather(ed)
snippet gat
snippet gat gather(ed) environment
\begin{gather${1:ed}}
${0}
\end{gather$1}
# Equation
snippet eq
snippet eq equation environment
\begin{equation}
\label{eq:${2}}
${0}
\end{equation}
# Equation
snippet eq*
snippet eq* unnumbered equation environment
\begin{equation*}
${0}
\end{equation*}
# Unnumbered Equation
snippet \
snippet \ unnumbered equation: \[ ... \]
\[
${0}
\]
# Equation array
snippet eqnarray
snippet eqnarray eqnarray environment
\begin{eqnarray}
${0}
\end{eqnarray}
# Label
snippet lab
snippet lab \label
\label{${1:eq:}${2:fig:}${3:tab:}${0}}
# Enumerate
snippet enum
snippet enum enumerate environment
\begin{enumerate}
\item ${0}
\end{enumerate}
# Itemize
snippet itemize
snippet itemize itemize environment
\begin{itemize}
\item ${0}
\end{itemize}
snippet item
snippet item \item
\item ${1}
# Description
snippet desc
snippet desc description environment
\begin{description}
\item[${1}] ${0}
\end{description}
# Endless new item
snippet ]i
snippet ]i \item (recursive)
\item ${1}
${0:]i}
# Matrix
snippet mat
snippet mat smart matrix environment
\begin{${1:p/b/v/V/B/small}matrix}
${0}
\end{$1matrix}
# Cases
snippet cas
snippet cas cases environment
\begin{cases}
${1:equation}, &\text{ if }${2:case}\\
${0}
\end{cases}
# Split
snippet spl
snippet spl split environment
\begin{split}
${0}
\end{split}
# Part
snippet part
snippet part document \part
\part{${1:part name}} % (fold)
\label{prt:${2:$1}}
${0}
% part $2 (end)
# Chapter
snippet cha
snippet cha \chapter
\chapter{${1:chapter name}}
\label{cha:${2:$1}}
${0}
# Section
snippet sec
snippet sec \section
\section{${1:section name}}
\label{sec:${2:$1}}
${0}
# Section without number
snippet sec*
snippet sec* \section*
\section*{${1:section name}}
\label{sec:${2:$1}}
${0}
# Sub Section
snippet sub
snippet sub \subsection
\subsection{${1:subsection name}}
\label{sub:${2:$1}}
${0}
# Sub Section without number
snippet sub*
snippet sub* \subsection*
\subsection*{${1:subsection name}}
\label{sub:${2:$1}}
${0}
# Sub Sub Section
snippet subs
snippet subs \subsubsection
\subsubsection{${1:subsubsection name}}
\label{ssub:${2:$1}}
${0}
# Sub Sub Section without number
snippet subs*
snippet subs* \subsubsection*
\subsubsection*{${1:subsubsection name}}
\label{ssub:${2:$1}}
${0}
# Paragraph
snippet par
snippet par \paragraph
\paragraph{${1:paragraph name}}
\label{par:${2:$1}}
${0}
# Sub Paragraph
snippet subp
snippet subp \subparagraph
\subparagraph{${1:subparagraph name}}
\label{subp:${2:$1}}
${0}
snippet ni
snippet ni \noindent
\noindent
${0}
#References
snippet itd
snippet itd description \item
\item[${1:description}] ${0:item}
snippet figure
snippet figure reference to a figure
${1:Figure}~\ref{${2:fig:}}
snippet table
snippet table reference to a table
${1:Table}~\ref{${2:tab:}}
snippet listing
snippet listing reference to a listing
${1:Listing}~\ref{${2:list}}
snippet section
snippet section reference to a section
${1:Section}~\ref{sec:${2}} ${0}
snippet page
snippet page reference to a page
${1:page}~\pageref{${2}} ${0}
snippet index
snippet index \index
\index{${1:index}} ${0}
#Citations
snippet citen
snippet citen \citen
\citen{${1}} ${0}
# natbib citations
snippet citep
snippet citep \citep
\citep{${1}} ${0}
snippet citet
snippet citet \citet
\citet{${1}} ${0}
snippet cite
snippet cite \cite[]{}
\cite[${1}]{${2}} ${0}
snippet citea
snippet citea \citeauthor
\citeauthor{${1}} ${0}
snippet citey
snippet citey \citeyear
\citeyear{${1}} ${0}
snippet fcite
snippet fcite \footcite[]{}
\footcite[${1}]{${2}}${0}
#Formating text: italic, bold, underline, small capital, emphase ..
snippet it
snippet it italic text
\textit{${0:text}}
snippet bf
snippet bf bold face text
\textbf{${0:text}}
snippet under
snippet under underline text
\underline{${0:text}}
snippet emp
snippet emp emphasize text
\emph{${0:text}}
snippet sc
snippet sc small caps text
\textsc{${0:text}}
#Choosing font
snippet sf
snippet sf sans serife text
\textsf{${0:text}}
snippet rm
snippet rm roman font text
\textrm{${0:text}}
snippet tt
snippet tt typewriter (monospace) text
\texttt{${0:text}}
#misc
snippet ft
snippet ft \footnote
\footnote{${0:text}}
snippet fig
snippet fig figure environment (includegraphics)
\begin{figure}
\begin{center}
\includegraphics[scale=${1}]{Figures/${2}}
Expand All @@ -218,7 +218,7 @@ snippet fig
\label{fig:${4}}
\end{figure}
${0}
snippet tikz
snippet tikz figure environment (tikzpicture)
\begin{figure}
\begin{center}
\begin{tikzpicture}[scale=${1:1}]
Expand All @@ -230,31 +230,31 @@ snippet tikz
\end{figure}
${0}
#math
snippet stackrel
snippet stackrel \stackrel{}{}
\stackrel{${1:above}}{${2:below}} ${0}
snippet frac
snippet frac \frac{}{}
\frac{${1:num}}{${2:denom}} ${0}
snippet sum
snippet sum \sum^{}_{}
\sum^{${1:n}}_{${2:i=1}} ${0}
snippet lim
snippet lim \lim_{}
\lim_{${1:x \to +\infty}} ${0}
snippet frame
snippet frame frame environment
\begin{frame}[${1:t}]{${2:title}}
${0}
\end{frame}
snippet block
snippet block block environment
\begin{block}{${1:title}}
${0}
\end{block}
snippet alert
snippet alert alertblock environment
\begin{alertblock}{${1:title}}
${0}
\end{alertblock}
snippet example
snippet example exampleblock environment
\begin{exampleblock}{${1:title}}
${0}
\end{exampleblock}
snippet col2
snippet col2 two-column environment
\begin{columns}
\begin{column}{0.5\textwidth}
${1}
Expand Down
Loading

0 comments on commit 4ed4091

Please sign in to comment.