I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

221 lines
6.2 KiB

4 years ago
4 years ago
  1. #+TITLE: Writing
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle writing.el :comments org
  5. #+PROPERTY: header-args :results silent :eval no-export :comments org
  6. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  7. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  8. #+ATTR_ORG: :width 420px
  9. #+ATTR_HTML: :width 420px
  10. #+ATTR_LATEX: :width 420px
  11. [[../docs/images/2021-02-13-example-roam.png]]
  12. I am using *Org mode*[fn:1] extensively throughout my writing. Most of the improvements are done in the [[file:core.org][Core]] module, but all of the management, encryption, synchronization, and organization of all of my writing happens here.
  13. * Superstar
  14. Make headline stars *super* with *Org superstar mode*[fn:3].
  15. #+begin_src emacs-lisp
  16. (use-package org-superstar
  17. :after org
  18. :hook (org-mode . org-superstar-mode))
  19. #+end_src
  20. * Improvements
  21. Real time checking and one-shot methods to check and correct common spelling and grammatical errors.
  22. ** Spelling
  23. Configure *InteractiveSpell*[fn:6] as a backend with *FlySpell*[fn:7] for real time checking and highlighting.
  24. #+begin_src emacs-lisp
  25. (use-package ispell
  26. :after org
  27. :custom (ispell-dictionary dotfiles/lang))
  28. #+end_src
  29. Toggle highlighting within buffers with =SPC t s=.
  30. #+begin_src emacs-lisp
  31. (dotfiles/leader
  32. "ts" '(flyspell-buffer :which-key "Spelling"))
  33. #+end_src
  34. ** Grammar
  35. I use *Writegood*[fn:8] to find common writing problems such as cliches and poor wording. Grammarly for the peons!
  36. #+begin_src emacs-lisp
  37. (use-package writegood-mode
  38. :after org
  39. :config (writegood-mode))
  40. #+end_src
  41. Toggle *Writegood* mode with =SPC t w=.
  42. #+begin_src emacs-lisp
  43. (dotfiles/leader
  44. "tw" '(writegood-mode :which-key "Grammar"))
  45. #+end_src
  46. * Knowledge base
  47. Download and install *Org roam*[fn:4], a plain text knowledge management system for Emacs built on top of *Org mode*[fn:1].
  48. + Notes can be arbitrarily referenced
  49. + Contexts created by linking topics and notes
  50. #+begin_src emacs-lisp
  51. (use-package org-roam
  52. :hook (after-init . org-roam-mode)
  53. :custom (org-roam-directory org-directory)
  54. (org-roam-capture-templates '())
  55. (org-roam-dailies-capture-templates '()))
  56. #+end_src
  57. Configure custom keybindings behind =SPC r=.
  58. + Find with =f=
  59. + Buffer with =b=
  60. + Capture with =c=
  61. #+begin_src emacs-lisp
  62. (dotfiles/leader
  63. "r" '(:ignore t :which-key "Roam")
  64. "rf" '(org-roam-find-file :which-key "Find")
  65. "rc" '(org-roam-capture :which-key "Capture")
  66. "rb" '(org-roam-buffer-toggle-display :which-key "Buffer"))
  67. #+end_src
  68. ** Web visualizer
  69. Including the extension *Org roam server*[fn:5] will run a web application that visualizes the *Org roam*[fn:4] database. Available whenever the editor is running at https://localhost:8080. The image at the top of this page is an example of the application running.
  70. #+begin_src emacs-lisp
  71. (use-package org-roam-server
  72. :hook (org-roam-mode . org-roam-server-mode))
  73. #+end_src
  74. ** Daily note taking
  75. Use the =daily= note feature of *Org roam*[fn:4] to capture daily notes. Create the default capture template with some preconfigured headers.
  76. #+begin_src emacs-lisp
  77. (with-eval-after-load 'org-roam
  78. (add-to-list 'org-roam-dailies-capture-templates
  79. '("d" "Default" entry (function org-roam-capture--get-point)
  80. "* %?"
  81. :file-name "docs/daily/%<%Y-%m-%d>"
  82. :head
  83. "
  84. ,#+TITLE: %<%Y-%m-%d>
  85. ,#+AUTHOR: Christopher James Hayward
  86. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  87. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  88. ")))
  89. #+end_src
  90. Place keybindings behind =SPC r d=.
  91. + Date with =d=
  92. + Today with =t=
  93. + Tomorrow with =m=
  94. + Yesterday with =y=
  95. #+begin_src emacs-lisp
  96. (dotfiles/leader
  97. "rd" '(:ignore t :which-key "Dailies")
  98. "rdd" '(org-roam-dailies-find-date :which-key "Date")
  99. "rdt" '(org-roam-dailies-find-today :which-key "Today")
  100. "rdm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
  101. "rdy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
  102. #+end_src
  103. ** Capture templates
  104. + Capture template for generic documents
  105. #+begin_src emacs-lisp
  106. (with-eval-after-load 'org-roam
  107. (add-to-list 'org-roam-capture-templates
  108. '("d" "Default" entry (function org-roam-capture--get-point)
  109. "%?"
  110. :file-name "docs/${slug}"
  111. :unnarrowed t
  112. :head
  113. "
  114. ,#+TITLE: ${title}
  115. ,#+AUTHOR: Christopher James Hayward
  116. ,#+EMAIL: chris@chrishayward.xyz
  117. ")))
  118. #+end_src
  119. Custom capture template for courses.
  120. + Capture a new buffer with =SPC r c c=
  121. #+begin_src emacs-lisp
  122. (with-eval-after-load 'org-roam
  123. (add-to-list 'org-roam-capture-templates
  124. '("c" "Course" plain (function org-roam-capture--get-point)
  125. "%?"
  126. :file-name "docs/courses/${slug}"
  127. :unnarrowed t
  128. :head
  129. "
  130. ,#+TITLE: ${title}
  131. ,#+SUBTITLE:
  132. ,#+AUTHOR: Christopher James Hayward
  133. ,#+EMAIL: chris@chrishayward.xyz
  134. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  135. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  136. ")))
  137. #+end_src
  138. ** Agenda integration
  139. #+ATTR_ORG: :width 420px
  140. #+ATTR_HTML: :width 420px
  141. #+ATTR_LATEX: :width 420px
  142. [[../docs/images/2021-02-13-example-agenda.gif]]
  143. More capture templates for *Org roam*[fn:4] are defined here in the context of specific domains and topics.
  144. + Configure agenda sources
  145. #+begin_src emacs-lisp
  146. (setq org-agenda-files '("~/.emacs.d/"
  147. "~/.emacs.d/docs/"
  148. "~/.emacs.d/docs/courses/"
  149. "~/.emacs.d/docs/daily/"
  150. "~/.emacs.d/docs/notes/"
  151. "~/.emacs.d/docs/posts/"
  152. "~/.emacs.d/docs/slides/"
  153. "~/.emacs.d/hosts/"
  154. "~/.emacs.d/modules/"))
  155. #+end_src
  156. + Open an agenda buffer with =SPC a=
  157. #+begin_src emacs-lisp
  158. (dotfiles/leader
  159. "a" '(org-agenda :which-key "Agenda"))
  160. #+end_src
  161. * Resources
  162. [fn:1] https://orgmode.org
  163. [fn:3] https://github.com/integral-dw/org-superstar-mode
  164. [fn:4] https://github.com/org-roam/org-roam
  165. [fn:5] https://github.com/org-roam/org-roam-server
  166. [fn:6] https://emacswiki.org/emacs/InteractiveSpell
  167. [fn:7] https://emacswiki.org/emacs/FlySpell
  168. [fn:8] https://github.com/bnbeckwith/writegood-mode