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.

101 lines
3.9 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. + Force *straight.el*[fn:2] to ignore the local version of *Org*[fn:4]
  15. #+begin_src emacs-lisp
  16. (straight-use-package '(org :local-repo nil))
  17. #+end_src
  18. + Setup ~shell~ and ~emacs-lisp~ as *Babel Languages*[fn:6]
  19. + Configure *Structure Templates*[fn:7] for both languages
  20. #+begin_src emacs-lisp
  21. (use-package org
  22. :hook (org-mode . (lambda ()
  23. (org-indent-mode)
  24. (visual-line-mode 1)
  25. (variable-pitch-mode 1)))
  26. :custom (org-ellipsis " ▾")
  27. (org-log-done 'time)
  28. (org-log-into-drawer t)
  29. (org-return-follows-link t)
  30. (org-image-actual-width nil)
  31. (org-directory dotfiles/home)
  32. (org-src-fontify-natively t)
  33. (org-src-tab-acts-natively t)
  34. (org-src-preserve-indentation t)
  35. (org-confirm-babel-evaluate nil)
  36. (org-todo-keywords '((sequence "TODO" "START" "WAIT" "DONE")))
  37. :config (require 'org-tempo)
  38. (add-to-list 'org-structure-template-alist '("s" . "src"))
  39. (add-to-list 'org-structure-template-alist '("q" . "quote"))
  40. (add-to-list 'org-structure-template-alist '("e" . "example"))
  41. (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
  42. (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
  43. (org-babel-do-load-languages 'org-babel-load-languages '((shell . t)
  44. (emacs-lisp . t))))
  45. #+end_src
  46. * Cleanup
  47. 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.
  48. #+begin_src emacs-lisp
  49. (use-package no-littering)
  50. #+end_src
  51. 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.
  52. #+begin_src emacs-lisp
  53. (setq inhibit-startup-message t
  54. initial-scratch-message "")
  55. (global-prettify-symbols-mode)
  56. (when (fboundp 'tooltip-mode)
  57. (tooltip-mode -1))
  58. (when (fboundp 'tool-bar-mode)
  59. (tool-bar-mode -1))
  60. (when (fboundp 'menu-bar-mode)
  61. (menu-bar-mode -1))
  62. (when (fboundp 'scroll-bar-mode)
  63. (scroll-bar-mode -1))
  64. #+end_src
  65. * Performance
  66. 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.
  67. #+begin_src emacs-lisp
  68. (setq gc-cons-threshold most-positive-fixnum
  69. gnutls-min-prime-bits 4096)
  70. #+end_src
  71. * Resources
  72. [fn:1] https://chrishayward.xyz/posts/immutable-emacs/
  73. [fn:2] https://github.com/raxod502/straight.el
  74. [fn:3] https://github.com/jwiegley/use-package
  75. [fn:4] https://orgmode.org
  76. [fn:5] https://chrishayward.xyz/notes/literate-programming/
  77. [fn:6] https://orgmode.org/worg/org-contrib/babel/languages/index.html
  78. [fn:7] https://orgmode.org/manual/Structure-Templates.html