Skip to content

Commit 4ed4091

Browse files
committed
Merge pull request #360 from lucc/descriptions
tex,vim: add snippet descriptions
2 parents 1406df6 + 2672bde commit 4ed4091

File tree

4 files changed

+82
-82
lines changed

4 files changed

+82
-82
lines changed

UltiSnips/tex.snippets

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ snippet "b(egin)?" "begin{} / end{}" br
88
\end{$1}
99
endsnippet
1010

11-
snippet tab
11+
snippet tab "tabular / array environment" b
1212
\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
1313
$0${2/((?<=.)c|l|r)|./(?1: & )/g}
1414
\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}

UltiSnips/vim.snippets

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ priority -50
33
###########################################################################
44
# SnipMate Snippets #
55
###########################################################################
6-
snippet gvar "Global / configuration variable"
6+
snippet gvar "Global / configuration variable" b
77
if !exists("g:${1:MyUltraImportantVar}")
88
let g:$1 = ${2:"${3:<tab>}"}
99
endif
1010
endsnippet
1111

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

19-
snippet f
19+
snippet f "function" b
2020
fun ${1:function_name}(${2})
2121
${3:" code}
2222
endf

snippets/tex.snippets

+68-68
Original file line numberDiff line numberDiff line change
@@ -1,215 +1,215 @@
11
#PREAMBLE
22
#newcommand
3-
snippet nc
3+
snippet nc \newcommand
44
\newcommand{\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0}
55
#usepackage
6-
snippet up
6+
snippet up \usepackage
77
\usepackage[${1:options}]{${2:package}} ${0}
88
#newunicodechar
9-
snippet nuc
9+
snippet nuc \newunicodechar
1010
\newunicodechar{${1}}{${2:\ensuremath}${3:tex-substitute}}} ${0}
1111
#DeclareMathOperator
12-
snippet dmo
12+
snippet dmo \DeclareMathOperator
1313
\DeclareMathOperator{${1}}{${2}} ${0}
1414

1515
#DOCUMENT
1616
# \begin{}...\end{}
17-
snippet begin
17+
snippet begin \begin{} ... \end{} block
1818
\begin{${1:env}}
1919
${0}
2020
\end{$1}
2121
# Tabular
22-
snippet tab
22+
snippet tab tabular (or arbitrary) environment
2323
\begin{${1:tabular}}{${2:c}}
2424
${0}
2525
\end{$1}
26-
snippet thm
26+
snippet thm thm (or arbitrary) environment with optional argument
2727
\begin[${1:author}]{${2:thm}}
2828
${0}
2929
\end{$2}
30-
snippet center
30+
snippet center center environment
3131
\begin{center}
3232
${0}
3333
\end{center}
3434
# Align(ed)
35-
snippet ali
35+
snippet ali align(ed) environment
3636
\begin{align${1:ed}}
3737
\label{eq:${2}}
3838
${0}
3939
\end{align$1}
4040
# Gather(ed)
41-
snippet gat
41+
snippet gat gather(ed) environment
4242
\begin{gather${1:ed}}
4343
${0}
4444
\end{gather$1}
4545
# Equation
46-
snippet eq
46+
snippet eq equation environment
4747
\begin{equation}
4848
\label{eq:${2}}
4949
${0}
5050
\end{equation}
5151
# Equation
52-
snippet eq*
52+
snippet eq* unnumbered equation environment
5353
\begin{equation*}
5454
${0}
5555
\end{equation*}
5656
# Unnumbered Equation
57-
snippet \
57+
snippet \ unnumbered equation: \[ ... \]
5858
\[
5959
${0}
6060
\]
6161
# Equation array
62-
snippet eqnarray
62+
snippet eqnarray eqnarray environment
6363
\begin{eqnarray}
6464
${0}
6565
\end{eqnarray}
6666
# Label
67-
snippet lab
67+
snippet lab \label
6868
\label{${1:eq:}${2:fig:}${3:tab:}${0}}
6969
# Enumerate
70-
snippet enum
70+
snippet enum enumerate environment
7171
\begin{enumerate}
7272
\item ${0}
7373
\end{enumerate}
7474
# Itemize
75-
snippet itemize
75+
snippet itemize itemize environment
7676
\begin{itemize}
7777
\item ${0}
7878
\end{itemize}
79-
snippet item
79+
snippet item \item
8080
\item ${1}
8181
# Description
82-
snippet desc
82+
snippet desc description environment
8383
\begin{description}
8484
\item[${1}] ${0}
8585
\end{description}
8686
# Endless new item
87-
snippet ]i
87+
snippet ]i \item (recursive)
8888
\item ${1}
8989
${0:]i}
9090
# Matrix
91-
snippet mat
91+
snippet mat smart matrix environment
9292
\begin{${1:p/b/v/V/B/small}matrix}
9393
${0}
9494
\end{$1matrix}
9595
# Cases
96-
snippet cas
96+
snippet cas cases environment
9797
\begin{cases}
9898
${1:equation}, &\text{ if }${2:case}\\
9999
${0}
100100
\end{cases}
101101
# Split
102-
snippet spl
102+
snippet spl split environment
103103
\begin{split}
104104
${0}
105105
\end{split}
106106
# Part
107-
snippet part
107+
snippet part document \part
108108
\part{${1:part name}} % (fold)
109109
\label{prt:${2:$1}}
110110
${0}
111111
% part $2 (end)
112112
# Chapter
113-
snippet cha
113+
snippet cha \chapter
114114
\chapter{${1:chapter name}}
115115
\label{cha:${2:$1}}
116116
${0}
117117
# Section
118-
snippet sec
118+
snippet sec \section
119119
\section{${1:section name}}
120120
\label{sec:${2:$1}}
121121
${0}
122122
# Section without number
123-
snippet sec*
123+
snippet sec* \section*
124124
\section*{${1:section name}}
125125
\label{sec:${2:$1}}
126126
${0}
127127
# Sub Section
128-
snippet sub
128+
snippet sub \subsection
129129
\subsection{${1:subsection name}}
130130
\label{sub:${2:$1}}
131131
${0}
132132
# Sub Section without number
133-
snippet sub*
133+
snippet sub* \subsection*
134134
\subsection*{${1:subsection name}}
135135
\label{sub:${2:$1}}
136136
${0}
137137
# Sub Sub Section
138-
snippet subs
138+
snippet subs \subsubsection
139139
\subsubsection{${1:subsubsection name}}
140140
\label{ssub:${2:$1}}
141141
${0}
142142
# Sub Sub Section without number
143-
snippet subs*
143+
snippet subs* \subsubsection*
144144
\subsubsection*{${1:subsubsection name}}
145145
\label{ssub:${2:$1}}
146146
${0}
147147
# Paragraph
148-
snippet par
148+
snippet par \paragraph
149149
\paragraph{${1:paragraph name}}
150150
\label{par:${2:$1}}
151151
${0}
152152
# Sub Paragraph
153-
snippet subp
153+
snippet subp \subparagraph
154154
\subparagraph{${1:subparagraph name}}
155155
\label{subp:${2:$1}}
156156
${0}
157-
snippet ni
157+
snippet ni \noindent
158158
\noindent
159159
${0}
160160
#References
161-
snippet itd
161+
snippet itd description \item
162162
\item[${1:description}] ${0:item}
163-
snippet figure
163+
snippet figure reference to a figure
164164
${1:Figure}~\ref{${2:fig:}}
165-
snippet table
165+
snippet table reference to a table
166166
${1:Table}~\ref{${2:tab:}}
167-
snippet listing
167+
snippet listing reference to a listing
168168
${1:Listing}~\ref{${2:list}}
169-
snippet section
169+
snippet section reference to a section
170170
${1:Section}~\ref{sec:${2}} ${0}
171-
snippet page
171+
snippet page reference to a page
172172
${1:page}~\pageref{${2}} ${0}
173-
snippet index
173+
snippet index \index
174174
\index{${1:index}} ${0}
175175
#Citations
176-
snippet citen
176+
snippet citen \citen
177177
\citen{${1}} ${0}
178178
# natbib citations
179-
snippet citep
179+
snippet citep \citep
180180
\citep{${1}} ${0}
181-
snippet citet
181+
snippet citet \citet
182182
\citet{${1}} ${0}
183-
snippet cite
183+
snippet cite \cite[]{}
184184
\cite[${1}]{${2}} ${0}
185-
snippet citea
185+
snippet citea \citeauthor
186186
\citeauthor{${1}} ${0}
187-
snippet citey
187+
snippet citey \citeyear
188188
\citeyear{${1}} ${0}
189-
snippet fcite
189+
snippet fcite \footcite[]{}
190190
\footcite[${1}]{${2}}${0}
191191
#Formating text: italic, bold, underline, small capital, emphase ..
192-
snippet it
192+
snippet it italic text
193193
\textit{${0:text}}
194-
snippet bf
194+
snippet bf bold face text
195195
\textbf{${0:text}}
196-
snippet under
196+
snippet under underline text
197197
\underline{${0:text}}
198-
snippet emp
198+
snippet emp emphasize text
199199
\emph{${0:text}}
200-
snippet sc
200+
snippet sc small caps text
201201
\textsc{${0:text}}
202202
#Choosing font
203-
snippet sf
203+
snippet sf sans serife text
204204
\textsf{${0:text}}
205-
snippet rm
205+
snippet rm roman font text
206206
\textrm{${0:text}}
207-
snippet tt
207+
snippet tt typewriter (monospace) text
208208
\texttt{${0:text}}
209209
#misc
210-
snippet ft
210+
snippet ft \footnote
211211
\footnote{${0:text}}
212-
snippet fig
212+
snippet fig figure environment (includegraphics)
213213
\begin{figure}
214214
\begin{center}
215215
\includegraphics[scale=${1}]{Figures/${2}}
@@ -218,7 +218,7 @@ snippet fig
218218
\label{fig:${4}}
219219
\end{figure}
220220
${0}
221-
snippet tikz
221+
snippet tikz figure environment (tikzpicture)
222222
\begin{figure}
223223
\begin{center}
224224
\begin{tikzpicture}[scale=${1:1}]
@@ -230,31 +230,31 @@ snippet tikz
230230
\end{figure}
231231
${0}
232232
#math
233-
snippet stackrel
233+
snippet stackrel \stackrel{}{}
234234
\stackrel{${1:above}}{${2:below}} ${0}
235-
snippet frac
235+
snippet frac \frac{}{}
236236
\frac{${1:num}}{${2:denom}} ${0}
237-
snippet sum
237+
snippet sum \sum^{}_{}
238238
\sum^{${1:n}}_{${2:i=1}} ${0}
239-
snippet lim
239+
snippet lim \lim_{}
240240
\lim_{${1:x \to +\infty}} ${0}
241-
snippet frame
241+
snippet frame frame environment
242242
\begin{frame}[${1:t}]{${2:title}}
243243
${0}
244244
\end{frame}
245-
snippet block
245+
snippet block block environment
246246
\begin{block}{${1:title}}
247247
${0}
248248
\end{block}
249-
snippet alert
249+
snippet alert alertblock environment
250250
\begin{alertblock}{${1:title}}
251251
${0}
252252
\end{alertblock}
253-
snippet example
253+
snippet example exampleblock environment
254254
\begin{exampleblock}{${1:title}}
255255
${0}
256256
\end{exampleblock}
257-
snippet col2
257+
snippet col2 two-column environment
258258
\begin{columns}
259259
\begin{column}{0.5\textwidth}
260260
${1}

0 commit comments

Comments
 (0)