diff options
| author | Simeon Simeonov | 2016-06-16 09:07:53 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2016-06-16 09:07:53 +0200 |
| commit | 991f8ff925f51fd5598db72885f8cca1a1a79bed (patch) | |
| tree | f55c97c928d5e7f408ee459f713b2c57af34afdd /.emacs.d/snippets | |
| parent | 29f6287f356ef9fc016e2f26861ff9a14443f3ea (diff) | |
Upgrade all modes, include snippets/html-mode, snippets/nxml-mode and snippets/prog-mode
Diffstat (limited to '.emacs.d/snippets')
44 files changed, 209 insertions, 2 deletions
diff --git a/.emacs.d/snippets/html-mode/.yas-parents b/.emacs.d/snippets/html-mode/.yas-parents new file mode 100644 index 0000000..74c3dd5 --- /dev/null +++ b/.emacs.d/snippets/html-mode/.yas-parents | |||
| @@ -0,0 +1 @@ | |||
| nxml-mode | |||
diff --git a/.emacs.d/snippets/html-mode/dd b/.emacs.d/snippets/html-mode/dd new file mode 100644 index 0000000..8120b13 --- /dev/null +++ b/.emacs.d/snippets/html-mode/dd | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Rodrigo Setti <rodrigosetti@gmail.com> | ||
| 2 | #name : <dd> ... </dd> | ||
| 3 | #group : list | ||
| 4 | # -- | ||
| 5 | <dd>$1</dd> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/dl b/.emacs.d/snippets/html-mode/dl new file mode 100644 index 0000000..be11bb5 --- /dev/null +++ b/.emacs.d/snippets/html-mode/dl | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #contributor : Rodrigo Setti <rodrigosetti@gmail.com> | ||
| 2 | #name : <dl> ... </dl> | ||
| 3 | #group : list | ||
| 4 | # -- | ||
| 5 | <dl> | ||
| 6 | $0 | ||
| 7 | </dl> | ||
diff --git a/.emacs.d/snippets/html-mode/doctype b/.emacs.d/snippets/html-mode/doctype new file mode 100644 index 0000000..a60dfb6 --- /dev/null +++ b/.emacs.d/snippets/html-mode/doctype | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : Doctype HTML 4.01 Strict | ||
| 2 | #group : meta | ||
| 3 | # -- | ||
| 4 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/doctype.html5 b/.emacs.d/snippets/html-mode/doctype.html5 new file mode 100644 index 0000000..a892472 --- /dev/null +++ b/.emacs.d/snippets/html-mode/doctype.html5 | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : Doctype HTML 5 | ||
| 2 | #group : meta | ||
| 3 | # -- | ||
| 4 | <!DOCTYPE html> | ||
diff --git a/.emacs.d/snippets/html-mode/doctype.xhtml1 b/.emacs.d/snippets/html-mode/doctype.xhtml1 new file mode 100644 index 0000000..5d95e07 --- /dev/null +++ b/.emacs.d/snippets/html-mode/doctype.xhtml1 | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : DocType XHTML 1.0 frameset | ||
| 2 | #group : meta | ||
| 3 | # -- | ||
| 4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/doctype.xhtml1_1 b/.emacs.d/snippets/html-mode/doctype.xhtml1_1 new file mode 100644 index 0000000..fec46d7 --- /dev/null +++ b/.emacs.d/snippets/html-mode/doctype.xhtml1_1 | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : DocType XHTML 1.1 | ||
| 2 | #group : meta | ||
| 3 | # -- | ||
| 4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/doctype.xhtml1_strict b/.emacs.d/snippets/html-mode/doctype.xhtml1_strict new file mode 100644 index 0000000..20d95d3 --- /dev/null +++ b/.emacs.d/snippets/html-mode/doctype.xhtml1_strict | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : DocType XHTML 1.0 Strict | ||
| 2 | #group : meta | ||
| 3 | # -- | ||
| 4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/doctype.xhtml1_transitional b/.emacs.d/snippets/html-mode/doctype.xhtml1_transitional new file mode 100644 index 0000000..c5255fc --- /dev/null +++ b/.emacs.d/snippets/html-mode/doctype.xhtml1_transitional | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : DocType XHTML 1.0 Transitional | ||
| 2 | #group : meta | ||
| 3 | # -- | ||
| 4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/dt b/.emacs.d/snippets/html-mode/dt new file mode 100644 index 0000000..f385cec --- /dev/null +++ b/.emacs.d/snippets/html-mode/dt | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Rodrigo Setti <rodrigosetti@gmail.com> | ||
| 2 | #name : <dt> ... </dt> | ||
| 3 | #group : list | ||
| 4 | # -- | ||
| 5 | <dt>$1</dt> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/form b/.emacs.d/snippets/html-mode/form new file mode 100644 index 0000000..f1c066d --- /dev/null +++ b/.emacs.d/snippets/html-mode/form | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name :<form method="..." id="..." action="..."></form> | ||
| 3 | # -- | ||
| 4 | <form method="$1" id="$2" action="$3"> | ||
| 5 | $0 | ||
| 6 | </form> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/html b/.emacs.d/snippets/html-mode/html new file mode 100644 index 0000000..958aa6d --- /dev/null +++ b/.emacs.d/snippets/html-mode/html | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name : <html>...</html> | ||
| 3 | # -- | ||
| 4 | <html> | ||
| 5 | $0 | ||
| 6 | </html> | ||
diff --git a/.emacs.d/snippets/html-mode/html.xmlns b/.emacs.d/snippets/html-mode/html.xmlns new file mode 100644 index 0000000..7dd7ee4 --- /dev/null +++ b/.emacs.d/snippets/html-mode/html.xmlns | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name : <html xmlns="...">...</html> | ||
| 3 | # -- | ||
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${1:en}" lang="${2:en}"> | ||
| 5 | $0 | ||
| 6 | </html> | ||
diff --git a/.emacs.d/snippets/html-mode/link.import b/.emacs.d/snippets/html-mode/link.import new file mode 100644 index 0000000..30b8fd3 --- /dev/null +++ b/.emacs.d/snippets/html-mode/link.import | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Vikrant Rathore <vikrant@vyomtech.com> | ||
| 2 | #name : <link rel="import" /> | ||
| 3 | # -- | ||
| 4 | <link rel="import" href="${1:url}" /> | ||
diff --git a/.emacs.d/snippets/html-mode/link.stylesheet b/.emacs.d/snippets/html-mode/link.stylesheet new file mode 100644 index 0000000..6c9de74 --- /dev/null +++ b/.emacs.d/snippets/html-mode/link.stylesheet | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name : <link stylesheet="..." /> | ||
| 3 | # -- | ||
| 4 | <link rel="${1:stylesheet}" href="${2:url}" type="${3:text/css}" media="${4:screen}" /> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/link.stylesheet-ie b/.emacs.d/snippets/html-mode/link.stylesheet-ie new file mode 100644 index 0000000..4f6a776 --- /dev/null +++ b/.emacs.d/snippets/html-mode/link.stylesheet-ie | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name : <!--[if IE]><link stylesheet="..." /><![endif]--> | ||
| 3 | # -- | ||
| 4 | <!--[if IE]> | ||
| 5 | <link rel="${1:stylesheet}" href="${2:url}" type="${3:text/css}" media="${4:screen}" /> | ||
| 6 | <![endif]--> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/mailto b/.emacs.d/snippets/html-mode/mailto new file mode 100644 index 0000000..419f2a5 --- /dev/null +++ b/.emacs.d/snippets/html-mode/mailto | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name : <a href="mailto:...@...">...</a> | ||
| 3 | # -- | ||
| 4 | <a href="mailto:$1@$2">$0</a> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/meta b/.emacs.d/snippets/html-mode/meta new file mode 100644 index 0000000..30319ef --- /dev/null +++ b/.emacs.d/snippets/html-mode/meta | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #group : meta | ||
| 3 | #name : <meta name="..." content="..." /> | ||
| 4 | # -- | ||
| 5 | <meta name="${1:generator}" content="${2:content}" /> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/meta.http-equiv b/.emacs.d/snippets/html-mode/meta.http-equiv new file mode 100644 index 0000000..9913652 --- /dev/null +++ b/.emacs.d/snippets/html-mode/meta.http-equiv | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name : <meta http-equiv="..." content="..." /> | ||
| 3 | #group : meta | ||
| 4 | # -- | ||
| 5 | <meta http-equiv="${1:Content-Type}" content="${2:text/html; charset=UTF-8}" /> | ||
diff --git a/.emacs.d/snippets/html-mode/script.javascript b/.emacs.d/snippets/html-mode/script.javascript new file mode 100644 index 0000000..bf0c3b5 --- /dev/null +++ b/.emacs.d/snippets/html-mode/script.javascript | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name :<script type="text/javascript">...</script> | ||
| 3 | # -- | ||
| 4 | <script type="text/javascript"> | ||
| 5 | $0 | ||
| 6 | </script> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/script.javascript-src b/.emacs.d/snippets/html-mode/script.javascript-src new file mode 100644 index 0000000..b64c4dc --- /dev/null +++ b/.emacs.d/snippets/html-mode/script.javascript-src | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name :<script type="text/javascript" src="..."></script> | ||
| 3 | # -- | ||
| 4 | <script type="text/javascript" src="$1"></script> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/textarea b/.emacs.d/snippets/html-mode/textarea new file mode 100644 index 0000000..058498f --- /dev/null +++ b/.emacs.d/snippets/html-mode/textarea | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name : <textarea ...></textarea> | ||
| 3 | # -- | ||
| 4 | <textarea name="$1" id="$2" rows="$3" cols="$4" tabindex="$5"></textarea> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/html-mode/th b/.emacs.d/snippets/html-mode/th new file mode 100644 index 0000000..3b5fab1 --- /dev/null +++ b/.emacs.d/snippets/html-mode/th | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Jimmy Wu <frozenthrone88@gmail.com> | ||
| 2 | #name : <th>...</th> | ||
| 3 | #group : table | ||
| 4 | # -- | ||
| 5 | <th$1>$2</th> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/body b/.emacs.d/snippets/nxml-mode/body new file mode 100644 index 0000000..ddcf0cf --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/body | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <body>...</body> | ||
| 3 | # -- | ||
| 4 | <body$1> | ||
| 5 | $0 | ||
| 6 | </body> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/br b/.emacs.d/snippets/nxml-mode/br new file mode 100644 index 0000000..ba35773 --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/br | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <br /> | ||
| 3 | # -- | ||
| 4 | <br /> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/doctype b/.emacs.d/snippets/nxml-mode/doctype new file mode 100644 index 0000000..3fdcf17 --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/doctype | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : DocType XHTML 1.1 | ||
| 3 | #group : meta | ||
| 4 | # -- | ||
| 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/doctype_xhtml1_strict b/.emacs.d/snippets/nxml-mode/doctype_xhtml1_strict new file mode 100644 index 0000000..eca5860 --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/doctype_xhtml1_strict | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : DocType XHTML 1.0 Strict | ||
| 3 | #group : meta | ||
| 4 | # -- | ||
| 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/doctype_xhtml1_transitional b/.emacs.d/snippets/nxml-mode/doctype_xhtml1_transitional new file mode 100644 index 0000000..fba232a --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/doctype_xhtml1_transitional | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : DocType XHTML 1.0 Transitional | ||
| 3 | #group : meta | ||
| 4 | # -- | ||
| 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/form b/.emacs.d/snippets/nxml-mode/form new file mode 100644 index 0000000..252253e --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/form | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name :<form method="..." action="..."></form> | ||
| 3 | # -- | ||
| 4 | <form method="$1" action="$2"> | ||
| 5 | $0 | ||
| 6 | </form> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/href b/.emacs.d/snippets/nxml-mode/href new file mode 100644 index 0000000..47cb84a --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/href | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <a href="...">...</a> | ||
| 3 | #key: a | ||
| 4 | # -- | ||
| 5 | <a href="$1">$2</a> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/html b/.emacs.d/snippets/nxml-mode/html new file mode 100644 index 0000000..85e09f7 --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/html | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <html xmlns="...">...</html> | ||
| 3 | # -- | ||
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${1:en}" lang="${2:en}"> | ||
| 5 | $0 | ||
| 6 | </html> | ||
diff --git a/.emacs.d/snippets/nxml-mode/img b/.emacs.d/snippets/nxml-mode/img new file mode 100644 index 0000000..1f4382b --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/img | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <img src="..." alt="..." /> | ||
| 3 | # -- | ||
| 4 | <img src="$1" alt="$2" /> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/input b/.emacs.d/snippets/nxml-mode/input new file mode 100644 index 0000000..80c3503 --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/input | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <input ... /> | ||
| 3 | # -- | ||
| 4 | <input type="$1" name="$2" value="$3" /> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/link b/.emacs.d/snippets/nxml-mode/link new file mode 100644 index 0000000..d93b7a5 --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/link | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <link stylesheet="..." /> | ||
| 3 | # -- | ||
| 4 | <link rel="${1:stylesheet}" href="${2:url}" type="${3:text/css}" media="${4:screen}" /> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/meta b/.emacs.d/snippets/nxml-mode/meta new file mode 100644 index 0000000..dfee1f2 --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/meta | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <meta name="..." content="..." /> | ||
| 3 | #group : meta | ||
| 4 | # -- | ||
| 5 | <meta name="${1:generator}" content="${2:content}" /> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/name b/.emacs.d/snippets/nxml-mode/name new file mode 100644 index 0000000..592d0da --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/name | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <a name="..."></a> | ||
| 3 | # -- | ||
| 4 | <a name="$1"></a> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/quote b/.emacs.d/snippets/nxml-mode/quote new file mode 100644 index 0000000..20fed1e --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/quote | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <blockquote>...</blockquote> | ||
| 3 | # -- | ||
| 4 | <blockquote> | ||
| 5 | $1 | ||
| 6 | </blockquote> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/style b/.emacs.d/snippets/nxml-mode/style new file mode 100644 index 0000000..b80be1c --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/style | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <style type="text/css" media="...">...</style> | ||
| 3 | # -- | ||
| 4 | <style type="text/css" media="${1:screen}"> | ||
| 5 | $0 | ||
| 6 | </style> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/nxml-mode/tag b/.emacs.d/snippets/nxml-mode/tag new file mode 100644 index 0000000..7c6a766 --- /dev/null +++ b/.emacs.d/snippets/nxml-mode/tag | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #contributor : Anders Bach Nielsen <abachn@abachn.net> | ||
| 2 | #name : <tag>...</tag> | ||
| 3 | #key: t | ||
| 4 | # -- | ||
| 5 | <${1:tag}>$2</$1>$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 new file mode 100644 index 0000000..03d07cf --- /dev/null +++ b/.emacs.d/snippets/prog-mode/.yas-setup.el | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | (defun yas-with-comment (str) | ||
| 2 | (format "%s%s%s" comment-start str comment-end)) | ||
diff --git a/.emacs.d/snippets/prog-mode/fixme b/.emacs.d/snippets/prog-mode/fixme new file mode 100644 index 0000000..146db8b --- /dev/null +++ b/.emacs.d/snippets/prog-mode/fixme | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fixme | ||
| 3 | # key: fi | ||
| 4 | # condition: (not (eq major-mode 'sh-mode)) | ||
| 5 | # -- | ||
| 6 | `(yas-with-comment "FIXME: ")` \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/prog-mode/todo b/.emacs.d/snippets/prog-mode/todo new file mode 100644 index 0000000..973151f --- /dev/null +++ b/.emacs.d/snippets/prog-mode/todo | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: todo | ||
| 3 | # key: t | ||
| 4 | # -- | ||
| 5 | `(yas-with-comment "TODO: ")` \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/prog-mode/xxx b/.emacs.d/snippets/prog-mode/xxx new file mode 100644 index 0000000..09df18b --- /dev/null +++ b/.emacs.d/snippets/prog-mode/xxx | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: xxx | ||
| 3 | # key: x | ||
| 4 | # -- | ||
| 5 | `(yas-with-comment "XXX: ")` \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode/.yas-setup.el b/.emacs.d/snippets/python-mode/.yas-setup.el index 864cbce..3f57d15 100644 --- a/.emacs.d/snippets/python-mode/.yas-setup.el +++ b/.emacs.d/snippets/python-mode/.yas-setup.el | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | (defvar yas-text) | ||
| 2 | |||
| 1 | (defun python-split-args (arg-string) | 3 | (defun python-split-args (arg-string) |
| 2 | "Split a python argument string into ((name, default)..) tuples" | 4 | "Split a python argument string into ((name, default)..) tuples" |
| 3 | (mapcar (lambda (x) | 5 | (mapcar (lambda (x) |
| @@ -11,12 +13,12 @@ | |||
| 11 | (max-len (if args (apply 'max (mapcar (lambda (x) (length (nth 0 x))) args)) 0)) | 13 | (max-len (if args (apply 'max (mapcar (lambda (x) (length (nth 0 x))) args)) 0)) |
| 12 | (formatted-args (mapconcat | 14 | (formatted-args (mapconcat |
| 13 | (lambda (x) | 15 | (lambda (x) |
| 14 | (concat ":param " (nth 0 x) (make-string (- max-len (length (nth 0 x))) ? ) ": " | 16 | (concat (nth 0 x) (make-string (- max-len (length (nth 0 x))) ? ) " -- " |
| 15 | (if (nth 1 x) (concat "\(default " (nth 1 x) "\)")))) | 17 | (if (nth 1 x) (concat "\(default " (nth 1 x) "\)")))) |
| 16 | args | 18 | args |
| 17 | indent))) | 19 | indent))) |
| 18 | (unless (string= formatted-args "") | 20 | (unless (string= formatted-args "") |
| 19 | (mapconcat 'identity (list "Keyword arguments:" formatted-args) indent)))) | 21 | (mapconcat 'identity (list "Keyword Arguments:" formatted-args) indent)))) |
| 20 | 22 | ||
| 21 | (add-hook 'python-mode-hook | 23 | (add-hook 'python-mode-hook |
| 22 | '(lambda () (set (make-local-variable 'yas-indent-line) 'fixed))) | 24 | '(lambda () (set (make-local-variable 'yas-indent-line) 'fixed))) |
