summaryrefslogtreecommitdiff
path: root/.config/emacs-old/templates
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs-old/templates')
-rw-r--r--.config/emacs-old/templates38
1 files changed, 38 insertions, 0 deletions
diff --git a/.config/emacs-old/templates b/.config/emacs-old/templates
new file mode 100644
index 0000000..ad4e97a
--- /dev/null
+++ b/.config/emacs-old/templates
@@ -0,0 +1,38 @@
+;; NOTE: https://github.com/minad/tempel/issues/23
+
+c-mode c-ts-mode c++-mode c++-ts-mode
+
+(guard
+ "#ifndef "
+ (p
+ (thread-last
+ (file-name-base (or (buffer-file-name)
+ (buffer-name)))
+ (concat (when-let ((project (project-current)))
+ (concat (project-name project) "_")))
+ (upcase)
+ (string-replace "-" "_")
+ (replace-regexp-in-string "^[0-9]+" "_\\&")
+ (replace-regexp-in-string "[^A-Z0-9_]+" "")
+ (format "%s_H"))
+ header)
+ n
+ "#define " header n n r n n
+ "#endif /* !" header " */")
+
+emacs-lisp-mode
+
+(header
+ ";;; " (file-name-nondirectory (or (buffer-file-name)
+ (buffer-name)))
+ " --- " p " -*- lexical-binding: t; -*-" n n q)
+
+(section "\f" n ";;; " p n n q)
+
+vue-ts-mode
+
+(fcrow
+ > "<div class=\"fc-row\">"
+ n> "<label>{{ _('" p "') }}</label>"
+ n> q
+ n> "</div>") \ No newline at end of file