From 0f35e21716aeb7a922063f8d1ca5f235bafcbd5b Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 6 Nov 2023 07:18:06 +0000 Subject: [PATCH] Make babel load path dynamic instead of fixed to .config Remove crafted-emacs input and tokyonight theme (and uses) Remove old emacs files so I don't get confused --- flake.lock | 36 +--- flake.nix | 14 +- home/default.nix | 4 +- home/emacs/default.nix | 4 +- home/emacs/doom/config.el | 180 ------------------ home/emacs/doom/custom.el | 12 -- home/emacs/doom/directory-files-recursive.el | 49 ----- home/emacs/doom/init.el | 154 --------------- home/emacs/doom/packages.el | 10 - home/emacs/init.el | 57 ------ home/emacs/modules/custom-defaults-config.el | 40 ---- home/emacs/modules/custom-email-config.el | 70 ------- home/emacs/modules/custom-feed-config.el | 14 -- home/emacs/modules/custom-ide-config.el | 24 --- home/emacs/modules/custom-ligatures-config.el | 60 ------ home/emacs/modules/custom-media-config.el | 23 --- home/emacs/modules/custom-org-config.el | 66 ------- home/emacs/modules/custom-project-config.el | 12 -- home/emacs/modules/custom-social-config.el | 5 - home/emacs/modules/custom-ui-config.el | 140 -------------- 20 files changed, 5 insertions(+), 969 deletions(-) delete mode 100644 home/emacs/doom/config.el delete mode 100644 home/emacs/doom/custom.el delete mode 100644 home/emacs/doom/directory-files-recursive.el delete mode 100644 home/emacs/doom/init.el delete mode 100644 home/emacs/doom/packages.el delete mode 100644 home/emacs/init.el delete mode 100644 home/emacs/modules/custom-defaults-config.el delete mode 100644 home/emacs/modules/custom-email-config.el delete mode 100644 home/emacs/modules/custom-feed-config.el delete mode 100644 home/emacs/modules/custom-ide-config.el delete mode 100644 home/emacs/modules/custom-ligatures-config.el delete mode 100644 home/emacs/modules/custom-media-config.el delete mode 100644 home/emacs/modules/custom-org-config.el delete mode 100644 home/emacs/modules/custom-project-config.el delete mode 100644 home/emacs/modules/custom-social-config.el delete mode 100644 home/emacs/modules/custom-ui-config.el diff --git a/flake.lock b/flake.lock index e96faf8c..5474956a 100644 --- a/flake.lock +++ b/flake.lock @@ -130,22 +130,6 @@ "type": "github" } }, - "crafted-emacs": { - "flake": false, - "locked": { - "lastModified": 1697837545, - "narHash": "sha256-Sucimd2VjeUZ3GZ7kC1W+ix9t30npaHuZgjdvhHuTCU=", - "owner": "SystemCrafters", - "repo": "crafted-emacs", - "rev": "bc6618a2950e354cc6b1bc24c63f3b2c6d71141b", - "type": "github" - }, - "original": { - "owner": "SystemCrafters", - "repo": "crafted-emacs", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -257,12 +241,10 @@ }, "root": { "inputs": { - "crafted-emacs": "crafted-emacs", "home-manager": "home-manager", "nix-index-database": "nix-index-database", "nixpkgs": "nixpkgs", - "stylix": "stylix", - "tokyonight-folke": "tokyonight-folke" + "stylix": "stylix" } }, "stylix": { @@ -294,22 +276,6 @@ "repo": "stylix", "type": "github" } - }, - "tokyonight-folke": { - "flake": false, - "locked": { - "lastModified": 1697438389, - "narHash": "sha256-ZhWUURBWzRaHr1RpWq4tqcjXuVQIYovUAN5XagVIgtc=", - "owner": "folke", - "repo": "tokyonight.nvim", - "rev": "1e5492bb99d461a5a0d020a119fc76d75945af84", - "type": "github" - }, - "original": { - "owner": "folke", - "repo": "tokyonight.nvim", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 1a49b057..d3bccd5f 100644 --- a/flake.nix +++ b/flake.nix @@ -15,16 +15,6 @@ url = "github:danth/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; - - # Non-flake inputs - crafted-emacs = { - url = "github:SystemCrafters/crafted-emacs"; - flake = false; - }; - tokyonight-folke = { - url = "github:folke/tokyonight.nvim"; - flake = false; - }; }; outputs = @@ -57,9 +47,7 @@ }: let specialArgs = { inherit hostName user; }; - extraSpecialArgs = specialArgs // { - inherit (inputs) crafted-emacs tokyonight-folke; - }; + extraSpecialArgs = specialArgs; in nixpkgs.lib.nixosSystem { inherit system specialArgs; modules = [ diff --git a/home/default.nix b/home/default.nix index 83b5a952..5191cd59 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,8 +1,6 @@ -{ config, lib, pkgs, tokyonight-folke, ... }: +{ config, lib, pkgs, ... }: { - xdg.configFile."bat/themes/tokyonight_night.tmTheme".source = - "${tokyonight-folke}/extras/sublime/tokyonight_night.tmTheme"; programs = { bash.enable = true; bat.enable = true; diff --git a/home/emacs/default.nix b/home/emacs/default.nix index 0cfe4619..6bae5dba 100644 --- a/home/emacs/default.nix +++ b/home/emacs/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, crafted-emacs, ... }: +{ config, pkgs, ... }: { xdg.configFile = { @@ -10,7 +10,7 @@ package = pkgs.emacs29-pgtk; extraConfig = '' (package-initialize) - (org-babel-load-file "~/.config/emacs/config.org") + (org-babel-load-file (locate-user-emacs-file "config.org")) ''; extraPackages = epkgs: with epkgs; [ diff --git a/home/emacs/doom/config.el b/home/emacs/doom/config.el deleted file mode 100644 index 87a70f8e..00000000 --- a/home/emacs/doom/config.el +++ /dev/null @@ -1,180 +0,0 @@ -;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- - -;; Place your private configuration here! Remember, you do not need to run 'doom -;; sync' after modifying this file! - -;; UTF-8 support -(prefer-coding-system 'utf-8) -(set-default-coding-systems 'utf-8) -(set-terminal-coding-system 'utf-8) -(set-keyboard-coding-system 'utf-8) -(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) - -(setq user-full-name "Evie Litherland-Smith" - user-mail-address "e.litherlandsmith@proton.me" - doom-font "FiraCode Nerd Font-12" - doom-symbol-fallback-font-families '("Material Icons" "FontAwesome" "Weather Icons") - doom-emoji-fallback-font-families '("Noto Color Emoji" "Noto Emoji") - nerd-icons-font-family "FiraCode Nerd Font" - doom-theme 'doom-tokyo-night - doom-modeline-gnus t - doom-modeline-persp-icon t - doom-modeline-persp-name t - display-line-numbers-type 'relative - org-directory "~/Org/" - +latex-viewers '(pdf-tools) - +format-with-lsp nil) -(+global-word-wrap-mode +1) -(setq-default left-margin-width 1 right-margin-width 1) -(set-window-buffer nil (current-buffer)) -(set-frame-parameter nil 'alpha-background 80) -(add-to-list 'default-frame-alist '(alpha-background . 80)) - -;; DOOM Dashboard customisation -(setq +doom-dashboard-menu-sections - '(("Recently opened files" - :icon (nerd-icons-mdicon "nf-md-file_document" :face 'doom-dashboard-menu-title) - :action recentf-open-files) - ("Reload last session" - :icon (nerd-icons-mdicon "nf-md-history" :face 'doom-dashboard-menu-title) - :when (cond ((modulep! :ui workspaces) - (file-exists-p (expand-file-name persp-auto-save-fname persp-save-dir))) - ((require 'desktop nil t) - (file-exists-p (desktop-full-file-name)))) - :action doom/quickload-session) - ("Open org-agenda" - :icon (nerd-icons-mdicon "nf-md-calendar" :face 'doom-dashboard-menu-title) - :when (fboundp 'org-agenda) - :action org-agenda) - ("Open project" - :icon (nerd-icons-mdicon "nf-md-briefcase" :face 'doom-dashboard-menu-title) - :action projectile-switch-project) - ("Jump to bookmark" - :icon (nerd-icons-mdicon "nf-md-bookmark" :face 'doom-dashboard-menu-title) - :action bookmark-jump) - ("Open documentation" - :icon (nerd-icons-mdicon "nf-md-book" :face 'doom-dashboard-menu-title) - :action doom/help))) - -;; elfeed update on open -(after! elfeed - (setq elfeed-db-directory "~/.elfeed/db/" - elfeed-enclosure-default-dir "~/.elfeed/enclosures/") - (after! elfeed-goodies - (setq elfeed-goodies/entry-pane-position 'bottom - elfeed-goodies/powerline-default-separator 'utf-8)) - (require 'elfeed-tube) - (elfeed-tube-setup) - (add-hook! 'elfeed-search-mode-hook #'elfeed-update)) - -;; ntfy server config -(after! ntfy - (setq ntfy-server "https://ntfy.xenia.me.uk" - ntfy-topic "UhrNGphnSKCpCnk8" - ntfy-header "Notification from emacs" - ntfy-tags "purple_circle,loudspeaker")) -(require 'ntfy) - -;; projectile auto-discover projects -(after! projectile - (setq projectile-auto-discover t - projectile-project-search-path '("~/Projects/") - doom-projectile-cache-purge-non-projects t - +workspaces-switch-project-function 'doom-project-browse - +workspaces-on-switch-project-behavior t)) - -(after! magit (setq magit-clone-default-directory "~/Projects/")) - -;; mail settings -(after! mu4e - (setq mu4e-get-mail-command "mbsync --pull-new inboxes" - mu4e-update-interval 300 - mu4e-sent-messages-behavior 'sent - mu4e-attachment-dir "~/Downloads" - mu4e-change-filenames-when-moving t - mu4e-alert-modeline-formatter 'mu4e-alert-default-mode-line-formatter - 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 - mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p) - (:maildir "/iCloud/Inbox/" :key ?i) - (:maildir "/Outlook/Inbox/" :key ?o))) - - (setq mu4e-modeline-all-read '("R:" . "󰑇 ") - mu4e-modeline-all-clear '("C:" . "󰚭 ") - mu4e-modeline-new-items '("N:" . "󰎔 ") - mu4e-modeline-unread-items '("U:" . "󰮒 ") - mu4e-search-full-label '("F" . "󱊖 ") - mu4e-search-hide-label '("H" . "󰘓 ") - mu4e-search-related-label '("R" . "󰌹 ") - mu4e-search-skip-duplicates-label '("D" . "󰆑 ") - mu4e-search-threaded-label'("T" . "󱇫 ")) - - ;; Add accounts with contexts - (set-email-account! "Proton" - '((user-mail-address . "e.litherlandsmith@proton.me") - (mu4e-sent-folder . "/Proton/Sent") - (mu4e-drafts-folder . "/Proton/Drafts") - (mu4e-trash-folder . "/Proton/Trash") - (mu4e-refile-folder . "/Proton/Archive")) - t) - (set-email-account! "iCloud" - '((user-mail-address . "e.litherlandsmith@icloud.com") - (mu4e-sent-folder . "/iCloud/Sent") - (mu4e-drafts-folder . "/iCloud/Drafts") - (mu4e-trash-folder . "/iCloud/Trash") - (mu4e-refile-folder . "/iCloud/Archive")) - nil) - (set-email-account! "Outlook" - '((user-mail-address . "evie.litherland-smith@ukaea.uk") - (mu4e-sent-folder . "/Outlook/Sent") - (mu4e-drafts-folder . "/Outlook/Drafts") - (mu4e-trash-folder . "/Outlook/Trash") - (mu4e-refile-folder . "/Outlook/Archive")) - nil) - ) - -;; Calendar settings -(defun open-calendar-all () - (interactive) - (cfw:open-calendar-buffer - :contents-sources - (list - (cfw:org-create-source "Green") ; org-agenda source - (cfw:ical-create-source "Personal" "~/.calendar/nextcloud/personal.ics" "Red") - (cfw:ical-create-source "Birthdays" "~/.calendar/nextcloud/contact_birthdays.ics" "Grey") - ))) - -;; Org-mode settings -(after! org - (setq org-agenda-sticky t) - (setq org-agenda-files '("~/Org/")) - (setq org-agenda-prefix-format - '((agenda . " %i %t %s") - (todo . " %i") - (tags . " %i") - (search . " %i")))) - -;; Set org-roam capture templates -(after! org-roam - (setq org-roam-capture-templates - '(("d" "default" plain "%?" - :target (file+head "${slug}.org" "#+title: ${title}\n"))))) - -;; VTERM settings -(after! vterm - (setq vterm-tramp-shells - '(("ssh" "/usr/bin/env bash") - ("sshx" "/usr/bin/env bash")))) - -;; Apheleia settings -(after! apheleia - (setq apheleia-remote-algorithm 'local)) - -;; TRAMP host specific configs -(after! tramp - (setq tramp-default-method "sshx" - tramp-default-remote-shell "/bin/sh" - tramp-remote-path '(tramp-own-remote-path tramp-default-remote-path))) diff --git a/home/emacs/doom/custom.el b/home/emacs/doom/custom.el deleted file mode 100644 index 87bac1d3..00000000 --- a/home/emacs/doom/custom.el +++ /dev/null @@ -1,12 +0,0 @@ -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(auth-source-save-behavior nil)) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(ts-fold-replacement-face ((t (:foreground unspecified :box nil :inherit font-lock-comment-face :weight light))))) diff --git a/home/emacs/doom/directory-files-recursive.el b/home/emacs/doom/directory-files-recursive.el deleted file mode 100644 index c748608b..00000000 --- a/home/emacs/doom/directory-files-recursive.el +++ /dev/null @@ -1,49 +0,0 @@ -;;; -;;; Recursively list files in a given directory -;;; -;;; Author: daniel m german dmg at uvic dot ca -;;; Copyright: daniel m german -;;; License: Same as Emacs -;;; -(defun directory-files-recursive (directory match maxdepth ignore) - "List files in DIRECTORY and in its sub-directories. - Return files that match the regular expression MATCH but ignore - files and directories that match IGNORE (IGNORE is tested before MATCH. - Recurse only to depth MAXDEPTH. If zero or negative, then do not recurse" - (let* ((files-list '()) - (current-directory-list - (directory-files directory t))) - ;; while we are in the current directory - (while current-directory-list - (let ((f (car current-directory-list))) - (cond - ((and - ignore ;; make sure it is not nil - (string-match ignore f)) - ; ignore - nil - ) - ((and - (file-regular-p f) - (file-readable-p f) - (string-match match f)) - (setq files-list (cons f files-list)) - ) - ((and - (file-directory-p f) - (file-readable-p f) - (not (string-equal ".." (substring f -2))) - (not (string-equal "." (substring f -1))) - (> maxdepth 0)) - ;; recurse only if necessary - (setq files-list (append files-list (directory-files-recursive f match (- maxdepth -1) ignore))) - (setq files-list (cons f files-list)) - ) - (t) - ) - ) - (setq current-directory-list (cdr current-directory-list)) - ) - files-list - ) - ) diff --git a/home/emacs/doom/init.el b/home/emacs/doom/init.el deleted file mode 100644 index 4d4b6739..00000000 --- a/home/emacs/doom/init.el +++ /dev/null @@ -1,154 +0,0 @@ -;;; init.el -*- lexical-binding: t; -*- - -;; This file controls what Doom modules are enabled and what order they load -;; in. Remember to run 'doom sync' after modifying it! - -;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's -;; documentation. There you'll find a "Module Index" link where you'll find -;; a comprehensive list of Doom's modules and what flags they support. - -;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or -;; 'C-c c k' for non-vim users) to view its documentation. This works on -;; flags as well (those symbols that start with a plus). -;; -;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its -;; directory (for easy access to its source code). - -;;; Code: -(doom! :completion - company ; the ultimate code completion backend - (vertico +icons) ; the search engine of the future - - :ui - doom ; what makes DOOM look the way it does - doom-dashboard ; a nifty splash screen for Emacs - doom-quit ; DOOM quit-message prompts when you quit Emacs - ;; (emoji +github) ; 🙂 - hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW - indent-guides ; highlighted indent columns - ligatures ; ligatures and symbols to make your code pretty again - modeline ; snazzy, Atom-inspired modeline, plus API - (popup +defaults) ; tame sudden yet inevitable temporary windows - treemacs ; a project drawer, like neotree but cooler - ;; unicode ; extended unicode support for various languages - vc-gutter ; vcs diff in the fringe - window-select ; visually switch windows - workspaces ; tab emulation, persistence & separate workspaces - zen ; distraction-free coding or writing - - :editor - ;; (evil +everywhere) ; come to the dark side, we have cookies - file-templates ; auto-snippets for empty files - fold ; (nigh) universal code folding - (format +onsave) ; automated prettiness - snippets ; my elves. They type so I don't have to - word-wrap ; soft wrapping with language-aware indent - - :emacs - (dired +icons) ; making dired pretty [functional] - electric ; smarter, keyword-based electric-indent - (ibuffer +icons) ; interactive buffer management - undo ; persistent, smarter undo for your inevitable mistakes - vc ; version-control and Emacs, sitting in a tree - - :term - eshell ; the elisp shell that works everywhere - vterm ; the best terminal emulation in Emacs - - :checkers - syntax ; tasing you for every semicolon you forget - (spell +flyspell) ; tasing you for misspelling mispelling - grammar ; tasing grammar mistake every you make - - :tools - biblio ; Writes a PhD for you (citation needed) - direnv - (docker +lsp) - (eval +overlay) ; run code, run (also, repls) - (lookup +dictionary +offline) ; navigate your code and its documentation - (lsp +eglot) ; M-x vscode - magit ; a git porcelain for Emacs - make ; run make tasks from Emacs - (pass +auth) ; password manager for nerds - pdf ; pdf enhancements - tree-sitter ; Better syntax highlighting - upload ; map local to remote projects via ssh/ftp - - :os - (:if IS-MAC macos) ; improve compatibility with macOS - tty ; improve the terminal Emacs experience - - :lang - ;; agda ; types of types of types of types... - ;; beancount ; mind the GAAP - ;; cc ; C > C++ == 1 - ;; clojure ; java with a lisp - ;; common-lisp ; if you've seen one lisp, you've seen them all - ;; coq ; proofs-as-programs - ;; crystal ; ruby at the speed of c - ;; csharp ; unity, .NET, and mono shenanigans - data ; config/data formats - ;; (dart +flutter) ; paint ui and not much else - ;; dhall - ;; elixir ; erlang done right - ;; elm ; care for a cup of TEA? - emacs-lisp ; drown in parentheses - ;; erlang ; an elegant language for a more civilized age - ;; ess ; emacs speaks statistics - ;; factor - ;; faust ; dsp, but you get to keep your soul - (fortran +lsp) ; in FORTRAN, GOD is REAL (unless declared INTEGER) - ;; fsharp ; ML stands for Microsoft's Language - ;; fstar ; (dependent) types and (monadic) effects and Z3 - ;; gdscript ; the language you waited for - ;; (go +lsp) ; the hipster dialect - ;; (haskell +lsp) ; a language that's lazier than I am - ;; hy ; readability of scheme w/ speed of python - ;; idris ; a language you can depend on - ;; json ; At least it ain't XML - ;; (java +meghanada) ; the poster child for carpal tunnel syndrome - ;; javascript ; all(hope(abandon(ye(who(enter(here)))))) - ;; julia ; a better, faster MATLAB - ;; kotlin ; a better, slicker Java(Script) - (latex +lsp) ; writing papers in Emacs has never been so fun - ;; lean ; for folks with too much to prove - ;; ledger ; be audit you can be - (lua +lsp +tree-sitter) ; one-based indices? one-based indices - markdown ; writing docs for people to ignore - ;; nim ; python + lisp at the speed of c - (nix +lsp +tree-sitter) ; I hereby declare "nix geht mehr!" - ;; ocaml ; an objective camel - (org +roam2 +noter +pretty +present +pandoc) ; organize your plain life in plain text - ;; php ; perl's insecure younger brother - ;; plantuml ; diagrams for confusing people more - ;; purescript ; javascript, but functional - (python +lsp +tree-sitter +pyright +cython) ; beautiful is better than ugly - ;; qt ; the 'cutest' gui framework ever - ;; racket ; a DSL for DSLs - ;; raku ; the artist formerly known as perl6 - ;; rest ; Emacs as a REST client - ;; rst ; ReST in peace - ;; (ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} - (rust +lsp +tree-sitter) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() - ;; scala ; java, but good - ;; (scheme +guile) ; a fully conniving family of lisps - (sh +lsp +tree-sitter) ; she sells {ba,z,fi}sh shells on the C xor - ;; sml - ;; solidity ; do you need a blockchain? No. - ;; swift ; who asked for emoji variables? - ;; terra ; Earth and Moon in alignment for performance. - (web +lsp +tree-sitter) ; the tubes - (yaml +lsp +tree-sitter) ; JSON, but readable - ;; zig ; C, but simpler - - :email - (mu4e +org +gmail) - - :app - calendar - emms - (rss +org) - ;; irc ; how neckbeards socialize - - :config - (default +bindings +smartparens)) diff --git a/home/emacs/doom/packages.el b/home/emacs/doom/packages.el deleted file mode 100644 index dbc23b1c..00000000 --- a/home/emacs/doom/packages.el +++ /dev/null @@ -1,10 +0,0 @@ -;; -*- no-byte-compile: t; -*- -;;; $DOOMDIR/packages.el - -(package! pdf-tools - :built-in 'prefer) -(package! pocket-reader) -(package! elfeed-tube) -(package! mpv) -(package! ntfy - :recipe (:host sourcehut :repo "shom/ntfy")) diff --git a/home/emacs/init.el b/home/emacs/init.el deleted file mode 100644 index 8ba57f17..00000000 --- a/home/emacs/init.el +++ /dev/null @@ -1,57 +0,0 @@ -;;; 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. -(setq custom-file (locate-user-emacs-file "custom.el")) -(when (and custom-file (file-exists-p custom-file)) - (load custom-file nil 'nomessage)) - -;; Setup package-archives and priorities -(when (require 'package nil :noerror) - (add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/")) - (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) - - (setq package-archive-priorities '(("gnu" . 99) - ("nongnu" . 80) - ("stable" . 70) - ("melpa" . 0)))) - -;; 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)) - -;;; Configuration phase - -(setq user-full-name "Evie Litherland-Smith" - user-mail-address "evie@xenia.me.uk") - -;; Set default coding system (especially for Windows) -(set-default-coding-systems 'utf-8) -(set-terminal-coding-system 'utf-8) -(set-keyboard-coding-system 'utf-8) - -(require 'custom-defaults-config) -(pcase system-type ('gnu/linux (require 'custom-ui-config))) - -(require 'custom-email-config) -(require 'custom-feed-config) -(require 'custom-ide-config) -(require 'custom-ligatures-config) -(require 'custom-media-config) -(require 'custom-org-config) -(require 'custom-project-config) -(require 'custom-social-config) - -(require 'crafted-completion-config) -(require 'crafted-ide-config) -(require 'crafted-org-config) -(require 'crafted-workspaces-config) -(require 'crafted-writing-config) diff --git a/home/emacs/modules/custom-defaults-config.el b/home/emacs/modules/custom-defaults-config.el deleted file mode 100644 index 672a79f9..00000000 --- a/home/emacs/modules/custom-defaults-config.el +++ /dev/null @@ -1,40 +0,0 @@ -;;; custom-defaults-config.el -*- lexical-binding: t; -*- - -;;; Code: -(setq load-prefer-newer t - indent-tabs-mode nil - global-auto-revert-non-file-buffers t - dired-auto-revert-buffer t - dired-dwim-target t - tab-always-indent 'complete - completion-cycle-threshold 3 - completions-detailed t - xref-show-definitions-function #'xref-show-definitions-completing-read - kill-do-not-save-duplicates t - auto-window-vscroll nil - fast-but-imprecise-scrolling t - scroll-conservatively 101 - scroll-margin 0 - scroll-preserve-screen-position 1) - -(global-auto-revert-mode +1) -(delete-selection-mode) - -;; Misc useful keymaps -(keymap-global-set "M-#" #'dictionary-lookup-definition) -(keymap-global-set "C-c r" #'recentf) -(keymap-global-set "C-c b" #'ibuffer) -(keymap-global-set "C-c p l" #'list-packages) -(keymap-global-set "C-c p r" #'package-refresh-contents) -(keymap-global-set "C-c p i" #'package-install) -(keymap-global-set "C-c p d" #'package-delete) - -;; turn on spell checking, if available. -(when (and (require 'ispell nil :noerror) (executable-find ispell-program-name)) - (add-hook 'text-mode-hook #'flyspell-mode) - (add-hook 'prog-mode-hook #'flyspell-prog-mode)) - -;; Make shebang (#!) file executable when saved -(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p) - -(provide 'custom-defaults-config) diff --git a/home/emacs/modules/custom-email-config.el b/home/emacs/modules/custom-email-config.el deleted file mode 100644 index b517740c..00000000 --- a/home/emacs/modules/custom-email-config.el +++ /dev/null @@ -1,70 +0,0 @@ -(setq 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 - message-kill-buffer-on-exit t - mail-user-agent 'mu4e-user-agent - read-mail-command 'mu4e - mu4e-maildir "~/Mail" - mu4e-attachment-dir "~/Downloads" - mu4e-get-mail-command "mbsync -a" - mu4e-update-interval (* 5 60) ; Every 5 minutes - mu4e-sent-messages-behavior 'sent - mu4e-change-filenames-when-moving t - mu4e-context-policy 'pick-first - mu4e-headers-fields '((:human-date . 12) - (:flags . 6) - (:from-or-to . 25) - (:subject)) - mu4e-headers-actions '(("org capture message" . mu4e-org-store-and-capture) - ("capture message" . mu4e-action-capture-message) - ("show this thread" . mu4e-action-show-thread)) - mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p) - (:maildir "/iCloud/Inbox/" :key ?i) - (:maildir "/Outlook/Inbox/" :key ?w))) - -(when (require 'mu4e nil :noerror) - (keymap-global-set "C-c m m" #'mu4e) - (keymap-global-set "C-c m u" #'mu4e-update-index) - (keymap-global-set "C-c m c" #'mu4e-compose-new) - - (when (require 'mu4e-alert nil :noerror) - (mu4e-alert-set-default-style 'libnotify) - (mu4e-alert-enable-notifications) - (mu4e-alert-enable-mode-line-display)) - - (setq mu4e-contexts (list - (make-mu4e-context - :name "Xenia" - :vars '((user-mail-address . "evie@xenia.me.uk") - (mu4e-sent-folder . "/Proton/Sent") - (mu4e-drafts-folder . "/Proton/Drafts") - (mu4e-trash-folder . "/Proton/Trash") - (mu4e-refile-folder . "/Proton/Archive"))) - (make-mu4e-context - :name "Proton" - :match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) - :vars '((user-mail-address . "e.litherlandsmith@proton.me") - (mu4e-sent-folder . "/Proton/Sent") - (mu4e-drafts-folder . "/Proton/Drafts") - (mu4e-trash-folder . "/Proton/Trash") - (mu4e-refile-folder . "/Proton/Archive"))) - (make-mu4e-context - :name "iCloud" - :match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir)))) - :vars '((user-mail-address . "e.litherlandsmith@icloud.com") - (mu4e-sent-folder . "/iCloud/Sent Messages") - (mu4e-drafts-folder . "/iCloud/Drafts") - (mu4e-trash-folder . "/iCloud/Deleted Messages") - (mu4e-refile-folder . "/iCloud/Archive"))) - (make-mu4e-context - :name "Work" - :match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) - :vars '((user-mail-address . "evie.litherland-smith@ukaea.uk") - (mu4e-sent-folder . "/Outlook/Sent") - (mu4e-drafts-folder . "/Outlook/Drafts") - (mu4e-trash-folder . "/Outlook/Trash") - (mu4e-refile-folder . "/Outlook/Archive")))))) - -(provide 'custom-email-config) diff --git a/home/emacs/modules/custom-feed-config.el b/home/emacs/modules/custom-feed-config.el deleted file mode 100644 index 6e13a512..00000000 --- a/home/emacs/modules/custom-feed-config.el +++ /dev/null @@ -1,14 +0,0 @@ -(let ((elfeed-base-directory "~/.elfeed")) - (setq elfeed-db-directory (expand-file-name "db" elfeed-base-directory) - elfeed-enclosure-default-dir (expand-file-name "enclosures" elfeed-base-directory) - rmh-elfeed-org-files (list (expand-file-name "feeds.org" elfeed-base-directory)))) - -(when (require 'elfeed nil :noerror) - (keymap-global-set "C-c f f" #'elfeed) - (add-hook 'elfeed-search-mode-hook #'elfeed-update) - (when (require 'elfeed-org nil :noerror) - (elfeed-org)) - (when (require 'elfeed-tube nil :noerror) - (elfeed-tube-setup))) - -(provide 'custom-feed-config) diff --git a/home/emacs/modules/custom-ide-config.el b/home/emacs/modules/custom-ide-config.el deleted file mode 100644 index 9a02f920..00000000 --- a/home/emacs/modules/custom-ide-config.el +++ /dev/null @@ -1,24 +0,0 @@ -(when (require 'rainbow-delimiters nil :noerror) - (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) - -(when (require 'treesit-aut nil :noerror) - (global-treesit-auto-mode +1)) - -(setq apheleia-remote-algorithm 'local) -(when (require 'apheleia nil :noerror) - (keymap-global-set "C-c c f" #'apheleia-format-buffer) - (apheleia-global-mode +1)) - -(when (require 'eglot nil :noerror) - (eglot-ensure)) - -(setq direnv-always-show-summary nil) -(when (require 'direnv nil :noerror) - (direnv-mode +1)) - -(when (require 'yasnippet nil :noerror) - (require 'yasnippet-snippets nil :noerror) - (yas-reload-all) - (add-hook 'prog-mode-hook #'yas-minor-mode)) - -(provide 'custom-ide-config) diff --git a/home/emacs/modules/custom-ligatures-config.el b/home/emacs/modules/custom-ligatures-config.el deleted file mode 100644 index 4b6ca4aa..00000000 --- a/home/emacs/modules/custom-ligatures-config.el +++ /dev/null @@ -1,60 +0,0 @@ -(defun fira-code-mode--make-alist (list) - "Generate prettify-symbols alist from LIST." - (let ((idx -1)) - (mapcar - (lambda (s) - (setq idx (1+ idx)) - (let* ((code (+ #Xe100 idx)) - (width (string-width s)) - (prefix ()) - (suffix '(?\s (Br . Br))) - (n 1)) - (while (< n width) - (setq prefix (append prefix '(?\s (Br . Bl)))) - (setq n (1+ n))) - (cons s (append prefix suffix (list (decode-char 'ucs code)))))) - list))) - -(defconst fira-code-mode--ligatures - '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\" - "{-" "[]" "::" ":::" ":=" "!!" "!=" "!==" "-}" - "--" "---" "-->" "->" "->>" "-<" "-<<" "-~" - "#{" "#[" "##" "###" "####" "#(" "#?" "#_" "#_(" - ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*" - "/**" "/=" "/==" "/>" "//" "///" "&&" "||" "||=" - "|=" "|>" "^=" "$>" "++" "+++" "+>" "=:=" "==" - "===" "==>" "=>" "=>>" "<=" "=<<" "=/=" ">-" ">=" - ">=>" ">>" ">>-" ">>=" ">>>" "<*" "<*>" "<|" "<|>" - "<$" "<$>" "