-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplates
82 lines (69 loc) · 3.19 KB
/
templates
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
;; -*- mode: lisp -*-
fundamental-mode ;; Available everywhere
(today (format-time-string "%Y-%m-%d"))
prog-mode
(f (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "FIXME: ")
(t (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "TODO: ")
(b (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "BUG: ")
(h (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "HACK: ")
org-mode
(src "#+begin_src " p n> r> n> "#+end_src")
(begin "#+begin_" (s name) n> r> n "#+end_" name)
(quote "#+begin_quote" n> r> n "#+end_quote")
(elisp "#+begin_src emacs-lisp" n> r> n "#+end_src"
:post (progn (tempel-done) (org-edit-src-code)))
(meeting "Til stede: " p n n "** Aksjoner" n n "** Hva har skjedd" n n "** Hva skal skje" n n "** Diverse" n)
lisp-data-mode
(dirlocal-dart "((dart-mode . ((eval . (eglot-ensure))
(flutter-run-args . \"" (p (completing-read "Default arguments: "
'("-d web-server --web-port 8080"
"-d linux"))) "\")
(eval . (add-hook 'after-save-hook 'flutter-run-or-hot-reload nil t)))))")
(dirlocal-go "((go-mode . ((eval . (eglot-ensure)))))")
emacs-lisp-mode
(autoload ";;;###autoload")
(pt "(point)")
(var "(defvar " p "\n \"" p "\")")
(local "(defvar-local " p "\n \"" p "\")")
(const "(defconst " p "\n \"" p "\")")
(custom "(defcustom " p "\n \"" p "\"" n> ":type '" p ")")
(face "(defface " p " '((t :inherit " p "))\n \"" p "\")")
(group "(defgroup " p " nil\n \"" p "\"" n> ":group '" p n> ":prefix \"" p "-\")")
(macro "(defmacro " p " (" p ")\n \"" p "\"" n> r> ")")
(alias "(defalias '" p " '" p ")")
(fun "(defun " p " (" p ")\n \"" p "\"" n> r> ")")
(iflet "(if-let (" p ")" n> r> ")")
(whenlet "(when-let (" p ")" n> r> ")")
(whilelet "(while-let (" p ")" n> r> ")")
(andlet "(and-let* (" p ")" n> r> ")")
(cond "(cond" n "(" q "))" >)
(pcase "(pcase " (p "scrutinee") n "(" q "))" >)
(let "(let (" p ")" n> r> ")")
(lett "(let* (" p ")" n> r> ")")
(pcaselet "(pcase-let (" p ")" n> r> ")")
(pcaselett "(pcase-let* (" p ")" n> r> ")")
(rec "(letrec (" p ")" n> r> ")")
(dotimes "(dotimes (" p ")" n> r> ")")
(dolist "(dolist (" p ")" n> r> ")")
(loop "(cl-loop for " p " in " p " do" n> r> ")")
(command "(defun " p " (" p ")\n \"" p "\"" n> "(interactive" p ")" n> r> ")")
(advice "(defun " (p "adv" name) " (&rest app)" n> p n> "(apply app))" n>
"(advice-add #'" (p "fun") " " (p ":around") " #'" (s name) ")")
(header ";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name)))
" -- " p " -*- lexical-binding: t -*-" n
";;; Commentary:" n ";;; Code:" n n)
(provide "(provide '" (file-name-base (or (buffer-file-name) (buffer-name))) ")" n
";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name)))
" ends here" n)
eshell-mode
(for "for " (p "i") " in " p " { " q " }")
(while "while { " p " } { " q " }")
(until "until { " p " } { " q " }")
(if "if { " p " } { " q " }")
(ife "if { " p " } { " p " } { " q " }")
(unl "unless { " p " } { " q " }")
(unle "unless { " p " } { " p " } { " q " }")
;; Local Variables:
;; mode: lisp-data
;; outline-regexp: "[a-z]"
;; End: