summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/init-editing.el26
-rw-r--r--snippets/text-mode/cdate4
-rw-r--r--snippets/text-mode/date4
3 files changed, 8 insertions, 26 deletions
diff --git a/lisp/init-editing.el b/lisp/init-editing.el
index fbf959e..15d157d 100644
--- a/lisp/init-editing.el
+++ b/lisp/init-editing.el
@@ -75,17 +75,6 @@
(define-prefix-command 'insert-map)
(global-set-key (kbd "C-c i") 'insert-map)
-(defun km/shebang (&optional lang)
- (interactive "s\language (default python):")
- (if (= (length lang) 0)
- (setq lang "python"))
- (insert "#!/usr/bin/env " lang "\n"))
-(define-key insert-map "s" 'km/shebang)
-
-(defun km/insert-date ()
- (interactive)
- (insert (format-time-string "%Y-%m-%d")))
-
(defun km/toggle-line-or-region-comment ()
"Comment/uncomment the current line or region"
(interactive)
@@ -98,21 +87,6 @@
(key-chord-define-global ",c" 'km/toggle-line-or-region-comment)
-(defun km/todo-comment ()
- "Add commented TODO"
- (interactive)
- (let (beg end)
- (if (region-active-p)
- (setq beg (region-beginning) end (region-end))
- (setq beg (line-beginning-position) end (line-end-position)))
- (unless (comment-only-p beg end)
- (beginning-of-line)
- (insert "TODO ")
- (comment-region beg (+ end 5))
- (forward-line))))
-
-(define-key insert-map "d" 'km/insert-date)
-(define-key insert-map "t" 'km/todo-comment)
(define-key insert-map "i" 'indent-relative)
;; Put multiple cursors map under insert prefix.
diff --git a/snippets/text-mode/cdate b/snippets/text-mode/cdate
new file mode 100644
index 0000000..ad32367
--- /dev/null
+++ b/snippets/text-mode/cdate
@@ -0,0 +1,4 @@
+# -*- mode: snippet -*-
+# key: cdate
+# --
+`(yas-with-comment (concat " " (format-time-string "%Y-%m-%d")))`
diff --git a/snippets/text-mode/date b/snippets/text-mode/date
new file mode 100644
index 0000000..8bc5ce1
--- /dev/null
+++ b/snippets/text-mode/date
@@ -0,0 +1,4 @@
+# -*- mode: snippet -*-
+# key: date
+# --
+`(format-time-string "%Y-%m-%d")`$0