Compare commits

..

No commits in common. "eafbe0bc15798682dd18612727ab3a021125d94d" and "47dec1062782c9c84921d3a904bea0e3130bec7a" have entirely different histories.

3 changed files with 88 additions and 226 deletions

1
.gitignore vendored
View File

@ -10,7 +10,6 @@ tutorial/
auto-save-list/ auto-save-list/
transient/ transient/
straight/ straight/
elpaca/
eshell/history eshell/history
eshell/lastdir eshell/lastdir

View File

@ -1,4 +1,2 @@
;; For elpaca ;; For straight.el
;;; Code:
(setq package-enable-at-startup nil) (setq package-enable-at-startup nil)

303
init.el
View File

@ -29,14 +29,6 @@
(defvaralias 'c-basic-offset 'tab-width) (defvaralias 'c-basic-offset 'tab-width)
(electric-indent-mode 0) (electric-indent-mode 0)
;; Hide all minor modes from the modeline
(setq mode-line-modes
(mapcar (lambda (elem)
(pcase elem
(`(:propertize (,_ minor-mode-alist . ,_) . ,_) "")
(t elem)))
mode-line-modes))
;; Clipboard config ;; Clipboard config
(setopt select-active-regions nil) (setopt select-active-regions nil)
(setopt select-enable-clipboard 't) (setopt select-enable-clipboard 't)
@ -74,50 +66,19 @@
(define-key global-map [remap digit-argument] "") (define-key global-map [remap digit-argument] "")
;; Package management setup ;; Package management setup
; Elpaca ; straight.el
(defvar elpaca-installer-version 0.11) (defvar bootstrap-version)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (let
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) ((bootstrap-file
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" (bootstrap-version 5))
:ref nil :depth 1 :inherit ignore (unless (file-exists-p bootstrap-file)
:files (:defaults "elpaca-test.el" (:exclude "extensions")) (with-current-buffer
:build (:not elpaca--activate-package))) (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 'silent 'inhibit-cookies)
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) (goto-char (point-max))
(build (expand-file-name "elpaca/" elpaca-builds-directory)) (eval-print-last-sexp)))
(order (cdr elpaca-order)) (load bootstrap-file nil 'nomessage))
(default-directory repo)) (setq straight-use-package-by-default t)
(add-to-list 'load-path (if (file-exists-p build) build repo))
(unless (file-exists-p repo)
(make-directory repo t)
(when (<= emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err
(if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (apply #'call-process `("git" nil ,buffer t "clone"
,@(when-let* ((depth (plist-get order :depth)))
(list (format "--depth=%d" depth) "--no-single-branch"))
,(plist-get order :repo) ,repo))))
((zerop (call-process "git" nil buffer t "checkout"
(or (plist-get order :ref) "--"))))
(emacs (concat invocation-directory invocation-name))
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo)))
(progn (message "%s" (buffer-string)) (kill-buffer buffer))
(error "%s" (with-current-buffer buffer (buffer-string))))
((error) (warn "%s" err) (delete-directory repo 'recursive))))
(unless (require 'elpaca-autoloads nil t)
(require 'elpaca)
(elpaca-generate-autoloads "elpaca" repo)
(let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
; Install use-package support
(elpaca elpaca-use-package
;; Enable use-package :ensure support for Elpaca.
(elpaca-use-package-mode))
(elpaca-wait)
;; Optimisation ;; Optimisation
; GCMH ; GCMH
@ -142,7 +103,6 @@
) )
; Fontification ; Fontification
(jit-lock-mode 1) (jit-lock-mode 1)
(jit-lock-debug-mode 1)
(setq jit-lock-stealth-time 1.25) (setq jit-lock-stealth-time 1.25)
(setq jit-lock-stealth-nice 0.5) ;; Seconds between font locking. (setq jit-lock-stealth-nice 0.5) ;; Seconds between font locking.
(setq jit-lock-chunk-size 4096) (setq jit-lock-chunk-size 4096)
@ -156,79 +116,9 @@
(lambda () (lambda ()
(setq jit-lock-defer-time 0)) nil t)) (setq jit-lock-defer-time 0)) nil t))
;; Org Mode Config
;Agenda
;For Org-Agenda, you can set a location of your Org Agenda file here. Set Agenda Directory:
(use-package org
:ensure (:wait t)
:demand t
:config
(setq org-agenda-files '("~/Agenda"))
;This is will integrate the Calendar/Diary into Org-Agenda, so you can get access to dates on public holidays etc. Set diary to true:
(setq org-agenda-include-diary t)
;Ensure done date/closed timestamps are logged
(setq org-log-done 'time)
;Ensure agenda still shows DONE items
(setq org-agenda-skip-scheduled-if-done nil)
(setq agenda-skip-deadline-if-done nil)
(setq org-startup-folded t)
)
; For Org Pomodoro notification sound
(use-package sound-wav
:ensure t
)
; Org Pomodoro
(use-package org-pomodoro
:ensure t
:after org
:config
(setq org-pomodoro-manual-break t)
(setq org-pomodoro-keep-killed-pomodoro-time t)
(setq org-pomodoro-play-sounds t)
(setq org-pomodoro-ticking-sound-p nil)
(setq org-pomodoro-audio-player "mpv")
)
(defun sound-alert (alert)
(sound-wav-play (concat (expand-file-name "~") "/.emacs.d/elpaca/builds/org-pomodoro/resources/bell.wav"))
(message alert))
; System notifications of org agenda items
(use-package org-alert
:ensure t
:after org
:config
(setq alert-default-style 'libnotify)
(setq alert-libnotify-command '(sound-alert))
(org-alert-enable)
)
; Org Mode Journalling
(use-package org-journal
:ensure t
:after org
:config
(setq org-journal-dir "~/Journal/")
(setq org-journal-file-type 'daily)
(setq org-journal-file-format "%Y%m%d.org")
)
;; Org Latex Preview Scale
; Automatically toggle Org mode LaTeX fragment previews as the cursor enters and exits them
(use-package org-fragtog
:ensure t
:after org
:config
(add-hook 'org-mode-hook 'org-latex-preview)
(add-hook 'org-mode-hook 'org-fragtog-mode)
(setq org-format-latex-options (plist-put org-format-latex-options :scale 3.0))
)
;; Emacs minibuffer configurations. ;; Emacs minibuffer configurations.
(use-package emacs (use-package emacs
:ensure nil :ensure t
:custom :custom
(tab-always-indent 'complete) (tab-always-indent 'complete)
@ -254,10 +144,10 @@
;; Global settings (defaults) ;; Global settings (defaults)
(setq (setq
doom-themes-enable-bold t ; if nil, bold is universally disabled doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t ; if nil, italics is universally disabled doom-themes-enable-italic t
) )
(load-theme 'doom-gruvbox-light t) ) ; if nil, italics is universally disabled
) (load-theme 'doom-gruvbox-light t)
;; Autocompletion configuration ;; Autocompletion configuration
;(use-package ido-vertical-mode ;(use-package ido-vertical-mode
@ -298,7 +188,7 @@
;; Persist history over Emacs restarts. Vertico sorts by history position. ;; Persist history over Emacs restarts. Vertico sorts by history position.
(use-package savehist (use-package savehist
:ensure nil :ensure t
:init :init
(savehist-mode) (savehist-mode)
) )
@ -344,7 +234,6 @@
; Like zoxide ; Like zoxide
(use-package eshell-z (use-package eshell-z
:ensure t :ensure t
:after tramp
:config :config
(add-hook 'eshell-mode-hook (add-hook 'eshell-mode-hook
(defun my-eshell-mode-hook () (defun my-eshell-mode-hook ()
@ -366,6 +255,14 @@
) )
; Eat is a terminal emulator that can integrate nicely with eshell, allows us to run full ncurses applications inside eshell. ; Eat is a terminal emulator that can integrate nicely with eshell, allows us to run full ncurses applications inside eshell.
(use-package eat (use-package eat
:straight '(eat :type git
:host codeberg
:repo "akib/emacs-eat"
:files ("*.el" ("term" "term/*.el") "*.texi"
"*.ti" ("terminfo/e" "terminfo/e/*")
("terminfo/65" "terminfo/65/*")
("integration" "integration/*")
(:exclude ".dir-locals.el" "*-tests.el")))
:ensure t :ensure t
:init :init
;; For `eat-eshell-mode'. ;; For `eat-eshell-mode'.
@ -388,11 +285,8 @@
(setq tramp-auto-save-directory "~/.emacs.d/tramp-autosave") (setq tramp-auto-save-directory "~/.emacs.d/tramp-autosave")
;; Magit ;; Magit
(use-package transient
:ensure t)
(use-package magit (use-package magit
:ensure t :ensure t)
:after transient)
;; TRAMP ;; TRAMP
;TRAMP edit files over SSH configuration ;TRAMP edit files over SSH configuration
@ -405,100 +299,61 @@
(setq tramp-default-method "plink")) (setq tramp-default-method "plink"))
) )
;; Mu4e Mail Config ;; Org Mode Config
(if (executable-find "mu") ;Agenda
(use-package mu4e ;For Org-Agenda, you can set a location of your Org Agenda file here. Set Agenda Directory:
:ensure nil (use-package org
:ensure t
:config :config
(setq mu4e-mu-binary (executable-find "mu")) (setq org-agenda-files '("~/Agenda"))
;This is will integrate the Calendar/Diary into Org-Agenda, so you can get access to dates on public holidays etc. Set diary to true:
(setq org-agenda-include-diary t)
;Ensure done date/closed timestamps are logged
(setq org-log-done 'time)
;; This is set to 't' to avoid mail syncing issues when using mbsync (setq org-startup-folded t)
(setq mu4e-change-filenames-when-moving t)
;; Refresh mail using isync every 10 minutes
;(setq mu4e-update-interval (* 10 60))
(setq mu4e-get-mail-command "mbsync -a")
(setq mu4e-maildir "~/Mail")
;; Use completing read AKA vertico
(setq mu4e-completing-read-function 'completing-read)
(setq mu4e-contexts
(list
;; Work account
(make-mu4e-context
:name "A CSpark Work"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/work-cspark" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "work@cspark.dev")
(user-full-name . "Curt Spark (Work)")
(mu4e-inbox-folder . "/work-cspark/Inbox")
(mu4e-drafts-folder . "/work-cspark/Drafts")
(mu4e-sent-folder . "/work-cspark/Sent Mail")
(mu4e-trash-folder . "/work-cspark/Trash")))
;; Services account
(make-mu4e-context
:name "B CSpark Services"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/services-cspark" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "services@cspark.dev")
(user-full-name . "Curt Spark (services)")
(mu4e-inbox-folder . "/services-cspark/Inbox")
(mu4e-drafts-folder . "/services-cspark/Drafts")
(mu4e-sent-folder . "/services-cspark/Sent Mail")
(mu4e-trash-folder . "/services-cspark/Trash")))
;; Personal account
(make-mu4e-context
:name "C CSpark Personal"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/personal-cspark" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "personal@cspark.dev")
(user-full-name . "Curt Spark (personal)")
(mu4e-inbox-folder . "/personal-cspark/Inbox")
(mu4e-drafts-folder . "/personal-cspark/Drafts")
(mu4e-sent-folder . "/personal-cspark/Sent Mail")
(mu4e-trash-folder . "/personal-cspark/Trash")))
;; Tuxtank Services account
(make-mu4e-context
:name "D Tuxtank Services"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/personal-tuxtank" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "personal@tuxtank.dev")
(user-full-name . "Tuxtank (personal)")
(mu4e-inbox-folder . "/personal-tuxtank/Inbox")
(mu4e-drafts-folder . "/personal-tuxtank/Drafts")
(mu4e-sent-folder . "/personal-tuxtank/Sent Mail")
(mu4e-trash-folder . "/personal-tuxtank/Trash"))))
)
;(setq mu4e-maildir-shortcuts
; '(("/Gmail/Inbox" . ?i)
; ("/Gmail/[Gmail]/Sent Mail" . ?s)
; ("/Gmail/[Gmail]/Trash" . ?t)
; ("/Gmail/[Gmail]/Drafts" . ?d)
; ("/Gmail/[Gmail]/All Mail" . ?a)))
)
) )
;; Rainbow delimiters ; Org Pomodoro
(use-package rainbow-delimiters (use-package org-pomodoro
:ensure t :ensure t
:hook :after org
(prog-mode . rainbow-delimiters-mode)) :config
(setq org-pomodoro-manual-break t)
(setq org-pomodoro-keep-killed-pomodoro-time t)
(setq org-pomodoro-play-sounds t)
(setq org-pomodoro-ticking-sound-p nil)
(setq org-pomodoro-audio-player "mpv")
)
; For Org Pomodoro notification sound
(use-package sound-wav
:ensure t
)
; System notifications of org agenda items
(use-package org-alert
:ensure t
:after org
:config
(org-alert-enable)
)
; Org Latex Preview Scale
; Automatically toggle Org mode LaTeX fragment previews as the cursor enters and exits them
(use-package org-fragtog
:ensure t
:after org
:config
(add-hook 'org-mode-hook 'org-latex-preview)
(add-hook 'org-mode-hook 'org-fragtog-mode)
(setq org-format-latex-options (plist-put org-format-latex-options :scale 3.0))
)
;; Treesit Config ;; Treesit Config
(use-package treesit (use-package treesit
:ensure nil :ensure nil
:straight nil
:commands (treesit-install-language-grammar nf/treesit-install-all-languages) :commands (treesit-install-language-grammar nf/treesit-install-all-languages)
:init :init
(setq treesit-language-source-alist (setq treesit-language-source-alist
@ -539,33 +394,42 @@
; Remap basic modes to treesit equivalent ; Remap basic modes to treesit equivalent
(use-package bash-ts-mode (use-package bash-ts-mode
:ensure nil :ensure nil
:straight nil
:mode "\\.sh\\'") :mode "\\.sh\\'")
(use-package c-ts-mode (use-package c-ts-mode
:ensure nil :ensure nil
:straight nil
:mode "\\.c\\'") :mode "\\.c\\'")
(use-package rust-ts-mode (use-package rust-ts-mode
:ensure nil :ensure nil
:straight nil
:mode "\\.rs\\'") :mode "\\.rs\\'")
(use-package swift-ts-mode (use-package swift-ts-mode
:ensure t :ensure t
:mode "\\.swift\\'") :mode "\\.swift\\'")
(use-package nix-ts-mode (use-package nix-ts-mode
:ensure nil :ensure nil
:straight nil
:mode "\\.nix\\'") :mode "\\.nix\\'")
(use-package html-ts-mode (use-package html-ts-mode
:ensure nil :ensure nil
:straight nil
:mode "\\.html\\'") :mode "\\.html\\'")
(use-package css-ts-mode (use-package css-ts-mode
:ensure nil :ensure nil
:straight nil
:mode "\\.css\\'") :mode "\\.css\\'")
(use-package js-ts-mode (use-package js-ts-mode
:ensure nil :ensure nil
:straight nil
:mode "\\.js\\'") :mode "\\.js\\'")
(use-package typescript-ts-mode (use-package typescript-ts-mode
:ensure nil :ensure nil
:straight nil
:mode "\\.ts\\'") :mode "\\.ts\\'")
(use-package tsx-ts-mode (use-package tsx-ts-mode
:ensure nil :ensure nil
:straight nil
:mode "\\.tsx\\'") :mode "\\.tsx\\'")
;(use-package emacs-lisp-ts-mode ;(use-package emacs-lisp-ts-mode
; :ensure t) ; :ensure t)
@ -606,6 +470,7 @@
;; Flymake Configuration ;; Flymake Configuration
(use-package flymake (use-package flymake
:ensure nil :ensure nil
:straight nil
:hook :hook
(prog-mode . flymake-mode) (prog-mode . flymake-mode)
(emacs-lisp-mode . flymake-mode) (emacs-lisp-mode . flymake-mode)