init.el 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. ;;; init.el -*- lexical-binding: t; -*-
  2. ;;elpaca
  3. (defvar elpaca-installer-version 0.12)
  4. (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
  5. (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
  6. (defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory))
  7. (defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
  8. :ref nil :depth 1 :inherit ignore
  9. :files (:defaults "elpaca-test.el" (:exclude "extensions"))
  10. :build (:not elpaca-activate)))
  11. (let* ((repo (expand-file-name "elpaca/" elpaca-sources-directory))
  12. (build (expand-file-name "elpaca/" elpaca-builds-directory))
  13. (order (cdr elpaca-order))
  14. (default-directory repo))
  15. (add-to-list 'load-path (if (file-exists-p build) build repo))
  16. (unless (file-exists-p repo)
  17. (make-directory repo t)
  18. (when (<= emacs-major-version 28) (require 'subr-x))
  19. (condition-case-unless-debug err
  20. (if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
  21. ((zerop (apply #'call-process `("git" nil ,buffer t "clone"
  22. ,@(when-let* ((depth (plist-get order :depth)))
  23. (list (format "--depth=%d" depth) "--no-single-branch"))
  24. ,(plist-get order :repo) ,repo))))
  25. ((zerop (call-process "git" nil buffer t "checkout"
  26. (or (plist-get order :ref) "--"))))
  27. (emacs (concat invocation-directory invocation-name))
  28. ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
  29. "--eval" "(byte-recompile-directory \".\" 0 'force)")))
  30. ((require 'elpaca))
  31. ((elpaca-generate-autoloads "elpaca" repo)))
  32. (progn (message "%s" (buffer-string)) (kill-buffer buffer))
  33. (error "%s" (with-current-buffer buffer (buffer-string))))
  34. ((error) (warn "%s" err) (delete-directory repo 'recursive))))
  35. (unless (require 'elpaca-autoloads nil t)
  36. (require 'elpaca)
  37. (elpaca-generate-autoloads "elpaca" repo)
  38. (let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
  39. (add-hook 'after-init-hook #'elpaca-process-queues)
  40. (elpaca `(,@elpaca-order))
  41. (elpaca benchmark-init)
  42. (elpaca-wait)
  43. (benchmark-init/activate)
  44. ;; emacs 30 fix
  45. ;;(add-to-list 'elpaca-ignored-dependencies 'compat)
  46. ;; ==============================================================================
  47. ;; CORE UI & INTERFACE
  48. ;; ==============================================================================
  49. (elpaca compat)
  50. (elpaca general) ;Keybindings
  51. (elpaca vertico) ;vertical minibuffer
  52. (elpaca vertico-posframe) ;hover
  53. (elpaca orderless) ;Filtering for Consult/Vertico
  54. (elpaca marginalia) ;Annotations in the minibuffer
  55. (elpaca corfu) ;In-buffer completion
  56. ;;(elpaca corfu-terminal) ;obsolete on Emacs 31+ — posframe now works in TUI, no corfu-terminal needed
  57. ;;(elpaca-wait) ;Ensure UI is ready before loading tools
  58. (elpaca nerd-icons)
  59. (elpaca nerd-icons-completion)
  60. (elpaca nerd-icons-dired)
  61. (elpaca nerd-icons-corfu)
  62. (elpaca doom-modeline)
  63. ;; ==============================================================================
  64. ;; EDITING & NAVIGATION
  65. ;; ==============================================================================
  66. ;;(elpaca meow) ; Modal editing
  67. (elpaca god-mode) ; psuedo modal editing
  68. (elpaca multiple-cursors)
  69. (elpaca avy) ; Fast jumping
  70. (elpaca surround) ; utilties around surround selection
  71. (elpaca expreg) ; expand selection
  72. (elpaca undo-fu)
  73. (elpaca vundo) ; Visual undo tree
  74. (elpaca embark) ; Contextual actions
  75. (elpaca embark-consult)
  76. (elpaca wgrep) ; allow writeable grep buffers
  77. (elpaca drag-stuff)
  78. ;(elpaca lsp-embark)
  79. (elpaca kirigami) ; folding meta utility
  80. (elpaca pcre2el) ; fix regex
  81. ;; ==============================================================================
  82. ;; CODE ANALYSIS & VISUALS
  83. ;; ==============================================================================
  84. (elpaca treesit-fold) ; folding based on treesit
  85. (elpaca highlight-quoted) ; emacs
  86. (elpaca highlight-defined) ; emacs
  87. (elpaca color-identifiers-mode) ; emacs
  88. (elpaca highlight-parentheses) ; delimiters around point
  89. (elpaca rainbow-delimiters) ; rainbow colours for pairs
  90. (elpaca outline-indent) ;
  91. (elpaca (svg-margin
  92. :repo "chiply/svg-margin"
  93. :host github))
  94. ;; ==============================================================================
  95. ;; LSP & DEVELOPMENT
  96. ;; ==============================================================================
  97. (elpaca mason) ; LSP server manager
  98. (elpaca lsp-mode)
  99. (elpaca lsp-ui)
  100. (elpaca clang-format)
  101. (elpaca flycheck)
  102. (elpaca consult-lsp)
  103. (elpaca consult-flycheck)
  104. (elpaca yasnippet)
  105. (elpaca yasnippet-snippets)
  106. ;; ==============================================================================
  107. ;; LANGUAGE MODES
  108. ;; ==============================================================================
  109. (elpaca kdl-mode)
  110. (elpaca csv-mode)
  111. (elpaca arduino-mode)
  112. (elpaca platformio-mode)
  113. (elpaca nix-mode)
  114. (elpaca web-mode)
  115. ;; ==============================================================================
  116. ;; UTILITIES
  117. ;; ==============================================================================
  118. (elpaca consult) ; Enhanced search/navigation
  119. (elpaca clipetty)
  120. (elpaca ghostel) ; terminal
  121. (elpaca shell-pop)
  122. (elpaca colorful-mode) ; colourise color codes
  123. (elpaca (dirvish
  124. :repo "latiagertrutis/dirvish"
  125. :host github)) ; broken on emacs 30, fixed by using fork
  126. (elpaca (dired-clipboard
  127. :repo "kn66/dired-clipboard.el" ;system clipboard in dired
  128. :host github))
  129. (elpaca transient) ; bindings in modes
  130. (elpaca magit) ; git client
  131. ;(elpaca transpose-frame) ; edit frame layout ; replaced by emacs 31 window management
  132. (elpaca jit-spell) ; spellcheck
  133. (elpaca sudo-edit) ; sudo util
  134. ;; ==============================================================================
  135. ;; KNOWLEDGE MANAGEMENT (ZK/DENOTE)
  136. ;; ==============================================================================
  137. (elpaca denote)
  138. (elpaca consult-denote)
  139. (elpaca denote-menu)
  140. ;; ==============================================================================
  141. ;; ELPACA CONFIGURATION
  142. ;; ==============================================================================
  143. (elpaca elpaca-use-package
  144. ;; Automatically adds :ensure t and :defer t to use-package declarations
  145. (elpaca-use-package-mode)
  146. (setq elpaca-use-package-by-default t))
  147. (load (expand-file-name "config.el" user-emacs-directory))
  148. (custom-set-variables
  149. ;; custom-set-variables was added by Custom.
  150. ;; If you edit it by hand, you could mess it up, so be careful.
  151. ;; Your init file should contain only one such instance.
  152. ;; If there is more than one, they won't work right.
  153. '(custom-safe-themes
  154. '()))
  155. (custom-set-faces
  156. ;; custom-set-faces was added by Custom.
  157. ;; If you edit it by hand, you could mess it up, so be careful.
  158. ;; Your init file should contain only one such instance.
  159. ;; If there is more than one, they won't work right.
  160. )
  161. (setq minimal-emacs--success t)
  162. (setq initial-major-mode 'fundamental-mode
  163. initial-scratch-message nil)