Created
January 9, 2018 23:57
-
-
Save dustinlacewell-wk/1fbbb597f4d38cb12189bd9ee96a4d6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; available keywords, including combined view | |
(defun set-todo-keywords () | |
(setq org-todo-keywords-1 '("TODO" "DONE" "TODO|DONE"))) | |
;; shows todo list, passing arg to org-todo-list | |
(defun org-todo-list-current-file (&optional arg) | |
"Like `org-todo-list', but using only the current buffer's file." | |
(interactive "P") | |
(let ((org-agenda-files (list (buffer-file-name (current-buffer))))) | |
(if (null (car org-agenda-files)) | |
(error "%s is not visiting a file" (buffer-name (current-buffer))) | |
(org-todo-list arg)))) | |
(defun reset () | |
(delete-other-windows) | |
(widen) | |
(org-global-cycle 1) | |
(beginning-of-buffer) | |
(search-forward "* Knowt Help") | |
(org-cycle) | |
(beginning-of-buffer)) | |
(defun narrow (term) | |
(beginning-of-buffer) | |
(search-forward term) | |
(org-narrow-to-subtree) | |
(org-cycle)) | |
(define-minor-mode knowt-mode | |
"Provide functions useful for knowt.org" | |
:lighter " Knowt" | |
:keymap (let ((map (make-sparse-keymap))) | |
(define-key map (kbd "M-z M-z") (lambda () (interactive) (reset))) | |
(define-key map (kbd "M-z w") (lambda () (interactive) (narrow "* Workiva"))) | |
(define-key map (kbd "M-z t") (lambda () (interactive) (narrow "* Tasks"))) | |
;; the binding with arg | |
(define-key map (kbd "M-z a") (lambda () (interactive) (org-todo-list-current-file '(2)))) | |
(define-key map (kbd "M-z o") 'helm-occur) | |
(define-key helm-map (kbd "C-'") 'ace-jump-helm-line) | |
(define-key map (kbd "M-z h") 'helm-org-in-buffer-headings) | |
map) | |
:after-hook (progn | |
(setq org-confirm-elisp-link-function nil) | |
(setq org-confirm-shell-link-function nil) | |
(set-todo-keywords) | |
(message "knowt-mode ready!"))) | |
(provide 'knowt-mode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment