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.

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