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.

1255 lines
38 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #+TITLE: Dotfiles
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+ROAM_KEY: https://github.com/chayward1/dotfiles
  5. #+begin_example
  6. _.-="_- _
  7. _.-=" _- | ||"""""""---._______ __..
  8. ___.===""""-.______-,,,,,,,,,,,,`-''----" """"" """"" __'
  9. __.--"" __ ,' o \ __ [__|
  10. __-""=======.--"" ""--.=================================.--"" ""--.=======:
  11. ] [w] : / \ : |========================| : / \ : [w] :
  12. V___________:| |: |========================| :| |: _-"
  13. V__________: \ / :_|=======================/_____: \ / :__-"
  14. -----------' "-____-" `-------------------------------' "-____-"
  15. #+end_example
  16. Immutable GNU Emacs dotfiles. Built for Life, Liberty, and the Open Road.
  17. + 100% Literate
  18. + 100% Immutable
  19. + 100% Reproducible
  20. * Init
  21. :PROPERTIES:
  22. :header-args: :tangle ~/.local/source/dotfiles/init.el
  23. :END:
  24. Although later versions of Emacs introduce =early-init.el=, it's not used in this configuration for two reasons:
  25. + It's not required due to the modularity
  26. + Maintaining support for older versions
  27. Assuming you have completed all of the following tasks prior to proceeding further:
  28. 1. Imported the =secrets=
  29. 2. Initialized the =passwords=
  30. 3. Defined the =host= file
  31. 4. Created all required symbolic links
  32. Load the host configuration.
  33. #+begin_src emacs-lisp
  34. (let ((host-file (concat "~/.local/source/dotfiles/hosts/" system-name ".el")))
  35. (when (file-exists-p host-file)
  36. (load-file host-file)))
  37. #+end_src
  38. Load the enabled modules.
  39. #+begin_src emacs-lisp
  40. (dolist (m dotfiles/modules)
  41. (let ((mod-file (concat "~/.local/source/dotfiles/modules/" (symbol-name m) ".el")))
  42. (when (file-exists-p mod-file)
  43. (load-file mod-file))))
  44. #+end_src
  45. * Hosts
  46. Each host system that runs Emacs has a file defined in the =hosts/= sub directory, following the pattern of ~$HOSTNAME.el~. All of the configurations are defined within this file, the values of which are read from by the other modules during startup and installation. This does *not* cover hosts that are controlled via =TRAMP=, as that will be covered in another section.
  47. ** Example (Ubuntu)
  48. :PROPERTIES:
  49. :header-args: :tangle ~/.local/source/dotfiles/hosts/ubuntu.el
  50. :END:
  51. The first configuration, which was built using the Ubuntu 20.04 LTS server edition. I decided to incorporate =flatpaks= into this build. Setting the ~$BROWSER~ variable is required in the desktop module. Set the browser to the flatpak borwser currently installed, this could change to chromium, firefox, or any other browser by changing this environment variable.
  52. #+begin_src emacs-lisp
  53. (setenv "BROWSER" "flatpak run org.mozilla.firefox")
  54. #+end_src
  55. Add the modules you want to initialize to the ~dotfiles/modules~ variable.
  56. #+begin_src emacs-lisp
  57. (defvar dotfiles/modules '(core
  58. desktop
  59. writing
  60. projects
  61. interface))
  62. #+end_src
  63. Specify the cache directory.
  64. #+begin_src emacs-lisp
  65. (defvar dotfiles/cache "~/.cache/emacs")
  66. #+end_src
  67. Functionality like =completion= and =hints= can be delayed to avoid popups for common manuevers. Adjust this value to your personal taste.
  68. #+begin_src emacs-lisp
  69. (defvar dotfiles/idle 0.0)
  70. #+end_src
  71. Avoid the infamous *Emacs pinky* by binding =SPC= as a leader key, utilizing the thumb instead of the weaker pinky finger. You may change this value if you want to use something else.
  72. #+begin_src emacs-lisp
  73. (defvar dotfiles/leader-key "SPC")
  74. (defvar dotfiles/leader-key-global "C-SPC")
  75. #+end_src
  76. Define where the source repositories are stored, with most projects being relative from that directory.
  77. #+begin_src emacs-lisp
  78. (defvar dotfiles/src "~/.local/source/")
  79. #+end_src
  80. The brain project provides the basis for my agenda, notes, blog, and presentations.
  81. #+begin_src emacs-lisp
  82. (defvar dotfiles/brain (concat dotfiles/src "brain/"))
  83. (defvar dotfiles/notes (concat dotfiles/brain "notes/"))
  84. (defvar dotfiles/bib (concat dotfiles/brain "resources.bib"))
  85. #+end_src
  86. Secret keys and passwords are stored in a seperate repository.
  87. #+begin_src emacs-lisp
  88. (defvar dotfiles/secrets (concat dotfiles/src "secrets/"))
  89. (defvar dotfiles/passwords (concat dotfiles/src "passwords/"))
  90. #+end_src
  91. * Modules
  92. Breaking down the project into logical units or chapters to keep the code more maintainable and organized. This is also a fundemental requirement to achieve the goal of modularity. Incorporating just the =core= module on a build server to build literate programming projects is just one example of what can be achieved.
  93. ** Core
  94. :PROPERTIES:
  95. :header-args: :tangle ~/.local/source/dotfiles/modules/core.el :results silent
  96. :END:
  97. Minimal configuration to make Emacs usable for my own personal workflow. This does very little in the ways of improving the visuals, only removing what is included by default and not required.
  98. *** Cleanup
  99. Emacs creates a lot of files relative to ~user-emacs-directory~, these files are not part of this immutable configuration and do not belong in the emacs directory. How can we solve this issue? Shortly after initialization, before most packages are loaded, we change the value to ~dotfiles/cache~. I elaborate more on the technique in my post [[https://chrishayward.xyz/posts/immutable_emacs/][Immutable Emacs]].
  100. #+begin_src emacs-lisp
  101. (setq user-emacs-directory dotfiles/cache)
  102. #+end_src
  103. Because this project uses version-control, we can disable more unwanted features:
  104. + Lock files
  105. + Backup files
  106. #+begin_src emacs-lisp
  107. (setq create-lockfiles nil
  108. make-backup-files nil)
  109. #+end_src
  110. *** Package management
  111. Download and install packages using [[https://github.com/raxod502/straight.el][straight.el]], a functional package manager that integrates with =use-package=, giving us more control over where packages are sourced from.
  112. + Use the development branch
  113. + Integrate with ~use-package~
  114. Apply the configurations prior to bootstrapping the package manager, by setting (writing) to the variables that =straight= will ultimately read from.
  115. #+begin_src emacs-lisp
  116. (setq straight-repository-branch "develop"
  117. straight-use-package-by-default t)
  118. #+end_src
  119. Bootstrap the package manager, downloading, installing, or configuring depending on the state of the configuration. All packages are downloaded and built from source, and can be pinned to specific git commit hashes.
  120. #+begin_src emacs-lisp
  121. (defvar bootstrap-version)
  122. (let ((bootstrap-file
  123. (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
  124. (bootstrap-version 5))
  125. (unless (file-exists-p bootstrap-file)
  126. (with-current-buffer
  127. (url-retrieve-synchronously
  128. "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
  129. 'silent 'inhibit-cookies)
  130. (goto-char (point-max))
  131. (eval-print-last-sexp)))
  132. (load bootstrap-file nil 'nomessage))
  133. #+end_src
  134. Complete the integration with ~use-package~ by installing it with =straight=.
  135. #+begin_src emacs-lisp
  136. (straight-use-package 'use-package)
  137. #+end_src
  138. *** Hermetic evaluation
  139. Despite having our *stateful* and *immutable* configurations seperate, it's good practice to make efforts to reduce the trash created by Emacs.
  140. Install [[https://github.com/emacscollective/no-littering][no-littering]] to reduce the files created by Emacs.
  141. #+begin_src emacs-lisp
  142. (use-package no-littering)
  143. #+end_src
  144. Emacs' default user interface is horrendous, but with less than 10 lines of code we can change that.
  145. #+begin_src emacs-lisp
  146. (setq inhibit-startup-message t)
  147. (global-prettify-symbols-mode)
  148. (scroll-bar-mode -1)
  149. (menu-bar-mode -1)
  150. (tool-bar-mode -1)
  151. (tooltip-mode -1)
  152. #+end_src
  153. *** Literate programming
  154. *Organize your plain life in plain text*
  155. [[https://orgmode.org][Org-mode]] is one of the hallmark features of Emacs, and provides the basis for my Literate Programming platform. It's essentially a markdown language with rich features for project management, scheduling, development, and writing. It's hard to convey everything within its capabilities.
  156. + [[https://orgmode.org/worg/org-contrib/babel/languages/index.html][Babel languages]]
  157. + [[https://orgmode.org/manual/Structure-Templates.html][Structure templates]]
  158. #+begin_src emacs-lisp
  159. (use-package org
  160. :hook
  161. (org-mode . (lambda ()
  162. (org-indent-mode)
  163. (visual-line-mode 1)
  164. (variable-pitch-mode 1)))
  165. :config
  166. (setq org-ellipsis " ▾"
  167. org-log-done 'time
  168. org-log-into-drawer t
  169. org-src-preserve-indentation t)
  170. (org-babel-do-load-languages
  171. 'org-babel-load-languages
  172. '((shell . t)
  173. (python . t)
  174. (emacs-lisp . t)))
  175. (require 'org-tempo)
  176. (add-to-list 'org-structure-template-alist '("s" . "src"))
  177. (add-to-list 'org-structure-template-alist '("q" . "quote"))
  178. (add-to-list 'org-structure-template-alist '("e" . "example"))
  179. (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
  180. (add-to-list 'org-structure-template-alist '("py" . "src python"))
  181. (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")))
  182. #+end_src
  183. #+begin_src emacs-lisp
  184. (defun dotfiles/tangle (dir)
  185. "Recursively tangle the Org files within a directory."
  186. (interactive)
  187. (let ((org-files (directory-files-recursively dir "org")))
  188. (dolist (f org-files)
  189. (org-babel-tangle-file f))))
  190. #+end_src
  191. *** Custom keybindings
  192. Make the =ESC= key quit (most) prompts, instead of the default =C-g=.
  193. #+begin_src emacs-lisp
  194. (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
  195. #+end_src
  196. **** Hints
  197. Download [[https://github.com/justbur/emacs-which-key][which-key]], a package that displays the current incomplete keybinding input in a mini-buffer, showing available completion options.
  198. #+begin_src emacs-lisp
  199. (use-package which-key
  200. :diminish which-key-mode
  201. :init (which-key-mode)
  202. :config (setq which-key-idle-delay dotfiles/idle))
  203. #+end_src
  204. **** Leader
  205. Implement the *leader* key using [[https://github.com/noctuid/general.el][general.el]], letting us easily configure prefixed keybindings in a much cleaner manner than the default methods.
  206. #+begin_src emacs-lisp
  207. (use-package general
  208. :config
  209. (general-create-definer dotfiles/leader
  210. :states '(normal motion)
  211. :keymaps 'override
  212. :prefix dotfiles/leader-key
  213. :global-prefix dotfiles/leader-key-global))
  214. #+end_src
  215. Use [[https://github.com/abo-abo/hydra][hydra]] for transient keybindings sharing a common prefix.
  216. #+begin_src emacs-lisp
  217. (use-package hydra)
  218. #+end_src
  219. **** Evil mode
  220. After a few hour with =vim= I knew it was game over, I cannot even think of another way I would feel comfortable editing text. Luckily, there exist packages to emulate this within Emacs. [[https://evil.readthedocs.io/en/latest/index.html][evil-mode]] is the extensible VI layer for Emacs.
  221. #+begin_src emacs-lisp
  222. (use-package evil
  223. :init (setq evil-want-integration t
  224. evil-want-keybinding nil)
  225. :config (evil-mode 1))
  226. #+end_src
  227. Unfortunately the default keybindings are *lacking*, but there is a community curated package [[https://github.com/emacs-evil/evil-collection][evil-collection]], which does a much better job implementing keybindings you would expect to find.
  228. #+begin_src emacs-lisp
  229. (use-package evil-collection
  230. :after evil
  231. :config (evil-collection-init))
  232. #+end_src
  233. Surround text with functions, quotations, and any other symbols using the [[https://github.com/emacs-evil/evil-surround][evil-surround]] package.
  234. #+begin_src emacs-lisp
  235. (use-package evil-surround
  236. :config (global-evil-surround-mode 1))
  237. #+end_src
  238. https://github.com/redguardtoo/evil-nerd-commenter
  239. + Toggle comments with =M-;=
  240. #+begin_src emacs-lisp
  241. (use-package evil-nerd-commenter
  242. :bind ("M-;" . evilnc-comment-or-uncomment-lines))
  243. #+end_src
  244. **** Shortcuts
  245. Again cherry picked from =Doom=, I want to continue utilizing the muscle memory I have developed from a year of mainlining the framework.
  246. + Close buffers with =SPC c=
  247. + Find files with =SPC . (period)=
  248. + Switch buffers with =SPC , (comma)=
  249. #+begin_src emacs-lisp
  250. (dotfiles/leader
  251. "." '(find-file :which-key "Files")
  252. "," '(switch-to-buffer :which-key "Buffers")
  253. "c" '(kill-buffer-and-window :which-key "Close"))
  254. #+end_src
  255. Run helper functions with =SPC h=.
  256. + Packages =p=
  257. + Variables =v=
  258. + Functions =f=
  259. #+begin_src emacs-lisp
  260. (dotfiles/leader
  261. "h" '(:ignore t :which-key "Help")
  262. "hp" '(describe-package :which-key "Package")
  263. "hv" '(describe-variable :which-key "Variable")
  264. "hf" '(describe-function :which-key "Function"))
  265. #+end_src
  266. Quit emacs with =SPC q=.
  267. + Saving =q=
  268. + Without =w=
  269. + Frame (daemon) =f=
  270. #+begin_src emacs-lisp
  271. (dotfiles/leader
  272. "q" '(:ignore t :which-key "Quit")
  273. "qq" '(save-buffers-kill-emacs :which-key "Save")
  274. "qw" '(kill-emacs :which-key "Now")
  275. "qf" '(delete-frame :which-key "Frame"))
  276. #+end_src
  277. Window management with =SPC w=.
  278. + Swap with =w=
  279. + Close with =c=
  280. + Motions with =h,j,k,l=
  281. + Split with =s + <MOTION>=
  282. #+begin_src emacs-lisp
  283. (dotfiles/leader
  284. "w" '(:ignore t :which-key "Window")
  285. "ww" '(window-swap-states :which-key "Swap")
  286. "wc" '(delete-window :which-key "Close")
  287. "wh" '(windmove-left :which-key "Left")
  288. "wj" '(windmove-down :which-key "Down")
  289. "wk" '(windmove-up :which-key "Up")
  290. "wl" '(windmove-right :which-key "Right")
  291. "ws" '(:ignore t :which-key "Split")
  292. "wsj" '(split-window-below :which-key "Down")
  293. "wsl" '(split-window-right :which-key "Right"))
  294. #+end_src
  295. Place runtime tweaks behind =SPC t=.
  296. #+begin_src emacs-lisp
  297. (dotfiles/leader
  298. "t" '(:ignore t :which-key "Tweaks"))
  299. #+end_src
  300. *** Version control
  301. Another hallmark feature is [[https://github.com/magit/magit][Magit]], a complete git porcelain within Emacs.
  302. #+begin_src emacs-lisp
  303. (use-package magit
  304. :custom (magit-display-buffer-function
  305. #'magit-display-buffer-same-window-except-diff-v1))
  306. #+end_src
  307. Work directly with github issues / pull requests using [[https://github.com/magit/forge][Forge]].
  308. + Requires a valid ~$GITHUB_TOKEN~
  309. #+begin_src emacs-lisp
  310. (use-package forge)
  311. #+end_src
  312. Open the *status* page for the current repository with =SPC g=.
  313. #+begin_src emacs-lisp
  314. (dotfiles/leader
  315. "g" '(magit-status :which-key "Magit"))
  316. #+end_src
  317. *** Terminal emulation
  318. While not a traditional terminal emulator, =eshell= provides me with all of the functionality I expect and require from one. Some users may be left wanting more, I would recommend they look into =vterm=.
  319. https://github.com/zwild/eshell-prompt-extras
  320. + Enable lambda shell prompt
  321. #+begin_src emacs-lisp
  322. (use-package eshell-prompt-extras
  323. :config (setq eshell-highlight-prompt nil
  324. eshell-prompt-function 'epe-theme-lambda))
  325. #+end_src
  326. Open an =eshell= buffer with =SPC e=.
  327. #+begin_src emacs-lisp
  328. (dotfiles/leader
  329. "e" '(eshell :which-key "Shell"))
  330. #+end_src
  331. *** File management
  332. Emacs' can feel more modern when icon-fonts are installed and prioritized. I feel that this makes navigation of folders much faster, given that file types may be quickly identified by their corresponding icons.
  333. https://github.com/domtronn/all-the-icons.el
  334. + Collects various icon fonts
  335. #+begin_src emacs-lisp
  336. (use-package all-the-icons)
  337. #+end_src
  338. https://github.com/jtbm37/all-the-icons-dired
  339. + Integration with dired
  340. #+begin_src emacs-lisp
  341. (use-package all-the-icons-dired
  342. :hook (dired-mode . all-the-icons-dired-mode))
  343. #+end_src
  344. When opening =dired=, I don't want to have to press =RET= twice to navigate to the current directory. This can be avoided with ~dired-jump~, included in the =dired-x= package shipped with =dired=.
  345. #+begin_src emacs-lisp
  346. (require 'dired-x)
  347. #+end_src
  348. By default =dired= will create a new buffer everytime you press =RET= over a directory. In my workflow this leads to many unwanted =dired= buffers that have to be cleaned up manually. [[https://github.com/crocket/dired-single][Dired-single]] lets us reuse the same dired buffer.
  349. + Move up a directory with =h=
  350. + Open a single buffer with =l=
  351. #+begin_src emacs-lisp
  352. (use-package dired-single
  353. :config
  354. (evil-collection-define-key 'normal 'dired-mode-map
  355. "h" 'dired-single-up-directory
  356. "l" 'dired-single-buffer))
  357. #+end_src
  358. Open a dired buffer with =SPC d=.
  359. #+begin_src emacs-lisp
  360. (dotfiles/leader
  361. "d" '(dired-jump :which-key "Dired"))
  362. #+end_src
  363. ** Desktop
  364. :PROPERTIES:
  365. :header-args: :tangle ~/.local/source/dotfiles/modules/desktop.el :results silent
  366. :END:
  367. I use Emacs as a Desktop Environment with the [[https://github.com/ch11ng/exwm][exwm]] package. It allows Emacs to function as a complete tiling window manager for =X11=. My workflow includes launching the window manager with =xinitrc=, without the use of a display manager, controlling *everything* within Emacs.
  368. #+begin_src conf :tangle ~/.local/source/dotfiles/config/xinitrc
  369. exec dbus-launch --exit-with-session emacs -mm --debug-init
  370. #+end_src
  371. When launching into a session, if the display server is not running then =startx= should be invoked, to run the window manager.
  372. #+begin_src sh :tangle ~/.local/source/dotfiles/config/profile
  373. if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
  374. exec startx
  375. fi
  376. #+end_src
  377. Define a method to run an external process, allowing us to launch any application on a new process without interferring with Emacs.
  378. #+begin_src emacs-lisp
  379. (defun dotfiles/run (command)
  380. "Run an external process."
  381. (interactive (list (read-shell-command "λ ")))
  382. (start-process-shell-command command nil command))
  383. #+end_src
  384. Some methods must be called and applied to the current call process in order to function correctly with Emacs hooks.
  385. #+begin_src emacs-lisp
  386. (defun dotfiles/run-in-background (command)
  387. (let ((command-parts (split-string command "[ ]+")))
  388. (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
  389. #+end_src
  390. Place keybindings for executing shell commands behind =SPC x=.
  391. + Run with =x=
  392. + Run in backround with =g=
  393. + Run asynchronously with =z=
  394. #+begin_src emacs-lisp
  395. (dotfiles/leader
  396. "x" '(:ignore t :which-key "Execute")
  397. "xx" '(dotfiles/run :which-key "Run")
  398. "xb" '(dotfiles/run-in-background :which-key "Run (background)")
  399. "xz" '(async-shell-command :which-key "Async"))
  400. #+end_src
  401. When the window manager first launches the ~init-hook~ will be called, this allows us to define some custom logic when it's initialized.
  402. + Display time and date
  403. + Display battery info (if available)
  404. In my personal configuration, I do not want the battery or time displayed within Emacs when it's not running as desktop environment because that information is typically already available.
  405. #+begin_src emacs-lisp
  406. (defun dotfiles/init-hook ()
  407. (exwm-workspace-switch-create 1)
  408. (setq display-time-and-date t)
  409. (display-battery-mode 1)
  410. (display-time-mode 1))
  411. #+end_src
  412. Using =autorandr= with pre configured profiles, switching screens (AKA hot plugging) is also handled through a hook.
  413. #+begin_src emacs-lisp
  414. (defun dotfiles/update-display ()
  415. (dotfiles/run-in-background "autorandr --change --force"))
  416. #+end_src
  417. Finally we configure the window manager.
  418. + Enable =randr= support
  419. Connect our custom hooks and configure the input keys, a custom layer for defining which keys are captured by Emacs, and which are passed through to =X= applications.
  420. + Pass through to Emacs
  421. + =M-x= to Emacs
  422. + =C-g= to Emacs
  423. + =C-SPC= to Emacs
  424. + Bindings with =S= (Super / Win)
  425. + Reset =S-r=
  426. + Launch =S-&=
  427. + Workspace =S-[1..9]=
  428. #+begin_src emacs-lisp
  429. (use-package exwm
  430. :config
  431. (require 'exwm-randr)
  432. (exwm-randr-enable)
  433. (add-hook 'exwm-init-hook #'dotfiles/init-hook)
  434. (add-hook 'exwm-randr-screen-change-hook #'dotfiles/update-display)
  435. (dotfiles/update-display)
  436. (setq exwm-input-prefix-keys
  437. '(?\M-x
  438. ?\C-g
  439. ?\C-\ )
  440. exwm-input-global-keys
  441. `(([?\s-r] . exwm-reset)
  442. ([?\s-&] . dotfiles/run)
  443. ,@(mapcar (lambda (i)
  444. `(,(kbd (format "s-%d" i)) .
  445. (lambda ()
  446. (interactive)
  447. (exwm-workspace-switch-create ,i))))
  448. (number-sequence 1 9))))
  449. (exwm-enable))
  450. #+end_src
  451. ** Writing
  452. :PROPERTIES:
  453. :header-args: :tangle ~/.local/source/dotfiles/modules/writing.el :results silent
  454. :END:
  455. I am using [[https://orgmode.org][Org-mode]] extensively for writing projects for different purposes. Improvements beyond what are required for my Literate Programming platform include:
  456. [[https://github.com/integral-dw/org-superstar-mode][Org-superstar-mode]] for making headline stars more *super*.
  457. #+begin_src emacs-lisp
  458. (use-package org-superstar
  459. :hook (org-mode . org-superstar-mode))
  460. #+end_src
  461. *** Mail
  462. Plain text email delivered via mu, mu4e and mbsync. I run my own email server, so your configuration may differ from mine. This is the ~mbsyncrc~ file I use to synchronize my local mail with my server. This is required for mu4e in Emacs.
  463. #+begin_src conf :tangle ~/.local/source/dotfiles/config/mbsyncrc
  464. IMAPStore xyz-remote
  465. Host mail.chrishayward.xyz
  466. User chris@chrishayward.xyz
  467. PassCmd "pass chrishayward.xyz/chris"
  468. SSLType IMAPS
  469. MaildirStore xyz-local
  470. Path ~/.cache/mail/
  471. Inbox ~/.cache/mail/inbox
  472. SubFolders Verbatim
  473. Channel xyz
  474. Master :xyz-remote:
  475. Slave :xyz-local:
  476. Patterns * !Archives
  477. Create Both
  478. Expunge Both
  479. SyncState *
  480. #+end_src
  481. The system typically expects to find this file at ~$HOME/.mbsyncrc~, but you may also specify a custom path if launching the command using arguments. I chose to symlink the default location to my repository.
  482. #+begin_src shell :tangle no
  483. mbsync -a
  484. mu index --maildir="~/.cache/mail"
  485. #+end_src
  486. Once the mail is being synchronized, and the mail has been indexed with =mu=, it's time to install the required packages for Emacs.
  487. #+begin_src emacs-lisp
  488. (use-package mu4e
  489. :load-path "/usr/share/emacs/site-lisp/mu4e"
  490. :config
  491. (setq mu4e-change-filenames-when-moving t
  492. mu4e-update-interval (* 5 60) ;; Every 5 minutes.
  493. mu4e-get-mail-command "mbsync -a"
  494. mu4e-maildir "~/.cache/mail"
  495. mu4e-compose-signature
  496. (concat "Chris Hayward\n"
  497. "https://chrishayward.xyz\n"))
  498. ;; Ensure plain text scales for all devices.
  499. (setq mu4e-compose-format-flowed t)
  500. ;; GPG signing key for outbound mail.
  501. (setq mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F"))
  502. (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
  503. (setq message-send-mail-function 'smtpmail-send-it)
  504. ;; Configure mail account(s).
  505. (setq mu4e-contexts
  506. (list
  507. ;; Main
  508. ;; chris@chrishayward.xyz
  509. (make-mu4e-context
  510. :name "Main"
  511. :match-func
  512. (lambda (msg)
  513. (when msg
  514. (string-prefix-p "/Main" (mu4e-message-field msg :maildir))))
  515. :vars
  516. '((user-full-name . "Christopher James Hayward")
  517. (user-mail-address . "chris@chrishayward.xyz")
  518. (smtpmail-smtp-server . "mail.chrishayward.xyz")
  519. (smtpmail-smtp-service . 587)
  520. (smtpmail-stream-type . starttls))))))
  521. #+end_src
  522. Create a keybinding to open the mail dashboard with =SPC m=.
  523. #+begin_src emacs-lisp
  524. (dotfiles/leader
  525. "m" '(mu4e :which-key "Mail"))
  526. #+end_src
  527. *** Brain
  528. [[https://github.com/org-roam/org-roam][Org-roam]] is a rudimentary roam replica built on =Org mode=.
  529. #+begin_src emacs-lisp
  530. (use-package org-roam
  531. :hook (after-init . org-roam-mode)
  532. :custom (org-roam-directory dotfiles/brain))
  533. #+end_src
  534. [[https://github.com/org-roam/org-roam-server][Org-roam-server]] is a web application that visualizes the =Org roam= database, available when Emacs' running at [[http://localhost:8080][localhost:8080]].
  535. #+begin_src emacs-lisp
  536. (use-package org-roam-server
  537. :hook (org-roam-mode . org-roam-server-mode))
  538. #+end_src
  539. Configure keybindings behind =SPC r=.
  540. + Find with =f=
  541. + Buffer with =b=
  542. + Capture with =c=
  543. + Dailies with =d=
  544. #+begin_src emacs-lisp
  545. (dotfiles/leader
  546. "r" '(:ignore t :which-key "Roam")
  547. "rf" '(org-roam-find-file :which-key "Find")
  548. "rb" '(org-roam-buffer-toggle-display :which-key "Buffer")
  549. "rc" '(org-roam-capture :which-key "Capture")
  550. "rd" '(:ignore t :which-key "Dailies")
  551. "rdd" '(org-roam-dailies-find-date :which-key "Date")
  552. "rdt" '(org-roam-dailies-find-today :which-key "Today")
  553. "rdm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
  554. "rdy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
  555. #+end_src
  556. Configure the default capture template for new topics.
  557. #+begin_src emacs-lisp
  558. (setq org-roam-capture-templates
  559. '(("d" "Default" plain (function org-roam-capture--get-point)
  560. "%?"
  561. :file-name "${slug}"
  562. :head "#+TITLE: ${title}\n"
  563. :unnarrowed t)))
  564. #+end_src
  565. Configure the default capture template for daily entries.
  566. #+begin_src emacs-lisp
  567. (setq org-roam-dailies-capture-templates
  568. '(("d" "Default" entry (function org-roam-capture--get-point)
  569. "* %?"
  570. :file-name "daily/%<%Y-%m-%d>"
  571. :head "#+TITLE: %<%Y-%m-%d>\n")))
  572. #+end_src
  573. *** Notes
  574. #+begin_src emacs-lisp
  575. (use-package org-noter
  576. :after org
  577. :config
  578. (setq org-noter-always-create-frame nil
  579. org-noter-notes-search-path dotfiles/notes))
  580. #+end_src
  581. #+begin_src emacs-lisp
  582. (use-package org-pdftools
  583. :hook (org-mode . org-pdftools-setup-link))
  584. #+end_src
  585. #+begin_src emacs-lisp
  586. (use-package org-noter-pdftools
  587. :after org-noter
  588. :config
  589. (with-eval-after-load 'pdf-annot
  590. (add-hook 'pdf-annot-active-handler-functions #'org-noter-pdftools-jump-to-note)))
  591. #+end_src
  592. #+begin_src emacs-lisp
  593. (setq bibtex-completion-notes-path dotfiles/notes
  594. bibtex-completion-bibliography dotfiles/bib
  595. bibtex-completion-pdf-field "file"
  596. bibtex-completion-notes-template-multiple-files
  597. (concat
  598. "#+TITLE: ${title}\n"
  599. "#+ROAM_KEY: cite:${=key=}\n"
  600. "#* TODO Notes\n"
  601. ":PROPERTIES:\n"
  602. ":CUSTOM_ID: ${=key}\n"
  603. ":NOTER_DOCUMENT: %(orb-process-file-field \"${=key=}\")\n"
  604. ":AUTHOR: ${author-abbrev}\n"
  605. ":JOURNAL: ${journaltitle}\n"
  606. ":DATE: ${date}\n"
  607. ":YEAR: ${year}\n"
  608. ":DOI: ${doi}\n"
  609. ":URL: ${url}\n"
  610. ":END:\n\n"))
  611. #+end_src
  612. #+begin_src emacs-lisp
  613. (use-package org-ref
  614. :config
  615. (setq org-ref-completion-library 'org-ref-helm-cite
  616. org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex
  617. org-ref-default-bibliography dotfiles/bib
  618. org-ref-bibliography-notes dotfiles/notes
  619. org-ref-notes-directory dotfiles/notes
  620. org-ref-notes-function 'orb-edit-notes
  621. org-ref-note-title-format "* TODO %y - %t\n
  622. :PROPERTIES:\n
  623. :CUSTOM_ID: %k\n
  624. :NOTER_DOCUMENT: %F\n
  625. :ROAM_KEY: cite:%k\n
  626. :AUTHOR: %9a\n
  627. :JOURNAL: %j\n
  628. :YEAR: %y\n
  629. :VOLUME: %v\n
  630. :PAGES: %p\n
  631. :DOI: %D\n
  632. :URL: %U\n
  633. :END:\n\n"))
  634. #+end_src
  635. #+begin_src emacs-lisp
  636. (use-package org-roam-bibtex
  637. :after (org-roam)
  638. :hook (org-roam-mode . org-roam-bibtex-mode)
  639. :config
  640. (setq orb-preformat-keywords
  641. '("=key=" "title" "url" "file" "author-or-editor" "keywords")))
  642. #+end_src
  643. #+begin_src emacs-lisp
  644. (add-to-list 'org-roam-capture-templates
  645. '("n" "Notes" plain (function org-roam-capture--get-point)
  646. ""
  647. :file-name "notes/${slug}"
  648. :head "#+TITLE: ${=key=}: ${title}\n\n
  649. #+ROAM_KEY:${ref}\n\n* ${title}\n
  650. :PROPERTIES:\n
  651. :CUSTOM_ID: ${=key=}\n
  652. :URL: ${url}\n
  653. :AUTHOR: ${author-or-editor}\n
  654. :NOTER_DOCUMENT:%(orb-process-file-field \"${=key=}\")\n
  655. :NOTER_PAGE:\n
  656. :END:\n\n"))
  657. #+end_src
  658. *** Agenda
  659. Configure agenda sources.
  660. + Dailies ~~/.local/source/brain/daily/~
  661. + Secrets ~~/.local/source/secrets/org/~
  662. #+begin_src emacs-lisp
  663. (setq org-agenda-files '("~/.local/source/brain/daily/"
  664. "~/.local/source/secrets/org/"))
  665. #+end_src
  666. Open an agenda buffer with =SPC a=.
  667. #+begin_src emacs-lisp
  668. (dotfiles/leader
  669. "a" '(org-agenda :which-key "Agenda"))
  670. #+end_src
  671. *** Blogging
  672. I use [[https://gohugo.io][Hugo]] for my personal [[https://chrishayward.xyz][website]], which I write in =Org-mode= before compiling to =hugo-markdown=.
  673. [[https://github.com/kaushalmodi/ox-hugo][Ox-hugo]], configured for =one-post-per-file= is my technique for managing my blog.
  674. #+begin_src emacs-lisp
  675. (use-package ox-hugo
  676. :after ox)
  677. #+end_src
  678. Creaate a capture template for blog posts in the =posts= sub directory.
  679. #+begin_src emacs-lisp
  680. (add-to-list 'org-roam-capture-templates
  681. '("b" "Blogging" plain (function org-roam-capture--get-point)
  682. "%?"
  683. :file-name "posts/${slug}"
  684. :head "#+TITLE: ${title}\n
  685. #+HUGO_BASE_DIR: ~/.local/source/website\n
  686. #+HUGO_SECTION: posts\n"))
  687. #+end_src
  688. *** Screencasts
  689. Create screencasts with =one-frame-per-action= GIF recording via [[https://github.com/takaxp/emacs-gif-screencast][emacs-gif-screencast]].
  690. + Can be paused / resumed
  691. + High quality images
  692. + Optimized size
  693. It requires the installation of ~scrot~ and ~convert~ from the =ImageMagick= library.
  694. #+begin_src emacs-lisp
  695. (use-package gif-screencast
  696. :custom
  697. (gif-screencast-output-directory (concat dotfiles/brain "screens/")))
  698. #+end_src
  699. Screencast controls behind =SPC s=.
  700. + Start / stop with =s=
  701. + Pause with =t=
  702. #+begin_src emacs-lisp
  703. (dotfiles/leader
  704. "s" '(:ignore t :which-key "Screencast")
  705. "ss" '(gif-screencast-start-or-stop :which-key "Start / Stop")
  706. "sp" '(gif-screencast-toggle-pause :which-key "Pause"))
  707. #+end_src
  708. *** Presentations
  709. Produce high quality presentations that work anywhere with =HTML/JS= and the [[https://revealjs.com][Reveal.js]] package.
  710. [[https://github.com/hexmode/ox-reveal][Ox-reveal]], configured to use a =cdn= allows us to produce ones that are not dependent on a local version of =Reveal.js=.
  711. #+begin_src emacs-lisp
  712. (use-package ox-reveal
  713. :after ox
  714. :custom (org-reveal-root "https://cdn.jsdelivr.net/reveal.js/3.9.2/"))
  715. #+end_src
  716. Create a capture template for presentations stored in the =slides= sub directory.
  717. #+begin_src emacs-lisp
  718. (add-to-list 'org-roam-capture-templates
  719. '("p" "Presentation" plain (function org-roam-capture--get-point)
  720. "%?"
  721. :file-name "slides/${slug}"
  722. :head "#+TITLE: ${title}\n"))
  723. #+end_src
  724. ** Projects
  725. :PROPERTIES:
  726. :header-args: :tangle ~/.local/source/dotfiles/modules/projects.el :results silent
  727. :END:
  728. An IDE like experience (or better) can be achieved in Emacs using two *Microsoft* open source initiatives.
  729. Turn Emacs into an *IDE* (or better) with the [[https://microsoft.github.io/language-server-protocol/][Language Server Protocol]], an open source initiative from *Microsoft* for the *VSCode* editor.
  730. [[https://emacs-lsp.github.io/lsp-mode/][Lsp-mode]] brings support for language servers into Emacs.
  731. #+begin_src emacs-lisp
  732. (use-package lsp-mode
  733. :custom (gc-cons-threshold 1000000000)
  734. (lsp-idle-delay 0.500))
  735. #+end_src
  736. https://emacs-lsp.github.io/lsp-ui/
  737. + UI improvements for =lsp-mode=
  738. #+begin_src emacs-lisp
  739. (use-package lsp-ui
  740. :custom (lsp-ui-doc-position 'at-point)
  741. (lsp-ui-doc-delay 0.500))
  742. #+end_src
  743. *** Management
  744. Configure [[https://projectile.mx][projectile]], a project interaction library for Emacs. It provides a nice set of features for operating on a project level without introducing external dependencies.
  745. #+begin_src emacs-lisp
  746. (use-package projectile
  747. :config
  748. (setq projectile-project-search-path '("~/.local/source"))
  749. (projectile-mode))
  750. #+end_src
  751. *** Passwords
  752. Pass makes managing passwords extremely easy, encrypring them in a file structure and providing easy commands for generating, modify, and copying passwords. =password-store.el= provides a wrapper for the functionality within Emacs.
  753. #+begin_src emacs-lisp
  754. (use-package password-store
  755. :custom (password-store-dir dotfiles/passwords))
  756. #+end_src
  757. Configure keybindings behind =SPC p=.
  758. + Copy with =p=
  759. + Rename with =r=
  760. + Generate with =g=
  761. #+begin_src emacs-lisp
  762. (dotfiles/leader
  763. "p" '(:ignore t :which-key "Passwords")
  764. "pp" '(password-store-copy :which-key "Copy")
  765. "pr" '(password-store-rename :which-key "Rename")
  766. "pg" '(password-store-generate :which-key "Generate"))
  767. #+end_src
  768. *** Debugging
  769. Handled through the [[https://microsoft.github.io/debug-adapter-protocol/][Debug Adapter Protocol]], an open source initiative from *Microsoft* for the *VSCode* editor.
  770. [[https://emacs-lsp.github.io/dap-mode/][Dap-mode]] adds support for the protocol to Emacs.
  771. #+begin_src emacs-lisp
  772. (use-package dap-mode)
  773. #+end_src
  774. *** Completion
  775. Text completion framework via =company= aka *Complete Anything*.
  776. http://company-mode.github.io/
  777. + Integrate with =lsp-mode=
  778. #+begin_src emacs-lisp
  779. (use-package company)
  780. (use-package company-lsp)
  781. #+end_src
  782. *** Languages
  783. Support for individual languages are implemented here.
  784. **** C/C++
  785. Full *IDE* experience for Python within Emacs.
  786. + Completion, jumps via =lsp-mode=
  787. + Debugging via =dap-mode=
  788. Install the =ccls= language server.
  789. + https://github.com/MaskRay/ccls
  790. #+begin_src emacs-lisp
  791. (use-package ccls
  792. :hook ((c-mode c++-mode objc-mode cuda-mode) .
  793. (lambda () (require 'ccls) (lsp))))
  794. #+end_src
  795. **** Python
  796. Full *IDE* experience for Python within Emacs.
  797. + Completion, jumps via =lsp-mode=
  798. + Debugging via =dap-mode=
  799. Install the =pyls= language server.
  800. #+begin_src shell :tangle no
  801. pip install --user "python-language-server[all]"
  802. #+end_src
  803. https://www.emacswiki.org/emacs/PythonProgrammingInEmacs
  804. + Built in mode
  805. #+begin_src emacs-lisp
  806. (use-package python-mode
  807. :hook (python-mode . lsp)
  808. :config (require 'dap-python)
  809. :custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3.
  810. (dap-python-executable "python3") ;; Same as above.
  811. (dap-python-debugger 'debugpy))
  812. #+end_src
  813. **** Go
  814. Full *IDE* experience for Rust within Emacs.
  815. + Completion via =lsp-mode=
  816. + Debugging via =dap-mode=
  817. Install the =gopls= language server.
  818. #+begin_src sh :tangle no
  819. GO111MODULE=on go get golang.org/x/tools/gopls@latest
  820. #+end_src
  821. Set the ~GOPATH~ environment variable prior to loading, this allows us to change the default value of ~$HOME/go~ to ~$HOME/.go~.
  822. #+begin_src emacs-lisp
  823. (setenv "GOPATH" (concat (getenv "HOME") "/.go/"))
  824. #+end_src
  825. Additionally, include the =bin= subdirectory of the ~$GOPATH~ in the ~$PATH~ variable, adding compiled golang programs.
  826. #+begin_src emacs-lisp
  827. (setenv "PATH" (concat (getenv "GOPATH") "bin:" (getenv "PATH")))
  828. #+end_src
  829. Finally we can include the =go-mode= package, integrating it with =lsp=.
  830. #+begin_src emacs-lisp
  831. (use-package go-mode
  832. :hook (go-mode . lsp))
  833. #+end_src
  834. Apply some custom behaviour before saving:
  835. + Format buffer
  836. + Organize imports
  837. #+begin_src emacs-lisp
  838. (defun dotfiles/go-hook ()
  839. (add-hook 'before-save-hook #'lsp-format-buffer t t)
  840. (add-hook 'before-save-hook #'lsp-organize-imports t t))
  841. #+end_src
  842. #+begin_src emacs-lisp
  843. (add-hook 'go-mode-hook #'dotfiles/go-hook)
  844. #+end_src
  845. ** Interface
  846. :PROPERTIES:
  847. :header-args: :tangle ~/.local/source/dotfiles/modules/interface.el :results silent
  848. :END:
  849. *Bring Emacs out of the eighties*
  850. *** Fonts
  851. Configure the system font with a single ~font-family~ and define the size, of which variations to the font size are relative to this value.
  852. #+begin_src emacs-lisp
  853. (defvar dotfiles/font "Fira Code")
  854. (defvar dotfiles/font-size 96)
  855. #+end_src
  856. Write out to all *3* of Emacs' default font faces.
  857. #+begin_src emacs-lisp
  858. (set-face-attribute 'default nil :font dotfiles/font :height dotfiles/font-size)
  859. (set-face-attribute 'fixed-pitch nil :font dotfiles/font :height dotfiles/font-size)
  860. (set-face-attribute 'variable-pitch nil :font dotfiles/font :height dotfiles/font-size)
  861. #+end_src
  862. Define a transient keybinding for scaling the text.
  863. #+begin_src emacs-lisp
  864. (defhydra hydra-text-scale (:timeout 4)
  865. "Scale"
  866. ("j" text-scale-increase "Increase")
  867. ("k" text-scale-decrease "Decrease")
  868. ("f" nil "Finished" :exit t))
  869. #+end_src
  870. Increase the font size in buffers with =SPC t f=.
  871. + Increase =j=
  872. + Decrease =k=
  873. + Finish =f=
  874. #+begin_src emacs-lisp
  875. (dotfiles/leader
  876. "tf" '(hydra-text-scale/body :which-key "Font"))
  877. #+end_src
  878. *** Lines
  879. Relative line numbers are important when using =VI= emulation keys. You can prefix most commands with a *number*, allowing you to jump up / down by a line count.
  880. #+begin_example
  881. 5:
  882. 4:
  883. 3:
  884. 2:
  885. 1:
  886. 156: << CURRENT LINE >>
  887. 1:
  888. 2:
  889. 3:
  890. 4:
  891. 5:
  892. #+end_example
  893. https://github.com/emacsmirror/linum-relative
  894. + Integrate with ~display-line-numbers-mode~ for performance
  895. #+begin_src emacs-lisp
  896. (use-package linum-relative
  897. :init (setq linum-relative-backend
  898. 'display-line-numbers-mode)
  899. :config (linum-relative-global-mode))
  900. #+end_src
  901. Add line numbers to the toggles behind =SPC t l=.
  902. #+begin_src emacs-lisp
  903. (dotfiles/leader
  904. "tl" '(linum-relative-global-mode :which-key "Lines"))
  905. #+end_src
  906. https://github.com/Fanael/rainbow-delimiters
  907. + Colourize nested parenthesis
  908. #+begin_src emacs-lisp
  909. (use-package rainbow-delimiters
  910. :hook (prog-mode . rainbow-delimiters-mode))
  911. #+end_src
  912. *** Themes
  913. Cherry pick a few modules from =doom-emacs=. High quality and modern colour themes are provided in the [[https://github.com/hlissner/emacs-doom-themes][doom-themes]] package.
  914. #+begin_src emacs-lisp
  915. (use-package doom-themes
  916. :init (load-theme 'doom-moonlight t))
  917. #+end_src
  918. [[https://github.com/seagle0128/doom-modeline][doom-modeline]] provides an elegant status bar / modeline.
  919. #+begin_src emacs-lisp
  920. (use-package doom-modeline
  921. :init (doom-modeline-mode 1)
  922. :custom ((doom-modeline-height 16)))
  923. #+end_src
  924. Load a theme with =SPC t t=.
  925. #+begin_src emacs-lisp
  926. (dotfiles/leader
  927. "tt" '(load-theme t t :which-key "Theme"))
  928. #+end_src
  929. *** Ligatures
  930. Enable font ligatures via [[https://github.com/jming422/fira-code-mode][fira-code-mode]], perform this action *only* when ~Fira Code~ is set as the current font.
  931. #+begin_src emacs-lisp
  932. ;; (use-package fira-code-mode
  933. ;; :config
  934. ;; (global-fira-code-mode))
  935. #+end_src
  936. #+begin_src emacs-lisp
  937. ;; (use-package fira-code-mode
  938. ;; :hook prog-mode)
  939. #+end_src
  940. *** Dashboard
  941. Present a dashboard when first launching Emacs.
  942. #+begin_src emacs-lisp
  943. (use-package dashboard
  944. :config
  945. (setq dashboard-center-content t
  946. dashboard-set-init-info t
  947. dashboard-set-file-icons t
  948. dashboard-set-heading-icons t
  949. dashboard-startup-banner 'logo
  950. dashboard-projects-backend 'projectile
  951. dashboard-items '((projects . 5)
  952. (recents . 5)
  953. (agenda . 5 )))
  954. (dashboard-setup-startup-hook))
  955. #+end_src
  956. When running in *daemon* mode, ensure that the dashboard is the initial buffer.
  957. #+begin_src emacs-lisp
  958. (setq initial-buffer-choice
  959. (lambda ()
  960. (get-buffer "*dashboard*")))
  961. #+end_src