#+TITLE: Emacs Config #+AUTHOR: Evie Litherland-Smith #+EMAIL: evie@xenia.me.uk #+FILETAGS: :emacs:config:org: #+PROPERTY: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * Common defaults #+BEGIN_SRC emacs-lisp :results output silent (setq custom-file (locate-user-emacs-file "custom.el")) (when (and custom-file (file-exists-p custom-file)) (load custom-file nil 'nomessage)) (setq user-full-name "Evie Litherland-Smith" user-mail-address "evie@xenia.me.uk" use-short-answers t 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) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (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) #+END_SRC ** package-archive with priorities #+begin_src emacs-lisp :results output silent (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)))) #+end_src ** Authentication #+begin_src emacs-lisp (when (require 'auth-source nil :noerror) (setq auth-sources '("secrets:Login")) (auth-source-pass-enable)) #+end_src * UI ** Font ligatures #+begin_src emacs-lisp (use-package ligature :ensure t :config ;; Enable the "www" ligature in every possible major mode (ligature-set-ligatures 't '("www")) ;; Enable traditional ligature support in eww-mode, if the ;; `variable-pitch' face supports it (ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi")) ;; Enable all Cascadia and Fira Code ligatures in programming modes (ligature-set-ligatures 'prog-mode '(;; == === ==== => =| =>>=>=|=>==>> ==< =/=//=// =~ ;; =:= =!= ("=" (rx (+ (or ">" "<" "|" "/" "~" ":" "!" "=")))) ;; ;; ;;; (";" (rx (+ ";"))) ;; && &&& ("&" (rx (+ "&"))) ;; !! !!! !. !: !!. != !== !~ ("!" (rx (+ (or "=" "!" "\." ":" "~")))) ;; ?? ??? ?: ?= ?. ("?" (rx (or ":" "=" "\." (+ "?")))) ;; %% %%% ("%" (rx (+ "%"))) ;; |> ||> |||> ||||> |] |} || ||| |-> ||-|| ;; |->>-||-<<-| |- |== ||=|| ;; |==>>==<<==<=>==//==/=!==:===> ("|" (rx (+ (or ">" "<" "|" "/" ":" "!" "}" "\]" "-" "=" )))) ;; \\ \\\ \/ ("\\" (rx (or "/" (+ "\\")))) ;; ++ +++ ++++ +> ("+" (rx (or ">" (+ "+")))) ;; :: ::: :::: :> :< := :// ::= (":" (rx (or ">" "<" "=" "//" ":=" (+ ":")))) ;; // /// //// /\ /* /> /===:===!=//===>>==>==/ ("/" (rx (+ (or ">" "<" "|" "/" "\\" "\*" ":" "!" "=")))) ;; .. ... .... .= .- .? ..= ..< ("\." (rx (or "=" "-" "\?" "\.=" "\.<" (+ "\.")))) ;; -- --- ---- -~ -> ->> -| -|->-->>->--<<-| ("-" (rx (+ (or ">" "<" "|" "~" "-")))) ;; *> */ *) ** *** **** ("*" (rx (or ">" "/" ")" (+ "*")))) ;; www wwww ("w" (rx (+ "w"))) ;; <> " "->" "->>" "-<" "-<<" "-~" "#{" "#[" "##" "###" "####" "#(" "#?" "#_" "#_(" ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*" "/**" "/=" "/==" "/>" "//" "///" "&&" "||" "||=" "|=" "|>" "^=" "$>" "++" "+++" "+>" "=:=" "==" "===" "==>" "=>" "=>>" "<=" "=<<" "=/=" ">-" ">=" ">=>" ">>" ">>-" ">>=" ">>>" "<*" "<*>" "<|" "<|>" "<$" "<$>" "