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.

95 lines
3.8 KiB

  1. #+TITLE: Core
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle core.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. Minimal configuration to make Emacs usable for my own personal workflow. This does little in the ways of improving the visuals, only removing what's included by default and not required. Read more about my technique in my post *Immutable Emacs*[fn:1].
  9. + Packages are managed with *straight.el*[fn:2]
  10. + Packages are installed with *use-package*[fn:3]
  11. * Babel
  12. *Organize your plain life in plain text*
  13. *Org mode*[fn:4] is one of the hallmark features of Emacs, and provides the basis for my *Literate Programming*[fn:5] 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.
  14. + Setup ~shell~ and ~emacs-lisp~ as *Babel Languages*[fn:6]
  15. + Configure *Structure Templates*[fn:7] for both languages
  16. #+begin_src emacs-lisp
  17. (use-package org
  18. :hook (org-mode . (lambda ()
  19. (org-indent-mode)
  20. (visual-line-mode 1)
  21. (variable-pitch-mode 1)))
  22. :custom (org-ellipsis " ▾")
  23. (org-log-done 'time)
  24. (org-log-into-drawer t)
  25. (org-return-follows-link t)
  26. (org-image-actual-width nil)
  27. (org-directory dotfiles/home)
  28. (org-src-fontify-natively t)
  29. (org-src-tab-acts-natively t)
  30. (org-src-preserve-indentation t)
  31. (org-confirm-babel-evaluate nil)
  32. (org-todo-keywords '((sequence "TODO" "START" "WAIT" "DONE")))
  33. :config (require 'org-tempo)
  34. (add-to-list 'org-structure-template-alist '("s" . "src"))
  35. (add-to-list 'org-structure-template-alist '("q" . "quote"))
  36. (add-to-list 'org-structure-template-alist '("e" . "example"))
  37. (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
  38. (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
  39. (org-babel-do-load-languages 'org-babel-load-languages '((shell . t)
  40. (emacs-lisp . t))))
  41. #+end_src
  42. * Cleanup
  43. Despite having our *stateful* and *immutable* configurations seperate, it's good practice to make efforts to reduce the trash created by Emacs. Install *no-littering*[fn:3] to reduce the files created by Emacs.
  44. #+begin_src emacs-lisp
  45. (use-package no-littering)
  46. #+end_src
  47. Now that we've taken care of how it acts, we can work on how it looks. Emacs' default user interface is *horrendous*, let's do something about that.
  48. #+begin_src emacs-lisp
  49. (setq inhibit-startup-message t
  50. initial-scratch-message "")
  51. (global-prettify-symbols-mode)
  52. (when (fboundp 'tooltip-mode)
  53. (tooltip-mode -1))
  54. (when (fboundp 'tool-bar-mode)
  55. (tool-bar-mode -1))
  56. (when (fboundp 'menu-bar-mode)
  57. (menu-bar-mode -1))
  58. (when (fboundp 'scroll-bar-mode)
  59. (scroll-bar-mode -1))
  60. #+end_src
  61. * Performance
  62. Emacs has a long history of running on machines without gigabytes of available memory, let it realize its full potential by increasing the garbage collection threshold and the minimum prime bit size.
  63. #+begin_src emacs-lisp
  64. (setq gc-cons-threshold most-positive-fixnum
  65. gnutls-min-prime-bits 4096)
  66. #+end_src
  67. * Resources
  68. [fn:1] https://chrishayward.xyz/posts/immutable-emacs/
  69. [fn:2] https://github.com/raxod502/straight.el
  70. [fn:3] https://github.com/jwiegley/use-package
  71. [fn:4] https://orgmode.org
  72. [fn:5] https://chrishayward.xyz/notes/literate-programming/
  73. [fn:6] https://orgmode.org/worg/org-contrib/babel/languages/index.html
  74. [fn:7] https://orgmode.org/manual/Structure-Templates.html