diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/km-func.el | 13 | ||||
-rw-r--r-- | init/km-keybindings.el | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/init/km-func.el b/init/km-func.el index acbeb7d..bf98552 100644 --- a/init/km-func.el +++ b/init/km-func.el @@ -74,6 +74,19 @@ user." (comment-or-uncomment-region beg end)) (forward-line)) +(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)))) + ;; kill functions (defun km/kill-string-at-point () diff --git a/init/km-keybindings.el b/init/km-keybindings.el index 4ed2001..2cbe1ae 100644 --- a/init/km-keybindings.el +++ b/init/km-keybindings.el @@ -15,3 +15,5 @@ (global-set-key (kbd "C-c r S") 'replace-string) (global-set-key (kbd "C-c r r") 'query-replace-regexp) (global-set-key (kbd "C-c r R") 'replace-regexp) + +(global-set-key (kbd "C-c c t") 'km/todo-comment) |