config/default: rebind 'SPC n {c,C,n,S}'

'SPC n c' -> Toggle last org clock
'SPC n C' -> Cancel current org clock
'SPC n n' -> org-capture
'SPC n S' -> Search org-directory headings

Closes #2043
This commit is contained in:
Henrik Lissner 2019-12-06 13:38:57 -05:00
parent cd158c5656
commit 6cf17b1237
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 22 additions and 2 deletions

View file

@ -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

View file

@ -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