emacs: yasnippet: add some convenience snippets for latex-mode
authorAmin Bandali <bandali@gnu.org>
Tue, 27 Aug 2019 04:46:57 +0000 (00:46 -0400)
committerAmin Bandali <bandali@gnu.org>
Tue, 27 Aug 2019 05:38:32 +0000 (01:38 -0400)
12 files changed:
.emacs.d/etc/yasnippet/snippets/latex-mode/cite [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/emph [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/enumerate [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/item [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/item-li [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/itemize [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/label [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/newcommand [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/section [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/subsection [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/textbf [new file with mode: 0644]
.emacs.d/etc/yasnippet/snippets/latex-mode/usepackage [new file with mode: 0644]

diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/cite b/.emacs.d/etc/yasnippet/snippets/latex-mode/cite
new file mode 100644 (file)
index 0000000..058bd2b
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: cite
+# key: c
+# --
+${1:~}\cite{${2:$$(unless yas-modified-p (mapconcat 'identity (reftex-citation 'dont-insert) ","))}} $0
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/emph b/.emacs.d/etc/yasnippet/snippets/latex-mode/emph
new file mode 100644 (file)
index 0000000..36b19d7
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: emph
+# key: e
+# --
+\emph{$1}$0
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/enumerate b/.emacs.d/etc/yasnippet/snippets/latex-mode/enumerate
new file mode 100644 (file)
index 0000000..df51892
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: enumerate
+# key: ol
+# --
+\begin{enumerate}
+$0
+\end{enumerate}
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/item b/.emacs.d/etc/yasnippet/snippets/latex-mode/item
new file mode 100644 (file)
index 0000000..d4773f5
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: item
+# key: -
+# --
+\item $0
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/item-li b/.emacs.d/etc/yasnippet/snippets/latex-mode/item-li
new file mode 100644 (file)
index 0000000..1bc93b5
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: item-li
+# key: li
+# type: command
+# --
+(yas-expand-snippet (yas-lookup-snippet "item"))
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/itemize b/.emacs.d/etc/yasnippet/snippets/latex-mode/itemize
new file mode 100644 (file)
index 0000000..eb97984
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: itemize
+# key: ul
+# --
+\begin{itemize}
+$0
+\end{itemize}
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/label b/.emacs.d/etc/yasnippet/snippets/latex-mode/label
new file mode 100644 (file)
index 0000000..8a98d7e
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: label
+# key: lbl
+# --
+\label{$0}
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/newcommand b/.emacs.d/etc/yasnippet/snippets/latex-mode/newcommand
new file mode 100644 (file)
index 0000000..e9e03ca
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: newcommand
+# key: cmd
+# --
+\newcommand{\\${1:name}}${2:[${3:0}]}{$0}
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/section b/.emacs.d/etc/yasnippet/snippets/latex-mode/section
new file mode 100644 (file)
index 0000000..88faeab
--- /dev/null
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: section
+# key: sec
+# --
+\section{${1:name}}
+\label{sec:${2:label}}
+
+$0
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/subsection b/.emacs.d/etc/yasnippet/snippets/latex-mode/subsection
new file mode 100644 (file)
index 0000000..0bb1c5b
--- /dev/null
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: subsection
+# key: ssec
+# --
+\subsection{${1:name}}
+\label{subsec:${2:label}}
+
+$0
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/textbf b/.emacs.d/etc/yasnippet/snippets/latex-mode/textbf
new file mode 100644 (file)
index 0000000..84171d7
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: textbf
+# key: b
+# --
+\textbf{$1}$0
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/usepackage b/.emacs.d/etc/yasnippet/snippets/latex-mode/usepackage
new file mode 100644 (file)
index 0000000..2afd38b
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: usepackage
+# key: pkg
+# --
+\usepackage{$0}
\ No newline at end of file