summaryrefslogtreecommitdiff
path: root/.emacs.d/snippets
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/snippets')
-rw-r--r--.emacs.d/snippets/markdown-mode/back-quote6
-rw-r--r--.emacs.d/snippets/markdown-mode/code7
-rw-r--r--.emacs.d/snippets/markdown-mode/emphasis6
-rw-r--r--.emacs.d/snippets/markdown-mode/h1.18
-rw-r--r--.emacs.d/snippets/markdown-mode/h1.29
-rw-r--r--.emacs.d/snippets/markdown-mode/h2.18
-rw-r--r--.emacs.d/snippets/markdown-mode/h2.29
-rw-r--r--.emacs.d/snippets/markdown-mode/h38
-rw-r--r--.emacs.d/snippets/markdown-mode/h48
-rw-r--r--.emacs.d/snippets/markdown-mode/h58
-rw-r--r--.emacs.d/snippets/markdown-mode/h68
-rw-r--r--.emacs.d/snippets/markdown-mode/highlight8
-rw-r--r--.emacs.d/snippets/markdown-mode/hr.19
-rw-r--r--.emacs.d/snippets/markdown-mode/hr.29
-rw-r--r--.emacs.d/snippets/markdown-mode/hyphen7
-rw-r--r--.emacs.d/snippets/markdown-mode/img6
-rw-r--r--.emacs.d/snippets/markdown-mode/link6
-rw-r--r--.emacs.d/snippets/markdown-mode/ordered-list7
-rw-r--r--.emacs.d/snippets/markdown-mode/plus7
-rw-r--r--.emacs.d/snippets/markdown-mode/rimg6
-rw-r--r--.emacs.d/snippets/markdown-mode/rlb7
-rw-r--r--.emacs.d/snippets/markdown-mode/rlink6
-rw-r--r--.emacs.d/snippets/markdown-mode/strong-emphasis6
-rw-r--r--.emacs.d/snippets/markdown-mode/utf87
-rw-r--r--.emacs.d/snippets/prog-mode/.yas-setup.el6
-rw-r--r--.emacs.d/snippets/python-mode.statnett/.yas-setup.el1
-rw-r--r--.emacs.d/snippets/python-mode/.yas-setup.el1
-rw-r--r--.emacs.d/snippets/yasnippet-snippets.el77
28 files changed, 259 insertions, 2 deletions
diff --git a/.emacs.d/snippets/markdown-mode/back-quote b/.emacs.d/snippets/markdown-mode/back-quote
new file mode 100644
index 0000000..519fe14
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/back-quote
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: Inline Code
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: `
5# --
6\`${1:Code}\` $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/code b/.emacs.d/snippets/markdown-mode/code
new file mode 100644
index 0000000..4289e72
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/code
@@ -0,0 +1,7 @@
1# -*- mode: snippet -*-
2# name: Code block
3# key: code
4# --
5\`\`\`$1
6$0
7\`\`\`
diff --git a/.emacs.d/snippets/markdown-mode/emphasis b/.emacs.d/snippets/markdown-mode/emphasis
new file mode 100644
index 0000000..0ef6878
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/emphasis
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: Emphasis
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: _
5# --
6_${1:Text}_ $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/h1.1 b/.emacs.d/snippets/markdown-mode/h1.1
new file mode 100644
index 0000000..534337a
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/h1.1
@@ -0,0 +1,8 @@
1# -*- mode: snippet -*-
2# name: Header 1 (#)
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: h1
5# --
6# ${1:Header 1} #
7
8$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/h1.2 b/.emacs.d/snippets/markdown-mode/h1.2
new file mode 100644
index 0000000..dbf567c
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/h1.2
@@ -0,0 +1,9 @@
1# -*- mode: snippet -*-
2# name: Header 1 (=)
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: h1
5# --
6${1:Header 1}
7${1:$(make-string (string-width yas-text) ?\=)}
8
9$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/h2.1 b/.emacs.d/snippets/markdown-mode/h2.1
new file mode 100644
index 0000000..7830c97
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/h2.1
@@ -0,0 +1,8 @@
1# -*- mode: snippet -*-
2# name: Header 2 (##)
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: h2
5# --
6## ${1:Header 1} ##
7
8$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/h2.2 b/.emacs.d/snippets/markdown-mode/h2.2
new file mode 100644
index 0000000..16baba9
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/h2.2
@@ -0,0 +1,9 @@
1# -*- mode: snippet -*-
2# name: Header 2 (-)
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: h2
5# --
6${1:Header 2}
7${1:$(make-string (string-width yas-text) ?\-)}
8
9$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/h3 b/.emacs.d/snippets/markdown-mode/h3
new file mode 100644
index 0000000..ba2a552
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/h3
@@ -0,0 +1,8 @@
1# -*- mode: snippet -*-
2# name: Header 3
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: h3
5# --
6### ${1:Header 3} ###
7
8$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/h4 b/.emacs.d/snippets/markdown-mode/h4
new file mode 100644
index 0000000..d9f5ec6
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/h4
@@ -0,0 +1,8 @@
1# -*- mode: snippet -*-
2# name: Header 4
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: h4
5# --
6#### ${1:Header 4} ####
7
8$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/h5 b/.emacs.d/snippets/markdown-mode/h5
new file mode 100644
index 0000000..08fc8f1
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/h5
@@ -0,0 +1,8 @@
1# -*- mode: snippet -*-
2# name: Header 5
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: h5
5# --
6##### ${1:Header 5} #####
7
8$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/h6 b/.emacs.d/snippets/markdown-mode/h6
new file mode 100644
index 0000000..24b974d
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/h6
@@ -0,0 +1,8 @@
1# -*- mode: snippet -*-
2# name: Header 6
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: h6
5# --
6###### ${1:Header 6} ######
7
8$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/highlight b/.emacs.d/snippets/markdown-mode/highlight
new file mode 100644
index 0000000..2e47e18
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/highlight
@@ -0,0 +1,8 @@
1# -*- mode: snippet -*-
2# name: Highlight
3# contributor: nguyenvinhlinh <nguyenvinhlinh93@gmail.com>
4# key: highlight
5# --
6{% highlight ${1:language} %}
7${0:content}
8{% endhighlight %} \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/hr.1 b/.emacs.d/snippets/markdown-mode/hr.1
new file mode 100644
index 0000000..579ba01
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/hr.1
@@ -0,0 +1,9 @@
1# -*- mode: snippet -*-
2# name: Horizontal Rule (-)
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: hr
5# --
6
7----------
8
9$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/hr.2 b/.emacs.d/snippets/markdown-mode/hr.2
new file mode 100644
index 0000000..4d34e2f
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/hr.2
@@ -0,0 +1,9 @@
1# -*- mode: snippet -*-
2# name: Horizontal Rule (*)
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: hr
5# --
6
7*******
8
9$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/hyphen b/.emacs.d/snippets/markdown-mode/hyphen
new file mode 100644
index 0000000..8827292
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/hyphen
@@ -0,0 +1,7 @@
1# -*- mode: snippet -*-
2# name: Unordered List -
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: -
5# --
6- ${1:Text}
7- $0
diff --git a/.emacs.d/snippets/markdown-mode/img b/.emacs.d/snippets/markdown-mode/img
new file mode 100644
index 0000000..9a0db4f
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/img
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: Image
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: img
5# --
6![${1:Alt Text}](${2:URL} $3) $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/link b/.emacs.d/snippets/markdown-mode/link
new file mode 100644
index 0000000..2b96f56
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/link
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: Link
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: link
5# --
6[${1:Link Text}](${2:URL} $3) $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/ordered-list b/.emacs.d/snippets/markdown-mode/ordered-list
new file mode 100644
index 0000000..beb0f28
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/ordered-list
@@ -0,0 +1,7 @@
1# -*- mode: snippet -*-
2# name: Ordered List
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: ol
5# --
6${1:1}. ${2:Text}
7${1:$(number-to-string (1+ (string-to-number yas-text)))}. $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/plus b/.emacs.d/snippets/markdown-mode/plus
new file mode 100644
index 0000000..ebcaab1
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/plus
@@ -0,0 +1,7 @@
1# -*- mode: snippet -*-
2# name: Unordered List +
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: +
5# --
6+ ${1:Text}
7+$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/rimg b/.emacs.d/snippets/markdown-mode/rimg
new file mode 100644
index 0000000..85046e4
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/rimg
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: Referenced Image
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: rimg
5# --
6![${1:Alt Text}][$2] $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/rlb b/.emacs.d/snippets/markdown-mode/rlb
new file mode 100644
index 0000000..6aabc4a
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/rlb
@@ -0,0 +1,7 @@
1# -*- mode: snippet -*-
2# name: Reference Label
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: rlb
5# --
6[${1:Reference}]: ${2:URL} $3
7$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/rlink b/.emacs.d/snippets/markdown-mode/rlink
new file mode 100644
index 0000000..cce2e1a
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/rlink
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: Reference Link
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: rlink
5# --
6[${1:Link Text}][$2] $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/strong-emphasis b/.emacs.d/snippets/markdown-mode/strong-emphasis
new file mode 100644
index 0000000..bcef3f9
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/strong-emphasis
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: Strong emphasis
3# contributor: Peng Deng <dengpeng@gmail.com>
4# key: __
5# --
6**${1:Text}** $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/markdown-mode/utf8 b/.emacs.d/snippets/markdown-mode/utf8
new file mode 100644
index 0000000..0b39d88
--- /dev/null
+++ b/.emacs.d/snippets/markdown-mode/utf8
@@ -0,0 +1,7 @@
1# -*- mode: snippet -*-
2# name: UTF-8 encoding
3# key: utf8
4# contributor: Thiago Perrotta
5# --
6<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
7$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/prog-mode/.yas-setup.el b/.emacs.d/snippets/prog-mode/.yas-setup.el
index 486ae47..7d6127d 100644
--- a/.emacs.d/snippets/prog-mode/.yas-setup.el
+++ b/.emacs.d/snippets/prog-mode/.yas-setup.el
@@ -1,3 +1,4 @@
1;;; -*- lexical-binding: t -*-
1(require 'yasnippet) 2(require 'yasnippet)
2 3
3;; whitespace removing functions from Magnar Sveen ;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4;; whitespace removing functions from Magnar Sveen ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -29,8 +30,9 @@
29 (yas-s-trim comment-start)) 30 (yas-s-trim comment-start))
30 31
31(defun yas-trimmed-comment-end () 32(defun yas-trimmed-comment-end ()
32 "This function returns `comment-end' trimmed by whitespaces if `comment-end' is not empty. 33 "This function returns `comment-end' trimmed by whitespaces if
33Otherwise the reversed output of function `yas-trimmed-comment-start' is returned." 34`comment-end' is not empty. Otherwise the reversed output of
35function `yas-trimmed-comment-start' is returned."
34 (if (eq (length comment-end) 0) 36 (if (eq (length comment-end) 0)
35 (yas-string-reverse (yas-trimmed-comment-start)) 37 (yas-string-reverse (yas-trimmed-comment-start))
36 (yas-s-trim comment-end))) 38 (yas-s-trim comment-end)))
diff --git a/.emacs.d/snippets/python-mode.statnett/.yas-setup.el b/.emacs.d/snippets/python-mode.statnett/.yas-setup.el
index 8b29215..e9145ef 100644
--- a/.emacs.d/snippets/python-mode.statnett/.yas-setup.el
+++ b/.emacs.d/snippets/python-mode.statnett/.yas-setup.el
@@ -1,3 +1,4 @@
1;;; -*- lexical-binding: t -*-
1(require 'yasnippet) 2(require 'yasnippet)
2(defvar yas-text) 3(defvar yas-text)
3 4
diff --git a/.emacs.d/snippets/python-mode/.yas-setup.el b/.emacs.d/snippets/python-mode/.yas-setup.el
index 8b29215..e9145ef 100644
--- a/.emacs.d/snippets/python-mode/.yas-setup.el
+++ b/.emacs.d/snippets/python-mode/.yas-setup.el
@@ -1,3 +1,4 @@
1;;; -*- lexical-binding: t -*-
1(require 'yasnippet) 2(require 'yasnippet)
2(defvar yas-text) 3(defvar yas-text)
3 4
diff --git a/.emacs.d/snippets/yasnippet-snippets.el b/.emacs.d/snippets/yasnippet-snippets.el
new file mode 100644
index 0000000..958f6da
--- /dev/null
+++ b/.emacs.d/snippets/yasnippet-snippets.el
@@ -0,0 +1,77 @@
1;;; yasnippet-snippets.el --- Collection of yasnippet snippets -*- lexical-binding: t -*-
2
3;; Copyright (C) 2017 Andrea Crotti
4
5;; Author: Andrea Crotti <andrea.crotti.0@gmail.com>
6;; Keywords: snippets
7;; Version: 1.0
8;; Package-Requires: ((yasnippet "0.8.0"))
9;; Keywords: convenience, snippets
10;; Homepage: https://github.com/AndreaCrotti/yasnippet-snippets
11
12;;; Commentary:
13
14;; Official snippet collection for the yasnippet package.
15
16;;; License:
17
18;; This program is free software; you can redistribute it and/or modify
19;; it under the terms of the GNU General Public License as published by
20;; the Free Software Foundation, either version 3 of the License, or
21;; (at your option) any later version.
22
23;; This program is distributed in the hope that it will be useful,
24;; but WITHOUT ANY WARRANTY; without even the implied warranty of
25;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26;; GNU General Public License for more details.
27
28;; You should have received a copy of the GNU General Public License
29;; along with this program. If not, see <http://www.gnu.org/licenses/>.
30
31;;; Code:
32
33(require 'yasnippet)
34
35(defconst yasnippet-snippets-dir
36 (expand-file-name
37 "snippets"
38 (file-name-directory
39 ;; Copied from ‘f-this-file’ from f.el.
40 (cond
41 (load-in-progress load-file-name)
42 ((and (boundp 'byte-compile-current-file) byte-compile-current-file)
43 byte-compile-current-file)
44 (:else (buffer-file-name))))))
45
46;;;###autoload
47(defun yasnippet-snippets-initialize ()
48 "Load the `yasnippet-snippets' snippets directory."
49 ;; NOTE: we add the symbol `yasnippet-snippets-dir' rather than its
50 ;; value, so that yasnippet will automatically find the directory
51 ;; after this package is updated (i.e., moves directory).
52 (unless (member 'yasnippet-snippets-dir yas-snippet-dirs)
53 (add-to-list 'yas-snippet-dirs 'yasnippet-snippets-dir t)
54 (yas--load-snippet-dirs)))
55
56(defgroup yasnippet-snippets nil
57 "Options for yasnippet setups.
58
59This is useful for customizing options declared in
60“.yas-setup.el” files. For example, you could declare a
61customizable variable used for a snippet expansion.
62
63See Info node `(elisp)Customization Types'."
64 :group 'yasnippet)
65
66(defun yasnippet-snippets--no-indent ()
67 "Set `yas-indent-line' to nil."
68 (set (make-local-variable 'yas-indent-line) nil))
69
70;;;###autoload
71(eval-after-load 'yasnippet
72 '(yasnippet-snippets-initialize))
73
74
75(provide 'yasnippet-snippets)
76
77;;; yasnippet-snippets.el ends here