forked from colonelpanic/dotfiles
Squashed 'dotfiles/emacs.d/snippets/org-mode/' content from commit 63d0bbd
git-subtree-dir: dotfiles/emacs.d/snippets/org-mode git-subtree-split: 63d0bbd9629b3a07a56c61dded5502484ee53d1a
This commit is contained in:
commit
a3cd73bbea
0
.yas-ignore-filenames-as-triggers
Normal file
0
.yas-ignore-filenames-as-triggers
Normal file
0
.yas-make-groups
Normal file
0
.yas-make-groups
Normal file
1
.yas-parents
Normal file
1
.yas-parents
Normal file
@ -0,0 +1 @@
|
|||||||
|
text-mode
|
41
README.org
Normal file
41
README.org
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#+title: yasnippets
|
||||||
|
#+options: ^:nil
|
||||||
|
|
||||||
|
Snippets for org-mode. See [[https://github.com/capitaomorte/yasnippet][Yasnippet in Github]].
|
||||||
|
|
||||||
|
They have bindings ~C-c y~ plus an extra letter.
|
||||||
|
|
||||||
|
I have added a ~condition~ statement so that the snippets can be
|
||||||
|
expanded only at the beginning of the line.
|
||||||
|
|
||||||
|
| name | key | letter | explanation |
|
||||||
|
|-------------------------------------+------------+--------+--------------------------------------|
|
||||||
|
| #+begin_ ...#+end_ | block | b | |
|
||||||
|
| #+srcname:..#+begin_src...#+end_src | sb | s | source block with name |
|
||||||
|
| attr_html | ath | | alt="$1" img class="aligncenter" |
|
||||||
|
| attr_latex | atl | | ${1:width=$2\textwidth} |
|
||||||
|
| author | aut | a | inserts ~#+author:~ |
|
||||||
|
| corollary | cor | c | (uses reftex) |
|
||||||
|
| definition | def | d | (uses reftex) |
|
||||||
|
| ditaa | dit | | #+begin_ditaa,+end_ditaa |
|
||||||
|
| el | el | | #+begin_src emacs-lisp,+end_src |
|
||||||
|
| email | email | | inserts ~#+email:~ |
|
||||||
|
| equation | eqn | e | (uses reftex) |
|
||||||
|
| figure | fig | f | asks for image file |
|
||||||
|
| language | lan | | inserts ~#+language:~ (with choice) |
|
||||||
|
| LaTeX class | lcl | | inserts ~#+latex_class:~ (with choice) |
|
||||||
|
| LaTeX header | lhe | | inserts ~#+latex_header:~ |
|
||||||
|
| lemma | lem | l | (uses reftex) |
|
||||||
|
| options | opt | o | inserts ~#+options:~ |
|
||||||
|
| proof | prf | | |
|
||||||
|
| properties folded | properties | | inserts visibility folded property |
|
||||||
|
| proposition | pro | p | (uses reftex) |
|
||||||
|
| startup | sta | | inserts ~#+startup:~ |
|
||||||
|
| text | text | | inserts ~#+text:~ |
|
||||||
|
| theorem | thm | t | (uses reftex) |
|
||||||
|
| tikz-picture | tkz | z | (uses reftex) |
|
||||||
|
| title | title | | inserts ~#+title:~ |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
7
attr_html.yasnippet
Normal file
7
attr_html.yasnippet
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name : attr_html
|
||||||
|
# key: ath
|
||||||
|
# condition: (= (current-column) 3)
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+ATTR_HTML: alt="$1" img class="aligncenter"
|
6
attr_latex.yasnippet
Normal file
6
attr_latex.yasnippet
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# name: attr_latex
|
||||||
|
# key: atl
|
||||||
|
# condition: (= (current-column) 3)
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+attr_latex: ${1:width=$2\textwidth}
|
8
author.yasnippet
Normal file
8
author.yasnippet
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# name: author
|
||||||
|
# key: aut
|
||||||
|
# binding: C-c y a
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor : Rick Moynihan <rick@sourcesmouth.co.uk>
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+AUTHOR: ${1:`user-full-name`}
|
9
block.yasnippet
Normal file
9
block.yasnippet
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# name : #+begin_...#+end_
|
||||||
|
# expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil))
|
||||||
|
# condition: (or (= (current-column) 5) (= (current-column) 0))
|
||||||
|
# key: block
|
||||||
|
# binding: C-c y b
|
||||||
|
# --
|
||||||
|
#+BEGIN_$1 $2
|
||||||
|
$0
|
||||||
|
#+END_$1
|
12
corollary.yasnippet
Normal file
12
corollary.yasnippet
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: corollary
|
||||||
|
# key: cor
|
||||||
|
# binding: C-c y c
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
# <<$1>>
|
||||||
|
#+BEGIN_COROLLARY
|
||||||
|
#+latex: \label{${1:"waiting"$(unless yas/modified-p (reftex-label "corollary" 'dont-insert))}}%
|
||||||
|
$0
|
||||||
|
#+END_COROLLARY
|
12
definition.yasnippet
Normal file
12
definition.yasnippet
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: definition
|
||||||
|
# key: def
|
||||||
|
# binding: C-c y d
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
# <<$1>>
|
||||||
|
#+BEGIN_DEFINITION
|
||||||
|
#+LATEX: \label{${1:"waiting"$(unless yas/modified-p (reftex-label "definition" 'dont-insert))}}%
|
||||||
|
$0
|
||||||
|
#+END_DEFINITION
|
9
ditaa.yasnippet
Normal file
9
ditaa.yasnippet
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# name: ditaa
|
||||||
|
# key: dit
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rick Moynihan <rick@sourcesmouth.co.uk>
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+BEGIN_SRC ditaa ${1:export-file-name} -r -s -e
|
||||||
|
${0}
|
||||||
|
#+END_SRC
|
9
el.yasnippet
Normal file
9
el.yasnippet
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: el (emacs-lisp)
|
||||||
|
# key: el
|
||||||
|
# condition: (= (current-column) 2)
|
||||||
|
# --
|
||||||
|
#+NAME: $1
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
$0
|
||||||
|
#+END_SRC
|
8
email.yasnippet
Normal file
8
email.yasnippet
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: email
|
||||||
|
# key: email
|
||||||
|
# condition: (or (= (current-column) 5) (= (current-column) 0))
|
||||||
|
# contributor: Rick Moynihan <rick@sourcesmouth.co.uk>
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+EMAIL: ${1:`user-mail-address`}
|
12
equation.yasnippet
Normal file
12
equation.yasnippet
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: equation
|
||||||
|
# key: eqn
|
||||||
|
# binding: C-c y e
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
# <<$1>>
|
||||||
|
\begin{equation}
|
||||||
|
\label{${1:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}%
|
||||||
|
$0
|
||||||
|
\end{equation}
|
12
figure.yasnippet
Normal file
12
figure.yasnippet
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: figure
|
||||||
|
# key: fig
|
||||||
|
# binding: C-c y f
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+attr_latex: width=$1\textwidth
|
||||||
|
#+ATTR_HTML: width="$2%"
|
||||||
|
#+caption: $3
|
||||||
|
`(org-insert-link '(4))`
|
||||||
|
$0
|
22
install.sh
Executable file
22
install.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check for command line args.
|
||||||
|
if [ "$1" = "" ]; then
|
||||||
|
echo "Usage: ./install.sh yasnippet-dir"
|
||||||
|
echo "Example: ./install.sh ~/.emacs.d/plugins/yasnippet"
|
||||||
|
echo "This makes a \"snippets/org-mode\" folder and installs there"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create the latex-mode dir.
|
||||||
|
if [ ! -d "$1"/snippets/org-mode ]; then
|
||||||
|
mkdir "$1"/snippets/org-mode
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy needed files to the latex-mode dir.
|
||||||
|
cp *.yasnippet "$1"/snippets/org-mode/
|
||||||
|
cp .yas-parents "$1"/snippets/org-mode/
|
||||||
|
cp .yas-ignore-filenames-as-triggers "$1"/snippets/org-mode/
|
||||||
|
cp .yas-make-groups "$1"/snippets/org-mode/
|
||||||
|
|
||||||
|
exit 0
|
8
language.yasnippet
Normal file
8
language.yasnippet
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: language
|
||||||
|
# key: lan
|
||||||
|
# condition: (= (current-column) 3)
|
||||||
|
# contributor: Rick Moynihan <rick@sourcesmouth.co.uk>
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+LANGUAGE: ${1:$$(yas/choose-value '("en" "es"))}
|
7
latexclass.yasnippet
Normal file
7
latexclass.yasnippet
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: LaTeX class
|
||||||
|
# key: lcl
|
||||||
|
# condition: (= (current-column) 3)
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+LATEX_CLASS: ${1:$$(yas/choose-value '("report" "book" "article"))}
|
7
latexheader.yasnippet
Normal file
7
latexheader.yasnippet
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: LaTeX header
|
||||||
|
# key: lhe
|
||||||
|
# condition: (= (current-column) 3)
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+LATEX_HEADER: ${1:\usepackage{$2}}
|
12
lemma.yasnippet
Normal file
12
lemma.yasnippet
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: lemma
|
||||||
|
# key: lem
|
||||||
|
# binding: C-c y l
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
# <<$1>>
|
||||||
|
#+BEGIN_LEMMA
|
||||||
|
#+LATEX: \label{${1:"waiting"$(unless yas/modified-p (reftex-label "lemma" 'dont-insert))}}%
|
||||||
|
$0
|
||||||
|
#+END_LEMMA
|
9
options.yasnippet
Normal file
9
options.yasnippet
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: options
|
||||||
|
# contributor : Rick Moynihan <rick@sourcesmouth.co.uk>
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# binding: C-c y o
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# key: opt
|
||||||
|
# --
|
||||||
|
#+OPTIONS: ${0}
|
9
proof.yasnippet
Normal file
9
proof.yasnippet
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: proof
|
||||||
|
# key: prf
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
#+BEGIN_PROOF
|
||||||
|
$0
|
||||||
|
#+END_PROOF
|
9
propertiesfolded.yasnippet
Normal file
9
propertiesfolded.yasnippet
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# name: properties folded
|
||||||
|
# contributor: Jonathan Arkell <jonnay@jonnay.net>
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# condition: (= (current-column) 10)
|
||||||
|
# key: properties
|
||||||
|
# --
|
||||||
|
:PROPERTIES:
|
||||||
|
:VISIBILITY:folded:
|
||||||
|
:END:
|
11
proposition.yasnippet
Normal file
11
proposition.yasnippet
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# name: proposition
|
||||||
|
# key: pro
|
||||||
|
# binding: C-c y p
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
# <<$1>>
|
||||||
|
#+BEGIN_PROPOSITION
|
||||||
|
#+latex: \label{${1:"waiting"$(unless yas/modified-p (reftex-label "proposition" 'dont-insert))}}%
|
||||||
|
$0
|
||||||
|
#+END_PROPOSITION
|
10
sourceblock.yasnippet
Normal file
10
sourceblock.yasnippet
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name : #+srcname:..#+begin_src...#+end_src
|
||||||
|
# key: sb
|
||||||
|
# binding: C-c y s
|
||||||
|
# condition: (or (= (current-column) 2) (= (current-column) 0))
|
||||||
|
# --
|
||||||
|
#+NAME: ${1:name}
|
||||||
|
#+BEGIN_SRC ${2:language}
|
||||||
|
$3
|
||||||
|
#+END_SRC
|
8
startup.yasnippet
Normal file
8
startup.yasnippet
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: startup
|
||||||
|
# contributor : Rick Moynihan <rick@sourcesmouth.co.uk>
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# key: sta
|
||||||
|
# --
|
||||||
|
#+STARTUP: ${1:options}
|
8
text.yasnippet
Normal file
8
text.yasnippet
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: text
|
||||||
|
# contributor: Rick Moynihan <rick@sourcesmouth.co.uk>
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# condition: (or (= (current-column) 4) (= (current-column) 0))
|
||||||
|
# key: text
|
||||||
|
# --
|
||||||
|
#+TEXT: ${1:text}
|
12
theorem.yasnippet
Normal file
12
theorem.yasnippet
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: theorem
|
||||||
|
# key: thm
|
||||||
|
# binding: C-c y t
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# --
|
||||||
|
# <<$1>>
|
||||||
|
#+BEGIN_THEOREM
|
||||||
|
#+latex: \label{${1:"waiting"$(unless yas/modified-p (reftex-label "theorem" 'dont-insert))}}%
|
||||||
|
$0
|
||||||
|
#+END_THEOREM
|
19
tikz-figure.yasnippet
Normal file
19
tikz-figure.yasnippet
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: tikz-figure
|
||||||
|
# binding: C-c y z
|
||||||
|
# condition: (or (= (current-column) 3) (= (current-column) 0))
|
||||||
|
# contributor: Rafael Villarroel <rvf0068@gmail.com>
|
||||||
|
# key: tkz
|
||||||
|
# --
|
||||||
|
#+CAPTION: $1
|
||||||
|
#+LABEL: ${2:"waiting"$(unless yas/modified-p (reftex-label "figure" 'dont-insert))}
|
||||||
|
#+ATTR_HTML: alt="$1" width="$3%"
|
||||||
|
#+ATTR_LATEX: width=0.$3\textwidth
|
||||||
|
#+ATTR_ODT: (:scale 0.$3)
|
||||||
|
#+HEADERS: :imagemagick yes :iminoptions -density 300 -resize 400
|
||||||
|
#+HEADERS: :packages '(("" "tikz") ("" "tkz-berge")) :border 1pt
|
||||||
|
#+BEGIN_SRC latex :file ${2:$(substring yas/text 4)}.png
|
||||||
|
\begin{tikzpicture}
|
||||||
|
${0}
|
||||||
|
\end{tikzpicture}
|
||||||
|
#+END_SRC
|
8
title.yasnippet
Normal file
8
title.yasnippet
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: title
|
||||||
|
# contributor : Rick Moynihan <rick@sourcesmouth.co.uk>
|
||||||
|
# contributor: Rafael Villarroel (rvf0068@gmail.com)
|
||||||
|
# condition: (= (current-column) 5)
|
||||||
|
# key: title
|
||||||
|
# --
|
||||||
|
#+TITLE: ${1:title}
|
Loading…
Reference in New Issue
Block a user