diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 8d3dfb855..6c2a6f2de 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -456,16 +456,18 @@ (:prefix-map ("n" . "notes") :desc "Search notes for symbol" "*" #'+default/search-notes-for-symbol-at-point :desc "Org agenda" "a" #'org-agenda - :desc "Org capture" "c" #'org-capture + :desc "Toggle org-clock" "c" #'+org/toggle-clock + :desc "Cancel org-clock" "C" #'org-clock-cancel :desc "Open deft" "d" #'deft :desc "Find file in notes" "f" #'+default/find-in-notes :desc "Browse notes" "F" #'+default/browse-notes :desc "Org store link" "l" #'org-store-link - :desc "Search org agenda headlines" "n" #'+default/org-notes-headlines :desc "Tags search" "m" #'org-tags-view + :desc "Org capture" "n" #'org-capture :desc "Active org-clock" "o" #'org-clock-goto :desc "Todo list" "t" #'org-todo-list :desc "Search notes" "s" #'+default/org-notes-search + :desc "Search org agenda headlines" "S" #'+default/org-notes-headlines :desc "View search" "v" #'org-search-view :desc "Org export to clipboard" "y" #'+org/export-to-clipboard :desc "Org export to clipboard as RTF" "Y" #'+org/export-to-clipboard-as-rich-text diff --git a/modules/lang/org/autoload/org.el b/modules/lang/org/autoload/org.el index 2d14b5c28..44107a1ca 100644 --- a/modules/lang/org/autoload/org.el +++ b/modules/lang/org/autoload/org.el @@ -273,6 +273,24 @@ If on a: (ignore-errors (org-promote))) ((call-interactively #'self-insert-command)))) +;;;###autoload +(defun +org/toggle-clock (arg) + "Toggles clock on the last clocked item. + +Clock out if an active clock is running. Clock in otherwise. + +If in an org file, clock in on the item at point. Otherwise clock into the last +task you clocked into. + +See `org-clock-out', `org-clock-in' and `org-clock-in-last' for details on how +the prefix ARG changes this command's behavior." + (interactive "P") + (if (org-clocking-p) + (if arg + (org-clock-cancel) + (org-clock-out)) + (org-clock-in-last arg))) + ;;; Folds ;;;###autoload