feat(emacs): open Org file

This commit is contained in:
Pavel Korytov 2021-10-28 15:49:32 +03:00
parent 0dc4420ecc
commit 9df931b94c
2 changed files with 38 additions and 0 deletions

View file

@ -1678,6 +1678,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
`(my-leader-def
:infix "o t"
:keymaps '(org-trello-mode-map)
"" '(:which-key "trello")
,@(mapcan
(lambda (b) (list (nth 1 b) (macroexp-quote (nth 0 b))))
org-trello-interactive-command-binding-couples))))
@ -2121,6 +2122,22 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(general-nmap :keymaps 'org-mode-map
"C-x C-l" 'my/org-link-copy)
(defun my/org-file-open ()
(interactive)
(let* ((default-directory org-directory)
(project-files
(seq-filter
(lambda (f)
(and
(string-match-p (rx (* nonl) ".org" eos) f)
(not (string-match-p (rx (| "journal" "roam" "review" "archive")) f))))
(projectile-current-project-files))))
(find-file
(concat org-directory "/" (completing-read "Org file: " project-files)))))
(my-leader-def
"o o" 'my/org-file-open)
(use-package hide-mode-line
:straight t
:after (org-present))

View file

@ -2773,6 +2773,7 @@ Also, trello files are huge and have a lot of information and tasks which do not
`(my-leader-def
:infix "o t"
:keymaps '(org-trello-mode-map)
"" '(:which-key "trello")
,@(mapcan
(lambda (b) (list (nth 1 b) (macroexp-quote (nth 0 b))))
org-trello-interactive-command-binding-couples))))
@ -3447,6 +3448,26 @@ Add a custom LaTeX template without default packages. Packages are indented to b
(general-nmap :keymaps 'org-mode-map
"C-x C-l" 'my/org-link-copy)
#+end_src
*** Open a file from =org-directory=
A function to open a file from =org-directory=, excluding a few directories like =roam= and =journal=.
#+begin_src emacs-lisp
(defun my/org-file-open ()
(interactive)
(let* ((default-directory org-directory)
(project-files
(seq-filter
(lambda (f)
(and
(string-match-p (rx (* nonl) ".org" eos) f)
(not (string-match-p (rx (| "journal" "roam" "review" "archive")) f))))
(projectile-current-project-files))))
(find-file
(concat org-directory "/" (completing-read "Org file: " project-files)))))
(my-leader-def
"o o" 'my/org-file-open)
#+end_src
** Presentations
Doing presentations with [[https://github.com/rlister/org-present][org-present]].