Compare commits
10 commits
77af14bed0
...
f4f40e4f8d
Author | SHA1 | Date | |
---|---|---|---|
Evie Litherland-Smith | f4f40e4f8d | ||
Evie Litherland-Smith | 9bb373a8af | ||
Evie Litherland-Smith | dd418f89c0 | ||
Evie Litherland-Smith | e9ef824138 | ||
Evie Litherland-Smith | 6b24003919 | ||
Evie Litherland-Smith | df84dc2a31 | ||
Evie Litherland-Smith | ec3cbbb111 | ||
Evie Litherland-Smith | 877f896ef5 | ||
Evie Litherland-Smith | 4f60cda7ba | ||
Evie Litherland-Smith | 41be433044 |
97
README.org
97
README.org
|
@ -1,6 +1,7 @@
|
|||
#+title: Emacs Config
|
||||
#+author: Evie Litherland-Smith
|
||||
#+email: evie@xenia.me.uk
|
||||
#+startup: content
|
||||
#+property: header-args:emacs-lisp :results silent
|
||||
Personal Emacs configuration. Clone to =~/.config/emacs/= (or
|
||||
=~/.emacs.d/=) and install specified plugins using [[file:install.el][the install script]].
|
||||
|
@ -69,6 +70,17 @@ Bind mouse keys to expected movement commands
|
|||
(keymap-global-set "<mouse-8>" #'previous-buffer)
|
||||
(keymap-global-set "<mouse-9>" #'next-buffer)
|
||||
#+end_src
|
||||
|
||||
Set custom location for backups
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq backup-directory-alist '(("." . "~/.local/state/emacs/backups")))
|
||||
#+end_src
|
||||
|
||||
** Secrets
|
||||
#+begin_src emacs-lisp
|
||||
(use-package secrets)
|
||||
#+end_src
|
||||
** UI and Appearance
|
||||
Configure the look and feel of Emacs
|
||||
|
||||
|
@ -127,7 +139,12 @@ Configure the look and feel of Emacs
|
|||
(plist-get base16-current-theme-colors :base01))
|
||||
;; Set `org-hide' face to actually match background colour
|
||||
(set-face-attribute 'org-hide nil :foreground
|
||||
(plist-get base16-current-theme-colors :base00)))
|
||||
(plist-get base16-current-theme-colors :base00))
|
||||
(with-eval-after-load 'org-noter
|
||||
(set-face-attribute 'org-noter-no-notes-exist-face nil :foreground
|
||||
(plist-get base16-current-theme-colors :base08))
|
||||
(set-face-attribute 'org-noter-notes-exist-face nil :foreground
|
||||
(plist-get base16-current-theme-colors :base0B))))
|
||||
|
||||
(require 'server)
|
||||
(add-hook 'after-init-hook
|
||||
|
@ -175,7 +192,7 @@ Configure the look and feel of Emacs
|
|||
(add-to-list 'package-selected-packages 'visual-fill-column)
|
||||
(use-package visual-fill-column
|
||||
:if (package-installed-p 'visual-fill-column)
|
||||
:hook (((org-src-mode org-agenda-mode) . (lambda () (visual-fill-column-mode +1)))
|
||||
:hook (((dired-mode org-src-mode org-agenda-mode) . (lambda () (visual-fill-column-mode +1)))
|
||||
((doc-view-mode image-mode) . (lambda () (visual-fill-column-mode -1))))
|
||||
:custom
|
||||
(visual-fill-column-width 160)
|
||||
|
@ -194,14 +211,11 @@ Configure the look and feel of Emacs
|
|||
:config
|
||||
(ligature-set-ligatures
|
||||
'(text-mode prog-mode org-mode)
|
||||
'("<---" "<--" "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->" "<---->" "<!--"
|
||||
"<==" "<===" "<<=" "<=" "=>" "=>>" "==>" "===>" ">=" "<=>" "<==>" "<===>" "<====>" "<!---"
|
||||
"<~~" "<~" "~>" "~~>" "::" ":::" "==" "!=" "===" "!=="
|
||||
":=" ":-" ":+" "<*" "<*>" "*>" "<|" "<|>" "|>" "+:" "-:" "=:" "<******>" "++" "+++"
|
||||
"<:" "*=" "*+" "<." "<.>" ".>" "+*" "=*" ":>"
|
||||
"(*" "*)" "/*" "*/" "[|" "|]" "{|" "|}" "|-" "-|"))
|
||||
(ligature-set-ligatures 'markdown-mode '(("=" (rx (+ "=") (? (| ">" "<"))))
|
||||
("-" (rx (+ "-")))))
|
||||
'(("<" (rx (= 1 "=")))
|
||||
(">" (rx (= 1 "=")))
|
||||
("-" (rx (* "-") (= 1 ">")))
|
||||
("=" (rx (* "=") (? ">")))
|
||||
("!" (rx (+ "=")))))
|
||||
(global-ligature-mode +1))
|
||||
#+end_src
|
||||
*** Font Showcase
|
||||
|
@ -349,7 +363,7 @@ Rules and packages for buffer management and window navigation.
|
|||
(khalel-add-capture-template)
|
||||
:custom
|
||||
(khalel-default-alarm "10")
|
||||
(khalel-default-calendar "calendar")
|
||||
(khalel-default-calendar nil)
|
||||
(khalel-import-org-file (expand-file-name "calendar/khal.org" org-directory))
|
||||
(khalel-import-org-file-read-only nil)
|
||||
(khalel-import-org-file-confirm-overwrite nil)
|
||||
|
@ -449,6 +463,7 @@ Configure email with iCalendar event support, to integrate with
|
|||
:match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
|
||||
:vars '(
|
||||
(user-mail-address . "e.litherlandsmith@proton.me")
|
||||
(khalel-default-calendar . "personal")
|
||||
(mu4e-sent-folder . "/Proton/Sent")
|
||||
(mu4e-trash-folder . "/Proton/Trash")
|
||||
(mu4e-refile-folder . "/Proton/Archive")
|
||||
|
@ -461,6 +476,7 @@ Configure email with iCalendar event support, to integrate with
|
|||
:match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir))))
|
||||
:vars '(
|
||||
(user-mail-address . "e.litherlandsmith@icloud.com")
|
||||
(khalel-default-calendar . "other")
|
||||
(mu4e-sent-folder . "/iCloud/Sent Messages")
|
||||
(mu4e-trash-folder . "/iCloud/Deleted Messages")
|
||||
(mu4e-refile-folder . "/iCloud/Archive")
|
||||
|
@ -473,6 +489,7 @@ Configure email with iCalendar event support, to integrate with
|
|||
:match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
|
||||
:vars '(
|
||||
(user-mail-address . "evie.litherland-smith@ukaea.uk")
|
||||
(khalel-default-calendar . "work")
|
||||
(mu4e-sent-folder . "/Outlook/Sent")
|
||||
(mu4e-trash-folder . "/Outlook/Trash")
|
||||
(mu4e-refile-folder . "/Outlook/Archive")
|
||||
|
@ -639,6 +656,22 @@ Configure email with iCalendar event support, to integrate with
|
|||
(setq mu4e-notification-support t))
|
||||
#+end_src
|
||||
*** IRC
|
||||
#+begin_src emacs-lisp
|
||||
(use-package erc
|
||||
:commands erc-compute-nick
|
||||
:custom
|
||||
(erc-nick (user-login-name))
|
||||
(erc-user-full-name (user-full-name)))
|
||||
|
||||
(defun my/libera-chat-connect ()
|
||||
"Connect to irc.libera.chat directly."
|
||||
(interactive)
|
||||
(require 'erc)
|
||||
(require 'secrets)
|
||||
(erc-tls
|
||||
:server "irc.libera.chat"
|
||||
:password (secrets-get-secret "default" "IRC libera.chat")))
|
||||
#+end_src
|
||||
** Other
|
||||
** Initial copy from =init.el=
|
||||
#+begin_src emacs-lisp
|
||||
|
@ -652,12 +685,6 @@ Configure email with iCalendar event support, to integrate with
|
|||
(mouse-wheel-progressive-speed nil)
|
||||
(mouse-wheel-follow-mouse t))
|
||||
|
||||
;; Function for calling `gsync'
|
||||
(defun my/gsync ()
|
||||
"Run shell command `gsync' asynchronously."
|
||||
(interactive)
|
||||
(async-shell-command "gsync" "*gsync*" "*git-sync-errors*"))
|
||||
|
||||
;; Make shebang (#!) file executable when saved
|
||||
(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)
|
||||
|
||||
|
@ -665,8 +692,6 @@ Configure email with iCalendar event support, to integrate with
|
|||
(keymap-global-set "<remap> <upcase-word>" 'upcase-dwim)
|
||||
(keymap-global-set "<remap> <downcase-word>" 'downcase-dwim)
|
||||
|
||||
(setq backup-directory-alist '(("." . "~/.local/state/emacs/backups")))
|
||||
|
||||
(use-package savehist
|
||||
:demand
|
||||
:config
|
||||
|
@ -1000,6 +1025,7 @@ Configure email with iCalendar event support, to integrate with
|
|||
(org-icalendar-combined-name "org-mode")
|
||||
(org-icalendar-combined-description "Emacs org-mode combined export"))
|
||||
|
||||
(add-to-list 'package-selected-packages 'org-noter)
|
||||
(use-package org-noter
|
||||
:if (package-installed-p 'org-noter)
|
||||
:disabled t
|
||||
|
@ -1009,7 +1035,7 @@ Configure email with iCalendar event support, to integrate with
|
|||
(org-noter-always-create-frame nil)
|
||||
(org-noter-kill-frame-at-session-end nil)
|
||||
(org-noter-auto-save-last-location t)
|
||||
(org-noter-default-notes-file-names '("noter.org"))
|
||||
(org-noter-default-notes-file-names '("notes.org"))
|
||||
(org-noter-doc-property-in-notes t)
|
||||
(org-noter-notes-search-path
|
||||
(list (expand-file-name "notes" org-directory)
|
||||
|
@ -1576,31 +1602,6 @@ Configure email with iCalendar event support, to integrate with
|
|||
:custom
|
||||
(bbdb-file (locate-user-emacs-file "bbdb.gpg")))
|
||||
|
||||
(use-package erc
|
||||
:commands erc-compute-nick
|
||||
:custom
|
||||
(erc-nick (user-login-name))
|
||||
(erc-user-full-name (user-full-name)))
|
||||
|
||||
(defun my/libera-chat-connect ()
|
||||
"Connect to irc.libera.chat directly."
|
||||
(interactive)
|
||||
(require 'erc)
|
||||
(require 'password-store)
|
||||
(erc-tls
|
||||
:server "irc.libera.chat"
|
||||
:password (password-store-get 'social/irc.libera.chat)))
|
||||
(defun my/znc-connect ()
|
||||
"Connect to my ZNC IRC bouncer."
|
||||
(interactive)
|
||||
(require 'erc)
|
||||
(require 'password-store)
|
||||
(erc-tls
|
||||
:server "xenia.me.uk"
|
||||
:port 6697
|
||||
:nick (concat (erc-compute-nick) "/liberachat")
|
||||
:password (password-store-get 'local/znc)))
|
||||
|
||||
(use-package eww
|
||||
:defer t
|
||||
:custom
|
||||
|
@ -1611,12 +1612,6 @@ Configure email with iCalendar event support, to integrate with
|
|||
(eww-auto-rename-buffer 'title)
|
||||
(eww-browse-url-new-window-is-tab nil))
|
||||
|
||||
(add-to-list 'package-selected-packages 'password-store)
|
||||
(use-package password-store
|
||||
:if (package-installed-p 'password-store)
|
||||
:defer t
|
||||
:functions password-store-get)
|
||||
|
||||
(add-to-list 'package-selected-packages 'scad-mode)
|
||||
(use-package scad-mode
|
||||
:if (package-installed-p 'scad-mode)
|
||||
|
|
100
templates
100
templates
|
@ -154,7 +154,6 @@ nix-mode
|
|||
> " '';")
|
||||
|
||||
(pkgs "pkgs = import " (p "<nixpkgs>") " {};")
|
||||
(poetry2nix "poetry2nix = (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};")
|
||||
|
||||
(gitpackage "{ lib" n ", stdenv" n ", fetchFromGitHub" n ", " (p "inputs") n ", " (p "inputs") n "}:" n n>
|
||||
"stdenv.mkDerivation rec {" n> "pname = \"" (p "" pkgn nil) "\";" n> "version = \"" p "\";" n n>
|
||||
|
@ -169,25 +168,33 @@ nix-mode
|
|||
"platforms = platforms."
|
||||
(p (completing-read "Platform: " '("all" "allBut" "arm" "cygwin" "darwin" "freebsd" "gnu" "i686" "illumos" "linux" "mesaPlatforms" "mips" "netbsd" "none" "openbsd" "unix" "x86"))) ";" n> q "};" n> "}"
|
||||
)
|
||||
(pythonshell "let" n
|
||||
> "pkgs = import " (p "<nixpkgs>") " {};" n
|
||||
> "python = pkgs." (p "python3") ";" n
|
||||
> "in pkgs.mkShell {" n
|
||||
> "packages = with pkgs; [ poetry uv " q "];" n
|
||||
> "shellHook = ''" n
|
||||
> "export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.libz}/lib" n
|
||||
> "${pkgs.poetry}/bin/poetry env use ${python}/bin/python3" n
|
||||
> "'';" n
|
||||
> "}")
|
||||
|
||||
(poetryoverride "overrides = poetry2nix.defaultPoetryOverrides.extend" n
|
||||
> "(self: super: {" n
|
||||
> (s package) " =" n
|
||||
> "super." package ".overridePythonAttrs" n
|
||||
> "(old: {" n
|
||||
> "buildInputs = (old.buildInputs or []) ++ [super." (p "setuptools" ) "];" n
|
||||
> "});" n
|
||||
> "});" q)
|
||||
(pyderivation "{ buildPythonPackage, " (p "poetry-core" build) ", " (p "" dependencies) "}:" n
|
||||
"buildPythonPackage {" n
|
||||
> "pname = \"" (p "package") "\";" n
|
||||
> "version = \"" (p "0.1.0") "\";" n
|
||||
> "src = ./.;" n
|
||||
> "build-system = [ " (s build)" ];" n
|
||||
> "dependencies = [ " (string-replace "," "" dependencies) " ];" n
|
||||
> "}")
|
||||
(pydefault "let" n
|
||||
> "pkgs = import " (p "<nixpkgs>") " { };" n
|
||||
> "python3 = pkgs." (p "python3.override { packageOverrides = final: prev: {}; }") ";" n
|
||||
"in" n
|
||||
> "python3.pkgs.callPackage ./derivation.nix {" q "}")
|
||||
(pyshell "let" n
|
||||
> "pkgs = import " (p "<nixpkgs>") " {};" n
|
||||
> "python3 = pkgs." (p "python3") ";" n
|
||||
> "in pkgs.mkShellNoCC {" n
|
||||
> "packages = [" n
|
||||
> "(python3.withPackages(" n
|
||||
> "ps: with ps; ["n
|
||||
> (p "tkinter") n
|
||||
> q n
|
||||
> "]" n
|
||||
> "))" n
|
||||
> "];" n
|
||||
> "}")
|
||||
|
||||
python-base-mode
|
||||
|
||||
|
@ -202,49 +209,22 @@ python-base-mode
|
|||
(logg "logger = logging.getLogger(__name__)")
|
||||
(nimp "raise NotImplementedError")
|
||||
|
||||
nix-mode
|
||||
|
||||
(pkgs "pkgs = import " (p "<nixpkgs>") " {};")
|
||||
(poetry2nix "poetry2nix = (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};")
|
||||
(pyshell "let" n
|
||||
> "pkgs = import " (p "<nixpkgs>") " {};" n
|
||||
> "in pkgs.mkShellNoCC {" n
|
||||
> "packages = with pkgs; [" n
|
||||
> "poetry" n
|
||||
> (p "python3Full") n
|
||||
> q n
|
||||
> "];" n
|
||||
> "shellHook = ''" n
|
||||
> "export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.zlib}/lib" n
|
||||
> "'';" n
|
||||
> "}")
|
||||
(pyderivation "{ buildPythonPackage, " (p "poetry-core" build) ", " (p "" dependencies) "}:" n
|
||||
"buildPythonPackage {" n
|
||||
> "pname = \"" (p "package") "\";" n
|
||||
> "version = \"" (p "0.1.0") "\";" n
|
||||
> "src = ./.;" n
|
||||
> "build-system = [ " (s build)" ];" n
|
||||
> "dependencies = [ " (string-replace "," "" dependencies) " ];" n
|
||||
> "}")
|
||||
(pydefault "let" n
|
||||
> "pkgs = import " (p "<nixpkgs>") " { };" n
|
||||
> "python3 = " (p "pkgs.python3") ";" n
|
||||
"in" n
|
||||
> "python3.pkgs.callPackage ./derivation.nix {" q "}")
|
||||
|
||||
envrc-file-mode
|
||||
|
||||
(python "CC=\"$(nix build nixpkgs#stdenv.cc.cc.lib --print-out-paths --no-link)\"" n
|
||||
"ZLIB=\"$(nix build nixpkgs#zlib --print-out-paths --no-link)\"" n
|
||||
"PYTHON=\"$(nix build " (p "nixpkgs#python3Full") " --print-out-paths --no-link)/bin/python3\"" n
|
||||
"VENV_DIR=" (p ".venv") n
|
||||
"export LD_LIBRARY_PATH=\"$CC/lib\":\"$ZLIB/lib\"" n
|
||||
"if [ ! -f $VENV_DIR/bin/activate ]; then" n
|
||||
> "$PYTHON -m venv --clear $VENV_DIR" n
|
||||
"else" n
|
||||
> "$PYTHON -m venv --upgrade $VENV_DIR" n
|
||||
"fi" n
|
||||
"source $VENV_DIR/bin/activate")
|
||||
;; (python "CC=\"$(nix build nixpkgs#stdenv.cc.cc.lib --print-out-paths --no-link)\"" n
|
||||
;; "ZLIB=\"$(nix build nixpkgs#zlib --print-out-paths --no-link)\"" n
|
||||
;; "PYTHON=\"$(nix build " (p "nixpkgs#python3Full") " --print-out-paths --no-link)/bin/python3\"" n
|
||||
;; "VENV_DIR=" (p ".venv") n
|
||||
;; "export LD_LIBRARY_PATH=\"$CC/lib\":\"$ZLIB/lib\"" n
|
||||
;; "if [ ! -f $VENV_DIR/bin/activate ]; then" n
|
||||
;; > "$PYTHON -m venv --clear $VENV_DIR" n
|
||||
;; "else" n
|
||||
;; > "$PYTHON -m venv --upgrade $VENV_DIR" n
|
||||
;; "fi" n
|
||||
;; "source $VENV_DIR/bin/activate")
|
||||
(python "use nix" n
|
||||
"SRC=$(readlink -f " (p "./" ) ")" n
|
||||
"export PYTHONPATH=$SRC:" q "$PYTHONPATH")
|
||||
|
||||
;; Local Variables:
|
||||
;; mode: lisp-data
|
||||
|
|
Loading…
Reference in a new issue