diff options
| author | Simeon Simeonov | 2025-02-28 18:30:17 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2025-02-28 18:30:17 +0100 |
| commit | bcd993046ffaa3390bcf3252db8ba69d4610191c (patch) | |
| tree | 2f7fcfe1ed46f224119bc97346d6036c0504766b /.emacs.d | |
| parent | f6a91e549fe34f047acdb03e806e0f7dce9ffce1 (diff) | |
Add snippets/rust-mode and upgrade markdown-mode
Diffstat (limited to '.emacs.d')
67 files changed, 482 insertions, 25 deletions
diff --git a/.emacs.d/lisp/markdown-mode.el b/.emacs.d/lisp/markdown-mode.el index f99897d..a914eb3 100644 --- a/.emacs.d/lisp/markdown-mode.el +++ b/.emacs.d/lisp/markdown-mode.el | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | ;; Author: Jason R. Blevins <jblevins@xbeta.org> | 6 | ;; Author: Jason R. Blevins <jblevins@xbeta.org> |
| 7 | ;; Maintainer: Jason R. Blevins <jblevins@xbeta.org> | 7 | ;; Maintainer: Jason R. Blevins <jblevins@xbeta.org> |
| 8 | ;; Created: May 24, 2007 | 8 | ;; Created: May 24, 2007 |
| 9 | ;; Version: 2.7-alpha | 9 | ;; Version: 2.8-alpha |
| 10 | ;; Package-Requires: ((emacs "27.1")) | 10 | ;; Package-Requires: ((emacs "28.1")) |
| 11 | ;; Keywords: Markdown, GitHub Flavored Markdown, itex | 11 | ;; Keywords: Markdown, GitHub Flavored Markdown, itex |
| 12 | ;; URL: https://jblevins.org/projects/markdown-mode/ | 12 | ;; URL: https://jblevins.org/projects/markdown-mode/ |
| 13 | 13 | ||
| @@ -62,7 +62,7 @@ | |||
| 62 | 62 | ||
| 63 | ;;; Constants ================================================================= | 63 | ;;; Constants ================================================================= |
| 64 | 64 | ||
| 65 | (defconst markdown-mode-version "2.7-alpha" | 65 | (defconst markdown-mode-version "2.8-alpha" |
| 66 | "Markdown mode version number.") | 66 | "Markdown mode version number.") |
| 67 | 67 | ||
| 68 | (defconst markdown-output-buffer-name "*markdown-output*" | 68 | (defconst markdown-output-buffer-name "*markdown-output*" |
| @@ -1177,6 +1177,10 @@ escape character (see `markdown-match-escape').") | |||
| 1177 | If POS is not given, use point instead." | 1177 | If POS is not given, use point instead." |
| 1178 | (get-text-property (or pos (point)) 'markdown-comment)) | 1178 | (get-text-property (or pos (point)) 'markdown-comment)) |
| 1179 | 1179 | ||
| 1180 | (defsubst markdown-in-inline-code-p (pos) | ||
| 1181 | "Return non-nil if POS is in inline code." | ||
| 1182 | (equal (get-text-property pos 'face) '(markdown-inline-code-face))) | ||
| 1183 | |||
| 1180 | (defun markdown--face-p (pos faces) | 1184 | (defun markdown--face-p (pos faces) |
| 1181 | "Return non-nil if face of POS contain FACES." | 1185 | "Return non-nil if face of POS contain FACES." |
| 1182 | (let ((face-prop (get-text-property pos 'face))) | 1186 | (let ((face-prop (get-text-property pos 'face))) |
| @@ -8195,19 +8199,20 @@ Translate filenames using `markdown-filename-translate-function'." | |||
| 8195 | 'font-lock-multiline t)) | 8199 | 'font-lock-multiline t)) |
| 8196 | ;; Link part (without face) | 8200 | ;; Link part (without face) |
| 8197 | (lp (list 'keymap markdown-mode-mouse-map | 8201 | (lp (list 'keymap markdown-mode-mouse-map |
| 8198 | 'mouse-face 'markdown-highlight-face | ||
| 8199 | 'font-lock-multiline t | 8202 | 'font-lock-multiline t |
| 8200 | 'help-echo (if title (concat title "\n" url) url))) | 8203 | 'help-echo (if title (concat title "\n" url) url))) |
| 8201 | ;; URL part | 8204 | ;; URL part |
| 8202 | (up (list 'keymap markdown-mode-mouse-map | 8205 | (up (list 'keymap markdown-mode-mouse-map |
| 8203 | 'invisible 'markdown-markup | 8206 | 'invisible 'markdown-markup |
| 8204 | 'mouse-face 'markdown-highlight-face | ||
| 8205 | 'font-lock-multiline t)) | 8207 | 'font-lock-multiline t)) |
| 8206 | ;; URL composition character | 8208 | ;; URL composition character |
| 8207 | (url-char (markdown--first-displayable markdown-url-compose-char)) | 8209 | (url-char (markdown--first-displayable markdown-url-compose-char)) |
| 8208 | ;; Title part | 8210 | ;; Title part |
| 8209 | (tp (list 'invisible 'markdown-markup | 8211 | (tp (list 'invisible 'markdown-markup |
| 8210 | 'font-lock-multiline t))) | 8212 | 'font-lock-multiline t))) |
| 8213 | (when markdown-mouse-follow-link | ||
| 8214 | (setq lp (append lp '(mouse-face 'markdown-highlight-face))) | ||
| 8215 | (setq up (append up '(mouse-face 'markdown-highlight-face)))) | ||
| 8211 | (dolist (g '(1 2 4 5 8)) | 8216 | (dolist (g '(1 2 4 5 8)) |
| 8212 | (when (match-end g) | 8217 | (when (match-end g) |
| 8213 | (add-text-properties (match-beginning g) (match-end g) mp) | 8218 | (add-text-properties (match-beginning g) (match-end g) mp) |
| @@ -8239,7 +8244,6 @@ Translate filenames using `markdown-filename-translate-function'." | |||
| 8239 | 'font-lock-multiline t)) | 8244 | 'font-lock-multiline t)) |
| 8240 | ;; Link part | 8245 | ;; Link part |
| 8241 | (lp (list 'keymap markdown-mode-mouse-map | 8246 | (lp (list 'keymap markdown-mode-mouse-map |
| 8242 | 'mouse-face 'markdown-highlight-face | ||
| 8243 | 'font-lock-multiline t | 8247 | 'font-lock-multiline t |
| 8244 | 'help-echo (lambda (_ __ pos) | 8248 | 'help-echo (lambda (_ __ pos) |
| 8245 | (save-match-data | 8249 | (save-match-data |
| @@ -8252,6 +8256,8 @@ Translate filenames using `markdown-filename-translate-function'." | |||
| 8252 | ;; Reference part | 8256 | ;; Reference part |
| 8253 | (rp (list 'invisible 'markdown-markup | 8257 | (rp (list 'invisible 'markdown-markup |
| 8254 | 'font-lock-multiline t))) | 8258 | 'font-lock-multiline t))) |
| 8259 | (when markdown-mouse-follow-link | ||
| 8260 | (setq lp (append lp '(mouse-face markdown-highlight-face)))) | ||
| 8255 | (dolist (g '(1 2 4 5 8)) | 8261 | (dolist (g '(1 2 4 5 8)) |
| 8256 | (when (match-end g) | 8262 | (when (match-end g) |
| 8257 | (add-text-properties (match-beginning g) (match-end g) mp) | 8263 | (add-text-properties (match-beginning g) (match-end g) mp) |
| @@ -8269,22 +8275,25 @@ Translate filenames using `markdown-filename-translate-function'." | |||
| 8269 | (defun markdown-fontify-angle-uris (last) | 8275 | (defun markdown-fontify-angle-uris (last) |
| 8270 | "Add text properties to angle URIs from point to LAST." | 8276 | "Add text properties to angle URIs from point to LAST." |
| 8271 | (when (markdown-match-angle-uris last) | 8277 | (when (markdown-match-angle-uris last) |
| 8272 | (let* ((url-start (match-beginning 2)) | 8278 | (let ((url-start (match-beginning 2)) |
| 8273 | (url-end (match-end 2)) | 8279 | (url-end (match-end 2))) |
| 8274 | ;; Markup part | 8280 | (unless (or (markdown-in-inline-code-p url-start) |
| 8275 | (mp (list 'face 'markdown-markup-face | 8281 | (markdown-in-inline-code-p url-end)) |
| 8276 | 'invisible 'markdown-markup | 8282 | (let* (;; Markup part |
| 8277 | 'rear-nonsticky t | 8283 | (mp (list 'face 'markdown-markup-face |
| 8278 | 'font-lock-multiline t)) | 8284 | 'invisible 'markdown-markup |
| 8279 | ;; URI part | 8285 | 'rear-nonsticky t |
| 8280 | (up (list 'keymap markdown-mode-mouse-map | 8286 | 'font-lock-multiline t)) |
| 8281 | 'face 'markdown-plain-url-face | 8287 | ;; URI part |
| 8282 | 'mouse-face 'markdown-highlight-face | 8288 | (up (list 'keymap markdown-mode-mouse-map |
| 8283 | 'font-lock-multiline t))) | 8289 | 'face 'markdown-plain-url-face |
| 8284 | (dolist (g '(1 3)) | 8290 | 'font-lock-multiline t))) |
| 8285 | (add-text-properties (match-beginning g) (match-end g) mp)) | 8291 | (when markdown-mouse-follow-link |
| 8286 | (add-text-properties url-start url-end up) | 8292 | (setq up (append up '(mouse-face markdown-highlight-face)))) |
| 8287 | t))) | 8293 | (dolist (g '(1 3)) |
| 8294 | (add-text-properties (match-beginning g) (match-end g) mp)) | ||
| 8295 | (add-text-properties url-start url-end up) | ||
| 8296 | t))))) | ||
| 8288 | 8297 | ||
| 8289 | (defun markdown-fontify-plain-uris (last) | 8298 | (defun markdown-fontify-plain-uris (last) |
| 8290 | "Add text properties to plain URLs from point to LAST." | 8299 | "Add text properties to plain URLs from point to LAST." |
| @@ -8293,9 +8302,10 @@ Translate filenames using `markdown-filename-translate-function'." | |||
| 8293 | (end (match-end 0)) | 8302 | (end (match-end 0)) |
| 8294 | (props (list 'keymap markdown-mode-mouse-map | 8303 | (props (list 'keymap markdown-mode-mouse-map |
| 8295 | 'face 'markdown-plain-url-face | 8304 | 'face 'markdown-plain-url-face |
| 8296 | 'mouse-face 'markdown-highlight-face | ||
| 8297 | 'rear-nonsticky t | 8305 | 'rear-nonsticky t |
| 8298 | 'font-lock-multiline t))) | 8306 | 'font-lock-multiline t))) |
| 8307 | (when markdown-mouse-follow-link | ||
| 8308 | (setq props (append props '(mouse-face markdown-highlight-face)))) | ||
| 8299 | (add-text-properties start end props) | 8309 | (add-text-properties start end props) |
| 8300 | t))) | 8310 | t))) |
| 8301 | 8311 | ||
| @@ -10122,6 +10132,15 @@ rows and columns and the column alignment." | |||
| 10122 | (markdown-insert-inline-image link-text file) | 10132 | (markdown-insert-inline-image link-text file) |
| 10123 | (markdown-insert-inline-link link-text file)))) | 10133 | (markdown-insert-inline-link link-text file)))) |
| 10124 | 10134 | ||
| 10135 | (defun markdown--dnd-multi-local-file-handler (urls action) | ||
| 10136 | (let ((multile-urls-p (> (length urls) 1))) | ||
| 10137 | (dolist (url urls) | ||
| 10138 | (markdown--dnd-local-file-handler url action) | ||
| 10139 | (when multile-urls-p | ||
| 10140 | (insert " "))))) | ||
| 10141 | |||
| 10142 | (put 'markdown--dnd-multi-local-file-handler 'dnd-multiple-handler t) | ||
| 10143 | |||
| 10125 | 10144 | ||
| 10126 | ;;; Mode Definition ========================================================== | 10145 | ;;; Mode Definition ========================================================== |
| 10127 | 10146 | ||
| @@ -10251,8 +10270,14 @@ rows and columns and the column alignment." | |||
| 10251 | #'markdown--inhibit-electric-quote nil :local) | 10270 | #'markdown--inhibit-electric-quote nil :local) |
| 10252 | 10271 | ||
| 10253 | ;; drag and drop handler | 10272 | ;; drag and drop handler |
| 10254 | (setq-local dnd-protocol-alist (cons '("^file:///" . markdown--dnd-local-file-handler) | 10273 | (let ((dnd-handler (if (>= emacs-major-version 30) |
| 10255 | dnd-protocol-alist)) | 10274 | #'markdown--dnd-multi-local-file-handler |
| 10275 | #'markdown--dnd-local-file-handler))) | ||
| 10276 | (setq-local dnd-protocol-alist (append | ||
| 10277 | (list (cons "^file:///" dnd-handler) | ||
| 10278 | (cons "^file:/[^/]" dnd-handler) | ||
| 10279 | (cons "^file:[^/]" dnd-handler)) | ||
| 10280 | dnd-protocol-alist))) | ||
| 10256 | 10281 | ||
| 10257 | ;; media handler | 10282 | ;; media handler |
| 10258 | (when (version< "29" emacs-version) | 10283 | (when (version< "29" emacs-version) |
diff --git a/.emacs.d/snippets/rust-mode/afn b/.emacs.d/snippets/rust-mode/afn new file mode 100644 index 0000000..9ed1d9c --- /dev/null +++ b/.emacs.d/snippets/rust-mode/afn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: async fn name() { ... } | ||
| 3 | # key: afn | ||
| 4 | # -- | ||
| 5 | async fn ${1:name}($2) { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/afnr b/.emacs.d/snippets/rust-mode/afnr new file mode 100644 index 0000000..71cbbbd --- /dev/null +++ b/.emacs.d/snippets/rust-mode/afnr | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: async fn name() -> Type { ... } | ||
| 3 | # key: afnr | ||
| 4 | # -- | ||
| 5 | async fn ${1:name}($2) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/afns b/.emacs.d/snippets/rust-mode/afns new file mode 100644 index 0000000..c88e672 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/afns | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: async fn name(&self) -> Type { ... } | ||
| 3 | # key: afns | ||
| 4 | # -- | ||
| 5 | async fn ${1:name}(${2:&self}) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/afnw b/.emacs.d/snippets/rust-mode/afnw new file mode 100644 index 0000000..3c358f8 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/afnw | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: async fn name<T>(x: T) where T: Clone { ... } | ||
| 3 | # key: afnw | ||
| 4 | # -- | ||
| 5 | async fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/allow b/.emacs.d/snippets/rust-mode/allow new file mode 100644 index 0000000..c30c1e8 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/allow | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[allow(lint)] | ||
| 3 | # key: allow | ||
| 4 | # -- | ||
| 5 | #[allow(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/allow! b/.emacs.d/snippets/rust-mode/allow! new file mode 100644 index 0000000..cfb0c7d --- /dev/null +++ b/.emacs.d/snippets/rust-mode/allow! | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #![allow(lint)] | ||
| 3 | # key: allow! | ||
| 4 | # -- | ||
| 5 | #![allow(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/assert b/.emacs.d/snippets/rust-mode/assert new file mode 100644 index 0000000..d1252d0 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/assert | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: assert!(predicate); | ||
| 3 | # key: ass | ||
| 4 | # -- | ||
| 5 | assert!(${1:predicate}); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/asserteq b/.emacs.d/snippets/rust-mode/asserteq new file mode 100644 index 0000000..7bfafd2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/asserteq | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: assert_eq!(expected, actual); | ||
| 3 | # key: asseq | ||
| 4 | # -- | ||
| 5 | assert_eq!(${1:expected}, ${2:actual}); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/case b/.emacs.d/snippets/rust-mode/case new file mode 100644 index 0000000..9ea6609 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/case | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pattern => expression, | ||
| 3 | # key: case | ||
| 4 | # -- | ||
| 5 | ${1:pattern} => ${2:expression}, \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/cfg b/.emacs.d/snippets/rust-mode/cfg new file mode 100644 index 0000000..583e021 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/cfg | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[cfg(option)] | ||
| 3 | # key: cfg | ||
| 4 | # -- | ||
| 5 | #[cfg(${1:option})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/cfg= b/.emacs.d/snippets/rust-mode/cfg= new file mode 100644 index 0000000..b01a458 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/cfg= | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[cfg(option = "value")] | ||
| 3 | # key: cfg= | ||
| 4 | # -- | ||
| 5 | #[cfg(${1:option} = "${2:value}")] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/closure b/.emacs.d/snippets/rust-mode/closure new file mode 100644 index 0000000..1624d57 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/closure | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: closure | ||
| 3 | # key: || | ||
| 4 | # -- | ||
| 5 | |${1:arguments}| { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/crate b/.emacs.d/snippets/rust-mode/crate new file mode 100644 index 0000000..ee9371e --- /dev/null +++ b/.emacs.d/snippets/rust-mode/crate | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: extern crate | ||
| 3 | # key: ec | ||
| 4 | # -- | ||
| 5 | extern crate ${1:name}; | ||
diff --git a/.emacs.d/snippets/rust-mode/deny b/.emacs.d/snippets/rust-mode/deny new file mode 100644 index 0000000..5b7f3d9 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/deny | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[deny(lint)] | ||
| 3 | # key: deny | ||
| 4 | # -- | ||
| 5 | #[deny(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/deny! b/.emacs.d/snippets/rust-mode/deny! new file mode 100644 index 0000000..232dfbc --- /dev/null +++ b/.emacs.d/snippets/rust-mode/deny! | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #![deny(lint)] | ||
| 3 | # key: deny! | ||
| 4 | # -- | ||
| 5 | #![deny(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/derive b/.emacs.d/snippets/rust-mode/derive new file mode 100644 index 0000000..581c86f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/derive | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[derive(Trait)] | ||
| 3 | # key: derive | ||
| 4 | # -- | ||
| 5 | #[derive(${1:Trait})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/display b/.emacs.d/snippets/rust-mode/display new file mode 100644 index 0000000..1764f67 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/display | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl Display for Type { fn fmt (...) } | ||
| 3 | # key: display | ||
| 4 | # -- | ||
| 5 | impl Display for ${1:Type} { | ||
| 6 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
| 7 | write!(f, "$0") | ||
| 8 | } | ||
| 9 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/drop b/.emacs.d/snippets/rust-mode/drop new file mode 100644 index 0000000..ba23a5b --- /dev/null +++ b/.emacs.d/snippets/rust-mode/drop | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl Drop for Type { fn drop(...) } | ||
| 3 | # key: drop | ||
| 4 | # -- | ||
| 5 | impl Drop for ${1:Type} { | ||
| 6 | fn drop(&mut self) { | ||
| 7 | $0 | ||
| 8 | } | ||
| 9 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/enum b/.emacs.d/snippets/rust-mode/enum new file mode 100644 index 0000000..acf919b --- /dev/null +++ b/.emacs.d/snippets/rust-mode/enum | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: enum Type { ... } | ||
| 3 | # key: enum | ||
| 4 | # -- | ||
| 5 | enum ${1:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/eprint b/.emacs.d/snippets/rust-mode/eprint new file mode 100644 index 0000000..a40a749 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/eprint | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: eprint!("{}", value); | ||
| 3 | # key: eprint | ||
| 4 | # -- | ||
| 5 | eprint!("${1:{\}}", $2); | ||
diff --git a/.emacs.d/snippets/rust-mode/eprintln b/.emacs.d/snippets/rust-mode/eprintln new file mode 100644 index 0000000..0806251 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/eprintln | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: eprintln!("{}", value); | ||
| 3 | # key: eprintln | ||
| 4 | # -- | ||
| 5 | eprintln!("${1:{\}}", $2); | ||
diff --git a/.emacs.d/snippets/rust-mode/fn b/.emacs.d/snippets/rust-mode/fn new file mode 100644 index 0000000..459fd49 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn name() { ... } | ||
| 3 | # key: fn | ||
| 4 | # -- | ||
| 5 | fn ${1:name}($2) { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/fnr b/.emacs.d/snippets/rust-mode/fnr new file mode 100644 index 0000000..fa98eb2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fnr | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn name() -> Type { ... } | ||
| 3 | # key: fnr | ||
| 4 | # -- | ||
| 5 | fn ${1:name}($2) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/fns b/.emacs.d/snippets/rust-mode/fns new file mode 100644 index 0000000..23fada7 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fns | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn name(&self) -> Type { ... } | ||
| 3 | # key: fns | ||
| 4 | # -- | ||
| 5 | fn ${1:name}(${2:&self}) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/fnw b/.emacs.d/snippets/rust-mode/fnw new file mode 100644 index 0000000..321c292 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fnw | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn name<T>(x: T) where T: Clone { ... } | ||
| 3 | # key: fnw | ||
| 4 | # -- | ||
| 5 | fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/for b/.emacs.d/snippets/rust-mode/for new file mode 100644 index 0000000..66dca09 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/for | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: for var in iterable { ... } | ||
| 3 | # key: for | ||
| 4 | # -- | ||
| 5 | for ${1:var} in ${2:iterable} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/from b/.emacs.d/snippets/rust-mode/from new file mode 100644 index 0000000..9e86209 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/from | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl From<From> for Type { fn from(...) } | ||
| 3 | # key: from | ||
| 4 | # -- | ||
| 5 | impl From<${1:From}> for ${2:Type} { | ||
| 6 | fn from(source: $1) -> Self { | ||
| 7 | $0 | ||
| 8 | Self { } | ||
| 9 | } | ||
| 10 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/fromstr b/.emacs.d/snippets/rust-mode/fromstr new file mode 100644 index 0000000..891751c --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fromstr | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl FromStr for Type { fn from_str(...) } | ||
| 3 | # key: fromstr | ||
| 4 | # -- | ||
| 5 | impl FromStr for ${1:Type} { | ||
| 6 | type Err = ${2:Error}; | ||
| 7 | |||
| 8 | fn from_str(s: &str) -> Result<Self, Self::Err> { | ||
| 9 | Ok(Self{}) | ||
| 10 | } | ||
| 11 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/if b/.emacs.d/snippets/rust-mode/if new file mode 100644 index 0000000..c793ace --- /dev/null +++ b/.emacs.d/snippets/rust-mode/if | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: if expr { ... } | ||
| 3 | # key: if | ||
| 4 | # -- | ||
| 5 | if ${1:expression} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/ife b/.emacs.d/snippets/rust-mode/ife new file mode 100644 index 0000000..12f2b56 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/ife | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: if expression { ... } else { .. } | ||
| 3 | # key: ife | ||
| 4 | # -- | ||
| 5 | if ${1:expression} { | ||
| 6 | $0 | ||
| 7 | } else { | ||
| 8 | |||
| 9 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/ifl b/.emacs.d/snippets/rust-mode/ifl new file mode 100644 index 0000000..e4febb8 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/ifl | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: if let pattern = expression { ... }; | ||
| 3 | # key: ifl | ||
| 4 | # -- | ||
| 5 | if let ${1:pattern} = ${2:expression} { | ||
| 6 | $0 | ||
| 7 | }; | ||
diff --git a/.emacs.d/snippets/rust-mode/impl b/.emacs.d/snippets/rust-mode/impl new file mode 100644 index 0000000..14bb06f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/impl | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl Type { ... } | ||
| 3 | # key: impl | ||
| 4 | # -- | ||
| 5 | impl ${1:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/implt b/.emacs.d/snippets/rust-mode/implt new file mode 100644 index 0000000..0ed9b7d --- /dev/null +++ b/.emacs.d/snippets/rust-mode/implt | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl Trait for Type { ... } | ||
| 3 | # key: implt | ||
| 4 | # -- | ||
| 5 | impl ${1:Trait} for ${2:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/let b/.emacs.d/snippets/rust-mode/let new file mode 100644 index 0000000..9f603ea --- /dev/null +++ b/.emacs.d/snippets/rust-mode/let | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: let pattern = expression; | ||
| 3 | # key: let | ||
| 4 | # -- | ||
| 5 | let ${1:pattern} = ${2:expression}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/letm b/.emacs.d/snippets/rust-mode/letm new file mode 100644 index 0000000..b07d673 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/letm | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: let mut pattern = expression; | ||
| 3 | # key: letm | ||
| 4 | # -- | ||
| 5 | let mut ${1:pattern} = ${2:expression}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/lett b/.emacs.d/snippets/rust-mode/lett new file mode 100644 index 0000000..10a7fa6 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/lett | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: let pattern: type = expression; | ||
| 3 | # key: lett | ||
| 4 | # -- | ||
| 5 | let ${1:pattern}: ${2:type} = ${3:expression}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/lettm b/.emacs.d/snippets/rust-mode/lettm new file mode 100644 index 0000000..9ceb8c3 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/lettm | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: let mut pattern: type = expression; | ||
| 3 | # key: lettm | ||
| 4 | # -- | ||
| 5 | let mut ${1:pattern}: ${2:type} = ${3:expression}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/loop b/.emacs.d/snippets/rust-mode/loop new file mode 100644 index 0000000..e24ae61 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/loop | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: loop { ... } | ||
| 3 | # key: loop | ||
| 4 | # -- | ||
| 5 | loop { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/macro b/.emacs.d/snippets/rust-mode/macro new file mode 100644 index 0000000..410c132 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/macro | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: macro_rules! name { (..) => (..); } | ||
| 3 | # key: macro | ||
| 4 | # -- | ||
| 5 | macro_rules! ${1:name} { | ||
| 6 | ($2) => ($3); | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/main b/.emacs.d/snippets/rust-mode/main new file mode 100644 index 0000000..3f9fe31 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/main | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn main() { ... } | ||
| 3 | # key: main | ||
| 4 | # -- | ||
| 5 | fn main() { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/match b/.emacs.d/snippets/rust-mode/match new file mode 100644 index 0000000..9dc802f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/match | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: match expression { ... } | ||
| 3 | # key: match | ||
| 4 | # -- | ||
| 5 | match ${1:expression} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/new b/.emacs.d/snippets/rust-mode/new new file mode 100644 index 0000000..c5f21c1 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/new | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn new() { ... } | ||
| 3 | # key: new | ||
| 4 | # -- | ||
| 5 | pub fn new($1) -> ${2:Name} { | ||
| 6 | $2 { ${3} } | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/pafn b/.emacs.d/snippets/rust-mode/pafn new file mode 100644 index 0000000..13edd5c --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pafn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub async fn name() { ... } | ||
| 3 | # key: pafn | ||
| 4 | # -- | ||
| 5 | pub async fn ${1:name}($2) { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pafnr b/.emacs.d/snippets/rust-mode/pafnr new file mode 100644 index 0000000..3ce9681 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pafnr | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub async fn name() -> Type { ... } | ||
| 3 | # key: pafnr | ||
| 4 | # -- | ||
| 5 | pub async fn ${1:name}($2) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pafns b/.emacs.d/snippets/rust-mode/pafns new file mode 100644 index 0000000..ad223f9 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pafns | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub async fn name(&self) -> Type { ... } | ||
| 3 | # key: pafns | ||
| 4 | # -- | ||
| 5 | pub async fn ${1:name}(${2:&self}) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pafnw b/.emacs.d/snippets/rust-mode/pafnw new file mode 100644 index 0000000..bea6dd2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pafnw | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub async fn name<T>(x: T) where T: Clone { ... } | ||
| 3 | # key: pafnw | ||
| 4 | # -- | ||
| 5 | pub async fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pfn b/.emacs.d/snippets/rust-mode/pfn new file mode 100644 index 0000000..5f75131 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pfn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn name() { ... } | ||
| 3 | # key: pfn | ||
| 4 | # -- | ||
| 5 | pub fn ${1:name}($2) { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pfnr b/.emacs.d/snippets/rust-mode/pfnr new file mode 100644 index 0000000..4fdd261 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pfnr | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn name() -> Type { ... } | ||
| 3 | # key: pfnr | ||
| 4 | # -- | ||
| 5 | pub fn ${1:name}($2) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/pfns b/.emacs.d/snippets/rust-mode/pfns new file mode 100644 index 0000000..4ad120f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pfns | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn name(&self) -> Type { ... } | ||
| 3 | # key: pfns | ||
| 4 | # -- | ||
| 5 | pub fn ${1:name}(${2:&self}) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pfnw b/.emacs.d/snippets/rust-mode/pfnw new file mode 100644 index 0000000..c264400 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pfnw | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn name<T>(x: T) where T: Clone { ... } | ||
| 3 | # key: pfnw | ||
| 4 | # -- | ||
| 5 | pub fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/print b/.emacs.d/snippets/rust-mode/print new file mode 100644 index 0000000..403ffd9 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/print | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: print!("{}", value); | ||
| 3 | # key: print | ||
| 4 | # -- | ||
| 5 | print!("${1:{\}}", $2); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/println b/.emacs.d/snippets/rust-mode/println new file mode 100644 index 0000000..927134e --- /dev/null +++ b/.emacs.d/snippets/rust-mode/println | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: println | ||
| 3 | # key: p | ||
| 4 | # -- | ||
| 5 | println!("$0"); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/printlnf b/.emacs.d/snippets/rust-mode/printlnf new file mode 100644 index 0000000..ba789e2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/printlnf | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: println!("{}", value); | ||
| 3 | # key: pf | ||
| 4 | # -- | ||
| 5 | println!("${1:{\}}", $2); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/result b/.emacs.d/snippets/rust-mode/result new file mode 100644 index 0000000..6996dd4 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/result | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: Result<Type, failure::Error> | ||
| 3 | # key: result | ||
| 4 | # -- | ||
| 5 | Result<${1:Type}, ${2:failure::Error}> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/spawn b/.emacs.d/snippets/rust-mode/spawn new file mode 100644 index 0000000..c5b7445 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/spawn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: spawn(proc() { ... }); | ||
| 3 | # key: spawn | ||
| 4 | # -- | ||
| 5 | spawn(proc() { | ||
| 6 | $0 | ||
| 7 | }); | ||
diff --git a/.emacs.d/snippets/rust-mode/static b/.emacs.d/snippets/rust-mode/static new file mode 100644 index 0000000..eef8072 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/static | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: CONSTANT: Type = value; | ||
| 3 | # key: static | ||
| 4 | # -- | ||
| 5 | static ${1:CONSTANT}: ${2:Type} = ${3:value}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/struct b/.emacs.d/snippets/rust-mode/struct new file mode 100644 index 0000000..7de2ffa --- /dev/null +++ b/.emacs.d/snippets/rust-mode/struct | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: struct TypeName { .. } | ||
| 3 | # key: struct | ||
| 4 | # -- | ||
| 5 | struct ${1:TypeName} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/test b/.emacs.d/snippets/rust-mode/test new file mode 100644 index 0000000..26efca1 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/test | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[test] fn test_name() { .. } | ||
| 3 | # key: test | ||
| 4 | # -- | ||
| 5 | #[test] | ||
| 6 | fn ${1:test_name}() { | ||
| 7 | $0 | ||
| 8 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/testmod b/.emacs.d/snippets/rust-mode/testmod new file mode 100644 index 0000000..d3494b7 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/testmod | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: test module | ||
| 3 | # key: testmod | ||
| 4 | # -- | ||
| 5 | #[cfg(test)] | ||
| 6 | mod ${1:tests} { | ||
| 7 | use super::*; | ||
| 8 | |||
| 9 | #[test] | ||
| 10 | fn ${2:test_name}() { | ||
| 11 | $0 | ||
| 12 | } | ||
| 13 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/trait b/.emacs.d/snippets/rust-mode/trait new file mode 100644 index 0000000..724df7f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/trait | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: trait Type { ... } | ||
| 3 | # key: trait | ||
| 4 | # -- | ||
| 5 | trait ${1:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/type b/.emacs.d/snippets/rust-mode/type new file mode 100644 index 0000000..584a089 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/type | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: type TypeName = TypeName; | ||
| 3 | # key: type | ||
| 4 | # -- | ||
| 5 | type ${1:TypeName} = ${2:TypeName}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/union b/.emacs.d/snippets/rust-mode/union new file mode 100644 index 0000000..92585a2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/union | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: union Type { ... } | ||
| 3 | # key: union | ||
| 4 | # -- | ||
| 5 | union ${1:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/warn b/.emacs.d/snippets/rust-mode/warn new file mode 100644 index 0000000..acf5c5c --- /dev/null +++ b/.emacs.d/snippets/rust-mode/warn | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[warn(lint)] | ||
| 3 | # key: warn | ||
| 4 | # -- | ||
| 5 | #[warn(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/warn! b/.emacs.d/snippets/rust-mode/warn! new file mode 100644 index 0000000..2f4885d --- /dev/null +++ b/.emacs.d/snippets/rust-mode/warn! | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #![warn(lint)] | ||
| 3 | # key: warn! | ||
| 4 | # -- | ||
| 5 | #![warn(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/while b/.emacs.d/snippets/rust-mode/while new file mode 100644 index 0000000..dbb3663 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/while | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: while expression { ... } | ||
| 3 | # key: while | ||
| 4 | # -- | ||
| 5 | while ${1:expression} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/whilel b/.emacs.d/snippets/rust-mode/whilel new file mode 100644 index 0000000..9137014 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/whilel | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: while let pattern = expression { ... } | ||
| 3 | # key: whilel | ||
| 4 | # -- | ||
| 5 | while let ${1:pattern} = ${2:expression} { | ||
| 6 | $0 | ||
| 7 | } | ||
