From 4e57fb98342dd3cce7faa38e25c8ec2014a21865 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Mon, 22 Apr 2024 15:25:08 +0200 Subject: Update markdown-mode, yasnippet, yasnippet-snippets and add snippets/markdown-mode --- .emacs.d/snippets/markdown-mode/back-quote | 6 ++ .emacs.d/snippets/markdown-mode/code | 7 ++ .emacs.d/snippets/markdown-mode/emphasis | 6 ++ .emacs.d/snippets/markdown-mode/h1.1 | 8 +++ .emacs.d/snippets/markdown-mode/h1.2 | 9 +++ .emacs.d/snippets/markdown-mode/h2.1 | 8 +++ .emacs.d/snippets/markdown-mode/h2.2 | 9 +++ .emacs.d/snippets/markdown-mode/h3 | 8 +++ .emacs.d/snippets/markdown-mode/h4 | 8 +++ .emacs.d/snippets/markdown-mode/h5 | 8 +++ .emacs.d/snippets/markdown-mode/h6 | 8 +++ .emacs.d/snippets/markdown-mode/highlight | 8 +++ .emacs.d/snippets/markdown-mode/hr.1 | 9 +++ .emacs.d/snippets/markdown-mode/hr.2 | 9 +++ .emacs.d/snippets/markdown-mode/hyphen | 7 ++ .emacs.d/snippets/markdown-mode/img | 6 ++ .emacs.d/snippets/markdown-mode/link | 6 ++ .emacs.d/snippets/markdown-mode/ordered-list | 7 ++ .emacs.d/snippets/markdown-mode/plus | 7 ++ .emacs.d/snippets/markdown-mode/rimg | 6 ++ .emacs.d/snippets/markdown-mode/rlb | 7 ++ .emacs.d/snippets/markdown-mode/rlink | 6 ++ .emacs.d/snippets/markdown-mode/strong-emphasis | 6 ++ .emacs.d/snippets/markdown-mode/utf8 | 7 ++ .emacs.d/snippets/prog-mode/.yas-setup.el | 6 +- .../snippets/python-mode.statnett/.yas-setup.el | 1 + .emacs.d/snippets/python-mode/.yas-setup.el | 1 + .emacs.d/snippets/yasnippet-snippets.el | 77 ++++++++++++++++++++++ 28 files changed, 259 insertions(+), 2 deletions(-) create mode 100644 .emacs.d/snippets/markdown-mode/back-quote create mode 100644 .emacs.d/snippets/markdown-mode/code create mode 100644 .emacs.d/snippets/markdown-mode/emphasis create mode 100644 .emacs.d/snippets/markdown-mode/h1.1 create mode 100644 .emacs.d/snippets/markdown-mode/h1.2 create mode 100644 .emacs.d/snippets/markdown-mode/h2.1 create mode 100644 .emacs.d/snippets/markdown-mode/h2.2 create mode 100644 .emacs.d/snippets/markdown-mode/h3 create mode 100644 .emacs.d/snippets/markdown-mode/h4 create mode 100644 .emacs.d/snippets/markdown-mode/h5 create mode 100644 .emacs.d/snippets/markdown-mode/h6 create mode 100644 .emacs.d/snippets/markdown-mode/highlight create mode 100644 .emacs.d/snippets/markdown-mode/hr.1 create mode 100644 .emacs.d/snippets/markdown-mode/hr.2 create mode 100644 .emacs.d/snippets/markdown-mode/hyphen create mode 100644 .emacs.d/snippets/markdown-mode/img create mode 100644 .emacs.d/snippets/markdown-mode/link create mode 100644 .emacs.d/snippets/markdown-mode/ordered-list create mode 100644 .emacs.d/snippets/markdown-mode/plus create mode 100644 .emacs.d/snippets/markdown-mode/rimg create mode 100644 .emacs.d/snippets/markdown-mode/rlb create mode 100644 .emacs.d/snippets/markdown-mode/rlink create mode 100644 .emacs.d/snippets/markdown-mode/strong-emphasis create mode 100644 .emacs.d/snippets/markdown-mode/utf8 create mode 100644 .emacs.d/snippets/yasnippet-snippets.el (limited to '.emacs.d/snippets') 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 @@ +# -*- mode: snippet -*- +# name: Inline Code +# contributor: Peng Deng +# key: ` +# -- +\`${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 @@ +# -*- mode: snippet -*- +# name: Code block +# key: code +# -- +\`\`\`$1 +$0 +\`\`\` 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 @@ +# -*- mode: snippet -*- +# name: Emphasis +# contributor: Peng Deng +# key: _ +# -- +_${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 @@ +# -*- mode: snippet -*- +# name: Header 1 (#) +# contributor: Peng Deng +# key: h1 +# -- +# ${1:Header 1} # + +$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 @@ +# -*- mode: snippet -*- +# name: Header 1 (=) +# contributor: Peng Deng +# key: h1 +# -- +${1:Header 1} +${1:$(make-string (string-width yas-text) ?\=)} + +$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 @@ +# -*- mode: snippet -*- +# name: Header 2 (##) +# contributor: Peng Deng +# key: h2 +# -- +## ${1:Header 1} ## + +$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 @@ +# -*- mode: snippet -*- +# name: Header 2 (-) +# contributor: Peng Deng +# key: h2 +# -- +${1:Header 2} +${1:$(make-string (string-width yas-text) ?\-)} + +$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 @@ +# -*- mode: snippet -*- +# name: Header 3 +# contributor: Peng Deng +# key: h3 +# -- +### ${1:Header 3} ### + +$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 @@ +# -*- mode: snippet -*- +# name: Header 4 +# contributor: Peng Deng +# key: h4 +# -- +#### ${1:Header 4} #### + +$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 @@ +# -*- mode: snippet -*- +# name: Header 5 +# contributor: Peng Deng +# key: h5 +# -- +##### ${1:Header 5} ##### + +$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 @@ +# -*- mode: snippet -*- +# name: Header 6 +# contributor: Peng Deng +# key: h6 +# -- +###### ${1:Header 6} ###### + +$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 @@ +# -*- mode: snippet -*- +# name: Highlight +# contributor: nguyenvinhlinh +# key: highlight +# -- +{% highlight ${1:language} %} +${0:content} +{% 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 @@ +# -*- mode: snippet -*- +# name: Horizontal Rule (-) +# contributor: Peng Deng +# key: hr +# -- + +---------- + +$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 @@ +# -*- mode: snippet -*- +# name: Horizontal Rule (*) +# contributor: Peng Deng +# key: hr +# -- + +******* + +$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 @@ +# -*- mode: snippet -*- +# name: Unordered List - +# contributor: Peng Deng +# key: - +# -- +- ${1:Text} +- $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 @@ +# -*- mode: snippet -*- +# name: Image +# contributor: Peng Deng +# key: img +# -- +![${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 @@ +# -*- mode: snippet -*- +# name: Link +# contributor: Peng Deng +# key: link +# -- +[${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 @@ +# -*- mode: snippet -*- +# name: Ordered List +# contributor: Peng Deng +# key: ol +# -- +${1:1}. ${2:Text} +${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 @@ +# -*- mode: snippet -*- +# name: Unordered List + +# contributor: Peng Deng +# key: + +# -- ++ ${1:Text} ++$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 @@ +# -*- mode: snippet -*- +# name: Referenced Image +# contributor: Peng Deng +# key: rimg +# -- +![${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 @@ +# -*- mode: snippet -*- +# name: Reference Label +# contributor: Peng Deng +# key: rlb +# -- +[${1:Reference}]: ${2:URL} $3 +$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 @@ +# -*- mode: snippet -*- +# name: Reference Link +# contributor: Peng Deng +# key: rlink +# -- +[${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 @@ +# -*- mode: snippet -*- +# name: Strong emphasis +# contributor: Peng Deng +# key: __ +# -- +**${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 @@ +# -*- mode: snippet -*- +# name: UTF-8 encoding +# key: utf8 +# contributor: Thiago Perrotta +# -- + +$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 @@ +;;; -*- lexical-binding: t -*- (require 'yasnippet) ;; whitespace removing functions from Magnar Sveen ;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -29,8 +30,9 @@ (yas-s-trim comment-start)) (defun yas-trimmed-comment-end () - "This function returns `comment-end' trimmed by whitespaces if `comment-end' is not empty. -Otherwise the reversed output of function `yas-trimmed-comment-start' is returned." + "This function returns `comment-end' trimmed by whitespaces if +`comment-end' is not empty. Otherwise the reversed output of +function `yas-trimmed-comment-start' is returned." (if (eq (length comment-end) 0) (yas-string-reverse (yas-trimmed-comment-start)) (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 @@ +;;; -*- lexical-binding: t -*- (require 'yasnippet) (defvar yas-text) 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 @@ +;;; -*- lexical-binding: t -*- (require 'yasnippet) (defvar yas-text) 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 @@ +;;; yasnippet-snippets.el --- Collection of yasnippet snippets -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Andrea Crotti + +;; Author: Andrea Crotti +;; Keywords: snippets +;; Version: 1.0 +;; Package-Requires: ((yasnippet "0.8.0")) +;; Keywords: convenience, snippets +;; Homepage: https://github.com/AndreaCrotti/yasnippet-snippets + +;;; Commentary: + +;; Official snippet collection for the yasnippet package. + +;;; License: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Code: + +(require 'yasnippet) + +(defconst yasnippet-snippets-dir + (expand-file-name + "snippets" + (file-name-directory + ;; Copied from ‘f-this-file’ from f.el. + (cond + (load-in-progress load-file-name) + ((and (boundp 'byte-compile-current-file) byte-compile-current-file) + byte-compile-current-file) + (:else (buffer-file-name)))))) + +;;;###autoload +(defun yasnippet-snippets-initialize () + "Load the `yasnippet-snippets' snippets directory." + ;; NOTE: we add the symbol `yasnippet-snippets-dir' rather than its + ;; value, so that yasnippet will automatically find the directory + ;; after this package is updated (i.e., moves directory). + (unless (member 'yasnippet-snippets-dir yas-snippet-dirs) + (add-to-list 'yas-snippet-dirs 'yasnippet-snippets-dir t) + (yas--load-snippet-dirs))) + +(defgroup yasnippet-snippets nil + "Options for yasnippet setups. + +This is useful for customizing options declared in +“.yas-setup.el” files. For example, you could declare a +customizable variable used for a snippet expansion. + +See Info node `(elisp)Customization Types'." + :group 'yasnippet) + +(defun yasnippet-snippets--no-indent () + "Set `yas-indent-line' to nil." + (set (make-local-variable 'yas-indent-line) nil)) + +;;;###autoload +(eval-after-load 'yasnippet + '(yasnippet-snippets-initialize)) + + +(provide 'yasnippet-snippets) + +;;; yasnippet-snippets.el ends here -- cgit v1.3