02 Aug 2021, 09:44

Finishing todo items in Emacs
(fset 'insert-checkmark-after-space
   (kmacro-lambda-form [?\C-a ?\C-s ?  return ?✓ ?  down ?\C-a] 0 "%d"))

(global-set-key (kbd "<C-return>") 'insert-checkmark-after-space)

Now if I have a checklist like this

  1. item one
  2. item two
  3. item three

I can type ctrl-enter from any part of any line, and Emacs will insert a checkmark in the first space (ascii 32), so it looks like this:

  1. ✓ item one
  2. ✓ item two
  3. ✓ item three

Thanks to Workflowy for the shortcut. Thanks to Emacs for the macro. Thanks to https://emacs.stackexchange.com/a/31376/16333 for the “”. Thanks to DuckDuckGo for the “utf8 checkmark” search results. Thanks to https://www.utf8icons.com/character/10003/check-mark for the check mark.