2018-03-18 My Org-mode hydra

I mentioned a lot of times that I am a big fan of Org-mode clocking feature. Even if I clock some things only for myself, I find it useful to learn how much time I actually need for some task. This is often surprising – for example, I think most people are completely unaware of how much you can accomplish by spending five to ten minutes every day on something (notice the “every day” part!).

Of course, I want my clocking to be as smooth as possible. Since I do not use Org-mode for writing everything – I know LaTeX fairly well and I use it for quite a few things – it means that I cannot just C-x C-c C-i wherever I am when I start writing.

My first solution to that was to bind C-x C-c C-i to a suitable function globally. Some time later, however, I decided to use hydra to launch a few Org-mode related commands.

(defhydra hydra-org (:color blue :timeout 12 :columns 4)
  "Org commands"
  ("i" (lambda () (interactive) (org-clock-in '(4))) "Clock in")
  ("o" org-clock-out "Clock out")
  ("q" org-clock-cancel "Cancel a clock")
  ("<f10>" org-clock-in-last "Clock in the last task")
  ("j" (lambda () (interactive) (org-clock-goto '(4))) "Go to a clock") 
  ("m" make-this-message-into-an-org-todo-item "Flag and capture this message"))
(global-set-key (kbd "<f10>") 'hydra-org/body)

This way, I can just press f10 twice to clock back in the last task, or press f10 i to clock in to something else, or do a few other things. (Notice that I have my command to capture emails here, too. Actually, I have a bit more, but I will blog about the other two entries in this hydra some other day.)

Have a good time clocking!

CategoryEnglish, CategoryBlog, CategoryEmacs, CategoryOrgMode