summaryrefslogtreecommitdiff
path: root/.emacs.d/snippets/prog-mode/commentline
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/snippets/prog-mode/commentline')
-rw-r--r--.emacs.d/snippets/prog-mode/commentline13
1 files changed, 13 insertions, 0 deletions
diff --git a/.emacs.d/snippets/prog-mode/commentline b/.emacs.d/snippets/prog-mode/commentline
new file mode 100644
index 0000000..0b0edff
--- /dev/null
+++ b/.emacs.d/snippets/prog-mode/commentline
@@ -0,0 +1,13 @@
1# -*- mode: snippet -*-
2# contributor: sh-ow <sh-ow@users.noreply.github.com>
3# name: commentline
4# key: col
5# --
6${1:$(yas-trimmed-comment-start)} ${1:comment} ${1:$(let* ((str "")
7 (curr (current-column))
8 (start (yas-trimmed-comment-start))
9 (lastcom (substring start -1))
10 (end (yas-trimmed-comment-end)))
11 (while (< (length str) (- 79 (+ curr (length end))))
12 (setq str (concat str lastcom)))
13 (concat str end))}$0 \ No newline at end of file