From c3875265ccdd1d72f06a16ab1ca725b7cb2ec35b Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Mon, 13 Sep 2021 22:49:27 -0700 Subject: Consolidated resources and meta files. --- resources/snippets/emacs-lisp-mode/add-hook | 6 ++++++ resources/snippets/emacs-lisp-mode/cond | 8 ++++++++ resources/snippets/emacs-lisp-mode/defun | 9 +++++++++ resources/snippets/emacs-lisp-mode/if | 7 +++++++ resources/snippets/emacs-lisp-mode/lambda | 7 +++++++ resources/snippets/emacs-lisp-mode/setq | 5 +++++ resources/snippets/org-mode/default | 16 ++++++++++++++++ resources/snippets/org-mode/img | 7 +++++++ resources/snippets/org-mode/quote | 7 +++++++ resources/snippets/org-mode/src | 7 +++++++ resources/snippets/org-mode/table | 11 +++++++++++ 11 files changed, 90 insertions(+) create mode 100644 resources/snippets/emacs-lisp-mode/add-hook create mode 100644 resources/snippets/emacs-lisp-mode/cond create mode 100644 resources/snippets/emacs-lisp-mode/defun create mode 100644 resources/snippets/emacs-lisp-mode/if create mode 100644 resources/snippets/emacs-lisp-mode/lambda create mode 100644 resources/snippets/emacs-lisp-mode/setq create mode 100644 resources/snippets/org-mode/default create mode 100644 resources/snippets/org-mode/img create mode 100644 resources/snippets/org-mode/quote create mode 100644 resources/snippets/org-mode/src create mode 100644 resources/snippets/org-mode/table (limited to 'resources/snippets') diff --git a/resources/snippets/emacs-lisp-mode/add-hook b/resources/snippets/emacs-lisp-mode/add-hook new file mode 100644 index 0000000..e1019e8 --- /dev/null +++ b/resources/snippets/emacs-lisp-mode/add-hook @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: add-hook +# key: hook +# -- +(add-hook '${1:mode-to-hook-on} '${2:function}) +$0 \ No newline at end of file diff --git a/resources/snippets/emacs-lisp-mode/cond b/resources/snippets/emacs-lisp-mode/cond new file mode 100644 index 0000000..738ca0a --- /dev/null +++ b/resources/snippets/emacs-lisp-mode/cond @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: cond +# key: cond +# -- +(cond (${1:first-condition} ${2:first-return}) + (${3:second-condition} ${4:second-return}) + (t ${5:always-true-return})) +$0 \ No newline at end of file diff --git a/resources/snippets/emacs-lisp-mode/defun b/resources/snippets/emacs-lisp-mode/defun new file mode 100644 index 0000000..e67e483 --- /dev/null +++ b/resources/snippets/emacs-lisp-mode/defun @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: defun +# key: def +# -- +(defun ${1:function-name} (${2:arguments}) + "${3:Docstring: Indicate in imperitave voice what the function does. +Second and subsequent lines must have nil indentation to preserve +formatting in }" + $0) \ No newline at end of file diff --git a/resources/snippets/emacs-lisp-mode/if b/resources/snippets/emacs-lisp-mode/if new file mode 100644 index 0000000..8b464af --- /dev/null +++ b/resources/snippets/emacs-lisp-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# -- +(if (${1:condition}) + (${2:then}) + ${3:else}) \ No newline at end of file diff --git a/resources/snippets/emacs-lisp-mode/lambda b/resources/snippets/emacs-lisp-mode/lambda new file mode 100644 index 0000000..9d11249 --- /dev/null +++ b/resources/snippets/emacs-lisp-mode/lambda @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: lambda +# key: lambda +# -- +(lambda (${1:argument(s)}) + "${2:Docstring}" + $0) \ No newline at end of file diff --git a/resources/snippets/emacs-lisp-mode/setq b/resources/snippets/emacs-lisp-mode/setq new file mode 100644 index 0000000..f315eae --- /dev/null +++ b/resources/snippets/emacs-lisp-mode/setq @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: setq +# key: setq +# -- +(setq $0) \ No newline at end of file diff --git a/resources/snippets/org-mode/default b/resources/snippets/org-mode/default new file mode 100644 index 0000000..f667c69 --- /dev/null +++ b/resources/snippets/org-mode/default @@ -0,0 +1,16 @@ +# -*- mode: snippet -*- +# name: default +# key: $default +# -- +# -*- mode: org; -*- + +#+TITLE: ${1:Default Title} +#+AUTHOR: ${2:`(if (eq user-full-name "") "Default Author" user-full-name)`} +#+DATE: ${3:`(with-temp-buffer (org-insert-time-stamp (current-time)))`} + +#+SETUPFILE: ~/.emacs.d/templates/documents/${4:`(if (string= system-type "gnu/linux") "gnu-" "ms-:")`}default.setup +#+INCLUDE: ~/.emacs.d/templates/documents/title-default.org + +$0 + + diff --git a/resources/snippets/org-mode/img b/resources/snippets/org-mode/img new file mode 100644 index 0000000..5632367 --- /dev/null +++ b/resources/snippets/org-mode/img @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: img +# key: $img +# -- +#+NAME: ${1:image-title} +#+CAPTION[${2:Short caption}]: $2. ${3:Optional additional details} +[[`(concat user-emacs-directory "img/")`$0--]] \ No newline at end of file diff --git a/resources/snippets/org-mode/quote b/resources/snippets/org-mode/quote new file mode 100644 index 0000000..e716010 --- /dev/null +++ b/resources/snippets/org-mode/quote @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: quote +# key: $quote +# -- +#+BEGIN_QUOTE +$0 +#+END_QUOTE diff --git a/resources/snippets/org-mode/src b/resources/snippets/org-mode/src new file mode 100644 index 0000000..cdada53 --- /dev/null +++ b/resources/snippets/org-mode/src @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: src +# key: $src +# -- +#+BEGIN_SRC ${1:emacs-lisp} ${2::tangle yes} +$0 +#+END_SRC diff --git a/resources/snippets/org-mode/table b/resources/snippets/org-mode/table new file mode 100644 index 0000000..9e40d92 --- /dev/null +++ b/resources/snippets/org-mode/table @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: table +# key: $tab +# -- +#+NAME: ${1:table-title} +#+CAPTION[${2:Short caption}]: $2. ${3:Optional additional details} +#+ATTR_LATEX: :booktabs t +| *${4:Title of Entries}* | *${5:Column 2}* | *${6:Column 2}* | +|-------------------------+-----------------+-----------------| +| *${7:Entry 1}* | $0 | | +| | | | -- cgit v1.2.3