summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/init-yas.el5
-rw-r--r--snippets/text-mode/cdate2
-rw-r--r--snippets/text-mode/km-todo2
-rw-r--r--snippets/text-mode/todo2
4 files changed, 8 insertions, 3 deletions
diff --git a/lisp/init-yas.el b/lisp/init-yas.el
index 33a52f8..52fb54b 100644
--- a/lisp/init-yas.el
+++ b/lisp/init-yas.el
@@ -9,6 +9,11 @@
(when (file-exists-p km/personal-snippets)
(add-to-list 'yas-snippet-dirs km/personal-snippets))
+(defun km/yas-with-comment (str)
+ (concat comment-start
+ (unless (s-ends-with? " " comment-start) " ")
+ str comment-end))
+
(define-key yas-minor-mode-map (kbd "C-c i") 'yas-expand)
;; Remove commands with 'C-c &' prefix, which conflicts with
;; `org-mark-ring-goto' binding'
diff --git a/snippets/text-mode/cdate b/snippets/text-mode/cdate
index 84cd077..dc47845 100644
--- a/snippets/text-mode/cdate
+++ b/snippets/text-mode/cdate
@@ -1,4 +1,4 @@
# -*- mode: snippet -*-
# key: cdate
# --
-`(yas-with-comment (concat " " (format-time-string "%Y-%m-%d")))` \ No newline at end of file
+`(km/yas-with-comment (format-time-string "%Y-%m-%d"))` \ No newline at end of file
diff --git a/snippets/text-mode/km-todo b/snippets/text-mode/km-todo
index 13bde86..32cdcc6 100644
--- a/snippets/text-mode/km-todo
+++ b/snippets/text-mode/km-todo
@@ -2,4 +2,4 @@
# key: kt
# Copied over from text-mode/TODO.
# --
-`(yas-with-comment " kTODO: ")` \ No newline at end of file
+`(km/yas-with-comment "kTODO: ")` \ No newline at end of file
diff --git a/snippets/text-mode/todo b/snippets/text-mode/todo
index 1b02916..331b154 100644
--- a/snippets/text-mode/todo
+++ b/snippets/text-mode/todo
@@ -2,4 +2,4 @@
# name: todo
# key: ct
# --
-`(yas-with-comment "TODO: ")` \ No newline at end of file
+`(km/yas-with-comment "TODO: ")` \ No newline at end of file