(Emacs/config)~rearrange org-mode configuration
This commit is contained in:
@@ -1169,25 +1169,29 @@ I'm not very bothered.
|
|||||||
preview, I'll do it myself, so turn it off.
|
preview, I'll do it myself, so turn it off.
|
||||||
+ Org manages windowing itself, to some extent, so I set those options
|
+ Org manages windowing itself, to some extent, so I set those options
|
||||||
to be as unobtrusive as possible
|
to be as unobtrusive as possible
|
||||||
|
+ Load languages I use in =src= blocks in org-mode (Emacs-lisp for
|
||||||
|
this configuration, C and Python)
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org
|
(use-package org
|
||||||
:defer t
|
:defer t
|
||||||
:straight t
|
:straight t
|
||||||
:init
|
:init
|
||||||
(setq
|
(setq org-directory "~/Text"
|
||||||
org-directory "~/Text"
|
org-adapt-indentation nil
|
||||||
org-adapt-indentation nil
|
org-indent-mode nil
|
||||||
org-indent-mode nil
|
org-startup-indented t
|
||||||
org-startup-indented t
|
org-startup-folded 'content
|
||||||
org-startup-folded 'content
|
org-startup-with-latex-preview nil
|
||||||
org-startup-with-latex-preview nil
|
org-imenu-depth 10
|
||||||
org-imenu-depth 10
|
org-src-window-setup 'current-window
|
||||||
org-src-window-setup 'current-window
|
org-indirect-buffer-display 'current-window
|
||||||
org-indirect-buffer-display 'current-window
|
org-link-frame-setup '((vm . vm-visit-folder-other-frame)
|
||||||
org-link-frame-setup '((vm . vm-visit-folder-other-frame)
|
(vm-imap . vm-visit-imap-folder-other-frame)
|
||||||
(vm-imap . vm-visit-imap-folder-other-frame)
|
(file . find-file))
|
||||||
(file . find-file))))
|
org-babel-load-languages '((emacs-lisp . t)
|
||||||
|
(lisp . t)
|
||||||
|
(shell . t))))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Org Latex
|
** Org Latex
|
||||||
Org mode has deep integration with latex, can export to PDF and even
|
Org mode has deep integration with latex, can export to PDF and even
|
||||||
@@ -1247,10 +1251,7 @@ Emacs was very helpful here.
|
|||||||
org-todo-keywords
|
org-todo-keywords
|
||||||
'((sequence "TODO" "WIP" "DONE")
|
'((sequence "TODO" "WIP" "DONE")
|
||||||
(sequence "PROJ" "WAIT" "COMPLETE"))
|
(sequence "PROJ" "WAIT" "COMPLETE"))
|
||||||
org-use-sub-superscripts '{}
|
org-use-sub-superscripts '{}))
|
||||||
org-babel-load-languages '((emacs-lisp . t)
|
|
||||||
(lisp . t)
|
|
||||||
(shell . t))))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
** Org Core Functionality
|
** Org Core Functionality
|
||||||
Hooks, prettify-symbols and records for auto insertion.
|
Hooks, prettify-symbols and records for auto insertion.
|
||||||
@@ -1279,37 +1280,13 @@ Hooks, prettify-symbols and records for auto insertion.
|
|||||||
Some bindings for org mode.
|
Some bindings for org mode.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org
|
(use-package org
|
||||||
:after counsel
|
|
||||||
:config
|
|
||||||
(defun +org/swiper-goto ()
|
|
||||||
(interactive)
|
|
||||||
(swiper "^\\* "))
|
|
||||||
(defun +org/search-headings ()
|
|
||||||
"Searches directory (of buffer) for org headings via counsel-rg"
|
|
||||||
(interactive)
|
|
||||||
(counsel-rg "^\\* " (file-name-directory (buffer-file-name))))
|
|
||||||
|
|
||||||
(defun +org/search-config-headings ()
|
|
||||||
"Searches USER-EMACS-DIRECTORY for org headings via counsel-rg"
|
|
||||||
(interactive)
|
|
||||||
(counsel-rg "^\\* "
|
|
||||||
(substring user-emacs-directory 0
|
|
||||||
(- (length user-emacs-directory) 1))
|
|
||||||
"--max-depth=1"))
|
|
||||||
:general
|
:general
|
||||||
(file-leader
|
(file-leader
|
||||||
"l" #'org-store-link
|
"l" #'org-store-link
|
||||||
"i" #'org-insert-last-stored-link)
|
"i" #'org-insert-last-stored-link)
|
||||||
(code-leader
|
(code-leader
|
||||||
|
:keymaps 'emacs-lisp-mode-map
|
||||||
"D" #'org-babel-detangle)
|
"D" #'org-babel-detangle)
|
||||||
(file-leader
|
|
||||||
"p" #'+org/search-config-headings)
|
|
||||||
(search-leader
|
|
||||||
:keymaps 'org-mode-map
|
|
||||||
"I" #'+org/search-headings)
|
|
||||||
(nmmap
|
|
||||||
:keymaps 'org-mode-map
|
|
||||||
[remap imenu] #'+org/swiper-goto)
|
|
||||||
(local-leader
|
(local-leader
|
||||||
:keymaps 'org-mode-map
|
:keymaps 'org-mode-map
|
||||||
"l" '(nil :which-key "Links")
|
"l" '(nil :which-key "Links")
|
||||||
@@ -1340,14 +1317,52 @@ Some bindings for org mode.
|
|||||||
"t" #'org-table-toggle-coordinate-overlays
|
"t" #'org-table-toggle-coordinate-overlays
|
||||||
"s" #'org-table-sum
|
"s" #'org-table-sum
|
||||||
"e" #'org-table-calc-current-TBLFM
|
"e" #'org-table-calc-current-TBLFM
|
||||||
"E" #'org-table-eval-formula)
|
"E" #'org-table-eval-formula))
|
||||||
(local-leader
|
#+end_src
|
||||||
|
** Searching org files
|
||||||
|
The default ~imenu~ support for Org-mode is god-awful. ~Imenu~ for
|
||||||
|
org-mode should show me a list of headings and provide a
|
||||||
|
completing-read interface to search them.
|
||||||
|
|
||||||
|
[[file:core.org::*Counsel][Counsel]] has me covered for this as I can
|
||||||
|
just provide it a regex as an initial prompt to narrow the candidates
|
||||||
|
down to just the headings then let the user go from there. I use
|
||||||
|
~swiper~ when considering just the local file (a la ~imenu~) and
|
||||||
|
~counsel-rg~ to search multiple org-files.
|
||||||
|
|
||||||
|
The cherry on top is ~+org/search-config-headings~ which searches the
|
||||||
|
org files in ~user-emacs-directory~ and provides the headings for
|
||||||
|
them. This allows me to search my configuration pretty quickly.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package org
|
||||||
|
:after counsel
|
||||||
|
:config
|
||||||
|
(defun +org/swiper-goto ()
|
||||||
|
(interactive)
|
||||||
|
(swiper "^\\* "))
|
||||||
|
|
||||||
|
(defun +org/search-headings ()
|
||||||
|
"Searches directory (of buffer) for org headings via counsel-rg"
|
||||||
|
(interactive)
|
||||||
|
(counsel-rg "^\\* " (file-name-directory (buffer-file-name))))
|
||||||
|
|
||||||
|
(defun +org/search-config-headings ()
|
||||||
|
"Searches USER-EMACS-DIRECTORY for org headings via counsel-rg"
|
||||||
|
(interactive)
|
||||||
|
(counsel-rg "^\\* "
|
||||||
|
(substring user-emacs-directory 0
|
||||||
|
(- (length user-emacs-directory) 1))
|
||||||
|
"--max-depth=1"))
|
||||||
|
:general
|
||||||
|
(search-leader
|
||||||
|
"C" #'+org/search-config-headings)
|
||||||
|
(search-leader
|
||||||
:keymaps 'org-mode-map
|
:keymaps 'org-mode-map
|
||||||
:infix "c"
|
"I" #'+org/search-headings)
|
||||||
"i" #'org-clock-clock-in
|
(nmmap
|
||||||
"o" #'org-clock-clock-out
|
:keymaps 'org-mode-map
|
||||||
"c" #'org-clock-in-last
|
[remap imenu] #'+org/swiper-goto))
|
||||||
"d" #'org-clock-display))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
** Org Agenda
|
** Org Agenda
|
||||||
Org agenda provides a nice viewing for schedules. With org mode it's
|
Org agenda provides a nice viewing for schedules. With org mode it's
|
||||||
@@ -1432,6 +1447,7 @@ time a clock out occurs.")
|
|||||||
(local-leader
|
(local-leader
|
||||||
:keymaps 'org-mode-map
|
:keymaps 'org-mode-map
|
||||||
:infix "c"
|
:infix "c"
|
||||||
|
"d" #'org-clock-display
|
||||||
"c" #'org-clock-in
|
"c" #'org-clock-in
|
||||||
"o" #'org-clock-out
|
"o" #'org-clock-out
|
||||||
"r" #'org-clock-report
|
"r" #'org-clock-report
|
||||||
|
|||||||
Reference in New Issue
Block a user