2023-10-23 08:52:59 +01:00
|
|
|
;;; init.el -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;;; Initial phase.
|
|
|
|
|
|
|
|
;; Load the custom file if it exists. Among other settings, this will
|
|
|
|
;; have the list `package-selected-packages', so we need to load that
|
|
|
|
;; before adding more packages. The value of the `custom-file'
|
|
|
|
;; variable must be set appropriately, by default the value is nil.
|
|
|
|
;; This can be done here, or in the early-init.el file.
|
2023-10-24 21:18:00 +01:00
|
|
|
(setq custom-file (locate-user-emacs-file "custom.el"))
|
2023-10-23 08:52:59 +01:00
|
|
|
(when (and custom-file (file-exists-p custom-file))
|
2023-10-23 17:28:05 +01:00
|
|
|
(load custom-file nil 'nomessage))
|
2023-10-23 08:52:59 +01:00
|
|
|
|
2023-10-23 17:28:05 +01:00
|
|
|
;; Add custom modules to the `load-path'
|
|
|
|
(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
|
|
|
|
|
|
|
|
;; Adds crafted-emacs modules to the `load-path'
|
|
|
|
(setq crafted-emacs-home (expand-file-name "crafted-emacs" user-emacs-directory))
|
|
|
|
(add-to-list 'load-path (expand-file-name "modules" crafted-emacs-home))
|
2023-10-23 08:52:59 +01:00
|
|
|
|
|
|
|
;;; Configuration phase
|
2023-10-23 17:28:05 +01:00
|
|
|
(require 'crafted-completion-config)
|
|
|
|
(require 'crafted-defaults-config)
|
|
|
|
(require 'crafted-ide-config)
|
|
|
|
(require 'crafted-org-config)
|
|
|
|
(require 'crafted-workspaces-packages)
|
|
|
|
(require 'crafted-writing-packages)
|
2023-10-23 08:52:59 +01:00
|
|
|
|
2023-10-24 08:06:35 +01:00
|
|
|
(require 'custom-email-config)
|
|
|
|
(require 'custom-feed-config)
|
|
|
|
(require 'custom-ide-config)
|
|
|
|
(require 'custom-ligatures-config)
|
2023-10-26 16:11:52 +01:00
|
|
|
(require 'custom-media-config)
|
2023-10-25 15:47:35 +01:00
|
|
|
(require 'custom-org-config)
|
2023-10-24 08:06:35 +01:00
|
|
|
(require 'custom-project-config)
|
2023-10-25 15:47:35 +01:00
|
|
|
(require 'custom-ui-config)
|
2023-10-24 08:06:35 +01:00
|
|
|
|
2023-10-23 08:52:59 +01:00
|
|
|
;;; Optional configuration
|
|
|
|
|
2023-10-23 18:02:14 +01:00
|
|
|
(setq user-full-name "Evie Litherland-Smith"
|
|
|
|
user-mail-address "evie@xenia.me.uk"
|
2023-10-24 08:06:35 +01:00
|
|
|
sendmail-program (executable-find "msmtp")
|
|
|
|
send-mail-function #'smtpmail-send-it
|
|
|
|
message-sendmail-f-is-evil t
|
|
|
|
message-sendmail-extra-arguments '("--read-envelope-from")
|
|
|
|
message-send-mail-function #'message-send-mail-with-sendmail
|
2023-10-24 18:15:21 +01:00
|
|
|
message-kill-buffer-on-exit t
|
2023-10-23 23:55:52 +01:00
|
|
|
display-line-numbers 'relative
|
|
|
|
fill-column 80)
|
2023-10-23 18:02:14 +01:00
|
|
|
|
|
|
|
;; Theme settings
|
2023-10-25 15:47:35 +01:00
|
|
|
(customize-set-variable 'crafted-startup-inhibit-splash t)
|
|
|
|
(setq use-dialog-box nil)
|
2023-10-24 08:06:35 +01:00
|
|
|
(tool-bar-mode -1)
|
|
|
|
(scroll-bar-mode -1)
|
2023-10-23 17:28:05 +01:00
|
|
|
(load-theme 'doom-tokyo-night t)
|
|
|
|
(add-to-list 'default-frame-alist '(font . "FiraCode Nerd Font-12"))
|
|
|
|
(global-prettify-symbols-mode)
|
2023-10-23 18:02:14 +01:00
|
|
|
(set-frame-parameter nil 'alpha-background 80)
|
|
|
|
(add-to-list 'default-frame-alist '(alpha-background . 80))
|
2023-10-23 17:28:05 +01:00
|
|
|
|
2023-10-24 08:06:35 +01:00
|
|
|
;; Extra minor-modes
|
|
|
|
(which-key-mode)
|
|
|
|
|
2023-10-23 23:55:52 +01:00
|
|
|
;; Extra functions
|
|
|
|
|
2023-10-23 08:52:59 +01:00
|
|
|
(defun crafted-startup-example/display-startup-time ()
|
|
|
|
"Display the startup time after Emacs is fully initialized."
|
|
|
|
(message "Crafted Emacs loaded in %s."
|
|
|
|
(emacs-init-time)))
|
|
|
|
(add-hook 'emacs-startup-hook #'crafted-startup-example/display-startup-time)
|
|
|
|
|
2023-10-23 23:55:52 +01:00
|
|
|
(defun my/org-move-done-tasks-to-bottom ()
|
|
|
|
"Sort all tasks in the topmost heading by TODO state."
|
|
|
|
(interactive)
|
|
|
|
(save-excursion
|
|
|
|
(while (org-up-heading-safe))
|
|
|
|
(org-sort-entries nil ?o))
|
|
|
|
|
|
|
|
;; Reset the view of TODO items
|
|
|
|
(org-overview)
|
|
|
|
(org-show-entry)
|
|
|
|
(org-show-children))
|
|
|
|
|
2023-10-23 08:52:59 +01:00
|
|
|
;; Set default coding system (especially for Windows)
|
|
|
|
(set-default-coding-systems 'utf-8)
|
2023-10-23 17:28:05 +01:00
|
|
|
(set-terminal-coding-system 'utf-8)
|
|
|
|
(set-keyboard-coding-system 'utf-8)
|
|
|
|
|
2023-10-23 18:02:14 +01:00
|
|
|
;; Magit settings
|
|
|
|
(setq magit-clone-default-directory "~/Projects/")
|
2023-10-23 17:28:05 +01:00
|
|
|
|
2023-10-23 18:02:14 +01:00
|
|
|
;; ntfy server settings
|
|
|
|
(setq ntfy-server "https://ntfy.xenia.me.uk"
|
|
|
|
ntfy-topic "UhrNGphnSKCpCnk8"
|
|
|
|
ntfy-header "Notification from emacs"
|
|
|
|
ntfy-tags "purple_circle,loudspeaker")
|
2023-10-23 17:28:05 +01:00
|
|
|
|
2023-10-23 18:02:14 +01:00
|
|
|
;; Apheleia settings
|
|
|
|
(setq apheleia-remote-algorithm 'local)
|
2023-10-23 08:52:59 +01:00
|
|
|
|
2023-10-23 18:02:14 +01:00
|
|
|
;; TRAMP settings
|
|
|
|
(setq tramp-default-method "sshx"
|
|
|
|
tramp-default-remote-shell "/bin/sh"
|
|
|
|
tramp-remote-path '(tramp-own-remote-path tramp-default-remote-path))
|