The Stowification
This commit is contained in:
parent
9174eb19d0
commit
b6ef95b65c
11 changed files with 1 additions and 1669 deletions
|
@ -1,2 +0,0 @@
|
|||
(setq package-enable-at-startup nil)
|
||||
(setq package-install-upgrade-built-in t)
|
|
@ -1,874 +0,0 @@
|
|||
;;; init.el --- Description -*- lexical-binding: t; -*-
|
||||
;;
|
||||
;; Copyright (C) 2023 Daniel Ziltener
|
||||
;;
|
||||
;; Author: Daniel Ziltener <dziltener@lyrion.ch>
|
||||
;; Maintainer: Daniel Ziltener <dziltener@lyrion.ch>
|
||||
;; Created: November 13, 2023
|
||||
;; Modified: November 13, 2023
|
||||
;; Version: 0.0.1
|
||||
;; Keywords: abbrev bib c calendar comm convenience data docs
|
||||
;; emulations extensions faces files frames games hardware help
|
||||
;; hypermedia i18n internal languages lisp local maint mail matching
|
||||
;; mouse multimedia news outlines processes terminals tex tools unix
|
||||
;; vc wp
|
||||
;; Homepage: https://gitea.lyrion.ch/zilti/guixconfig
|
||||
;; Package-Requires: ((emacs "29.1"))
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Description
|
||||
;;
|
||||
;;; Code:
|
||||
;;;; Requirements
|
||||
;; Since I am using `cl-defun` in this init file, I need to require
|
||||
;; `cl-macs`.
|
||||
(require 'cl-macs)
|
||||
|
||||
;;;; Early Variables
|
||||
(setq custom-file "~/.config/emacs/custom.el")
|
||||
(when (file-exists-p custom-file)
|
||||
(load custom-file))
|
||||
|
||||
(defvar init-dir (file-name-directory (or load-file-name (buffer-file-name))))
|
||||
|
||||
;;;; Elpaca
|
||||
|
||||
;;;;; Installation
|
||||
|
||||
(defvar elpaca-installer-version 0.7)
|
||||
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
|
||||
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
||||
:ref nil :depth 1
|
||||
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
|
||||
:build (:not elpaca--activate-package)))
|
||||
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
|
||||
(build (expand-file-name "elpaca/" elpaca-builds-directory))
|
||||
(order (cdr elpaca-order))
|
||||
(default-directory repo))
|
||||
(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)
|
||||
(load "./elpaca-autoloads")))
|
||||
(add-hook 'after-init-hook #'elpaca-process-queues)
|
||||
(elpaca `(,@elpaca-order))
|
||||
|
||||
;; Use-Package Integration
|
||||
|
||||
(elpaca elpaca-use-package
|
||||
(elpaca-use-package-mode)
|
||||
(setq elpaca-use-package-by-default t))
|
||||
(elpaca-wait)
|
||||
|
||||
;;;; Personal Information Setup
|
||||
(setq user-full-name "Daniel Ziltener"
|
||||
user-mail-address "dziltener@lyrion.ch")
|
||||
|
||||
;; I use `pass` as password storage.
|
||||
(auth-source-pass-enable)
|
||||
|
||||
;;;; Package Management Configuration
|
||||
;; See: https://github.com/radian-software/el-patch
|
||||
(use-package el-patch)
|
||||
|
||||
;;;;; Guix Management
|
||||
(use-package guix
|
||||
:after magit-popup)
|
||||
|
||||
;;;; Helper Functions
|
||||
(cl-defun conditional-keybind
|
||||
(filter-fn target-fn
|
||||
&optional (fail-fn #'self-insert-command))
|
||||
"Creates a keybinding that checks `filter-fn`. If it succeeds,
|
||||
`target-fn` is run, otherwise `fail-fn`. If no fail-fn is given,
|
||||
`self-insert-command` is run instead.
|
||||
`target-fn` and `fail-fn` must both be interactive."
|
||||
(lambda (_prefix)
|
||||
(interactive "P")
|
||||
(if (funcall filter-fn)
|
||||
(call-interactively target-fn)
|
||||
(call-interactively fail-fn))))
|
||||
|
||||
;;;; Emacs
|
||||
(use-package emacs
|
||||
:ensure nil
|
||||
:after org
|
||||
:custom
|
||||
(completion-cycle-threshold 10)
|
||||
(display-time-mode t)
|
||||
(enable-recursive-minibuffers t)
|
||||
(enable-remote-dir-locals t)
|
||||
(fill-column 100)
|
||||
(global-hl-line-mode t)
|
||||
(global-prettify-symbols-mode t)
|
||||
(indent-tabs-mode nil)
|
||||
(menu-bar-mode nil)
|
||||
(minibuffer-prompt-properties (read-only t cursor-intangible t face minibuffer-prompt))
|
||||
(native-comp-async-report-warnings-errors nil)
|
||||
(read-extended-command-predicate #'command-completion-default-include-p)
|
||||
(recentf-mode t)
|
||||
(pixel-scroll-precision-large-scroll-height 30)
|
||||
(scroll-bar-mode nil)
|
||||
(tab-always-indent 'complete)
|
||||
(tool-bar-mode nil)
|
||||
(newsticker-url-list-defaults nil)
|
||||
(newsticker-url-list
|
||||
'(("Tagesschau" "https://www.tagesschau.de/index~atom.xml" nil nil nil)
|
||||
("NZZ Neuste" "https://www.nzz.ch/recent.rss" nil nil nil)
|
||||
("SRF News" "https://www.srf.ch/news/bnf/rss/1646" nil nil nil)
|
||||
("SRF Wissen" "https://www.srf.ch/bnf/rss/630" nil nil nil)
|
||||
("Deutschlandfunk Nachrichten" "https://www.deutschlandfunk.de/nachrichten-100.rss" nil nil nil)
|
||||
("Deutschlandfunk Wissen" "https://www.deutschlandfunk.de/wissen-106.rss" nil nil nil)
|
||||
("RBB" "https://www.rbb24.de/aktuell/index.xml/feed=rss.xml" nil nil nil)
|
||||
("Guix" "https://guix.gnu.org/feeds/blog.atom" nil nil nil)
|
||||
("Mastering Emacs" "https://www.masteringemacs.org/feed" nil nil nil)
|
||||
("Schiene.de" "https://www.schiene.de/feed/" nil nil nil)
|
||||
("Anil Dash Blog" "https://www.anildash.com/feed.xml" nil nil nil)))
|
||||
:custom-face
|
||||
(default ((t (:weight normal :height 110 :family "MonaspiceXe Nerd Font Mono"))))
|
||||
(fixed-pitch ((t (:weight normal :height 110 :family "MonaspiceXe Nerd Font Mono"))))
|
||||
(variable-pitch ((t (:weight normal :height 135 :family "MonaspiceXe Nerd Font Propo"))))
|
||||
:hook
|
||||
(minibuffer-setup . cursor-intangible-mode)
|
||||
:config
|
||||
(setq xref-backend-functions (list))
|
||||
(advice-add 'risky-local-variable-p :override #'ignore)
|
||||
(global-display-fill-column-indicator-mode t)
|
||||
(pixel-scroll-precision-mode 1))
|
||||
|
||||
(use-package gnus
|
||||
:ensure nil
|
||||
:custom
|
||||
(message-send-mail-function 'message-send-mail-with-sendmail)
|
||||
(sendmail-program "msmtp")
|
||||
(message-sendmail-f-is-evil t)
|
||||
(message-sendmail-extra-arguments '("--read-envelope-from")))
|
||||
|
||||
(defun set-buffer-variable-pitch ()
|
||||
(interactive)
|
||||
(variable-pitch-mode t)
|
||||
(setq line-spacing 3)
|
||||
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
|
||||
(set-face-attribute 'org-code nil :inherit 'fixed-pitch)
|
||||
(set-face-attribute 'org-block nil :inherit 'fixed-pitch)
|
||||
;; investigate: this face does not exist
|
||||
;;(set-face-attribute 'org-block-background nil :inherit 'fixed-pitch)
|
||||
)
|
||||
|
||||
(use-package outline-minor
|
||||
:ensure nil
|
||||
:bind
|
||||
(:map evil-normal-state-map
|
||||
("zoc" . #'outline-cycle-buffer))
|
||||
:hook
|
||||
clojure-mode
|
||||
scheme-mode
|
||||
emacs-lisp-mode)
|
||||
|
||||
;;;; Org Mode
|
||||
(use-package org
|
||||
:ensure (:repo "https://git.savannah.gnu.org/git/emacs/org-mode.git" :branch "emacs-sync")
|
||||
:preface
|
||||
(defun cc/org-local-stuff ()
|
||||
(setq-local visual-fill-column-center-text t))
|
||||
:after visual-fill-column
|
||||
:custom
|
||||
(org-babel-load-languages '((emacs-lisp . t)
|
||||
(scheme . t)
|
||||
(shell . t)))
|
||||
:hook
|
||||
(org-mode . org-indent-mode)
|
||||
(org-src-mode . hack-local-variables)
|
||||
(org-mode . visual-line-mode)
|
||||
(org-mode . set-buffer-variable-pitch)
|
||||
:config
|
||||
(setq org-directory "~/org")
|
||||
;;(add-to-list 'org-modules 'collector)
|
||||
)
|
||||
|
||||
(use-package org-roam
|
||||
:custom
|
||||
(org-roam-directory "~/org/roam")
|
||||
:config
|
||||
(org-roam-db-autosync-mode))
|
||||
|
||||
(use-package consult-notes
|
||||
:config
|
||||
(consult-notes-org-roam-mode t))
|
||||
|
||||
(use-package websocket
|
||||
:after org-roam)
|
||||
|
||||
(use-package org-roam-ui
|
||||
:after org-roam
|
||||
:custom
|
||||
(org-roam-ui-sync-theme t)
|
||||
(org-roam-ui-follow t)
|
||||
(org-roam-ui-update-on-save t)
|
||||
(org-roam-ui-open-on-start t))
|
||||
|
||||
(use-package org-modern
|
||||
:hook
|
||||
(org-mode . org-modern-mode)
|
||||
(org-agenda-finalize . org-modern-agenda))
|
||||
|
||||
(use-package org-rainbow-tags
|
||||
:hook
|
||||
(org-mode . org-rainbow-tags-mode))
|
||||
|
||||
;;;; Design
|
||||
(use-package color-theme-modern)
|
||||
(use-package moe-theme)
|
||||
(use-package catppuccin-theme
|
||||
:custom
|
||||
(catppuccin-flavor 'mocha)
|
||||
(catppuccin-highlight-matches t)
|
||||
(catppuccin-italic-comments t)
|
||||
:custom-face
|
||||
(font-lock-doc-face ((t (:inherit font-lock-comment-face
|
||||
:foreground "#fab387"))))
|
||||
:config
|
||||
;;(load-theme 'catppuccin)
|
||||
)
|
||||
|
||||
(use-package unicode-fonts
|
||||
:config
|
||||
(unicode-fonts-setup))
|
||||
|
||||
(set-frame-parameter nil 'alpha-background 90)
|
||||
(add-to-list 'default-frame-alist '(alpha-background . 90))
|
||||
|
||||
(use-package lambda-line
|
||||
:ensure (:host github :repo "lambda-emacs/lambda-line")
|
||||
:custom
|
||||
(lambda-line-icon-time t) ;; requires ClockFace font (see below)
|
||||
(lambda-line-clockface-update-fontset "ClockFaceRect") ;; set clock icon
|
||||
(lambda-line-position 'bottom) ;; Set position of status-line
|
||||
(lambda-line-abbrev t) ;; abbreviate major modes
|
||||
(lambda-line-hspace " ") ;; add some cushion
|
||||
(lambda-line-prefix t) ;; use a prefix symbol
|
||||
(lambda-line-prefix-padding nil) ;; no extra space for prefix
|
||||
(lambda-line-status-invert nil) ;; no invert colors
|
||||
(lambda-line-gui-ro-symbol " ⨂") ;; symbols
|
||||
(lambda-line-gui-mod-symbol " ⬤")
|
||||
(lambda-line-gui-rw-symbol " ")
|
||||
(lambda-line-vc-symbol " ")
|
||||
(lambda-line-space-top +.50) ;; padding on top and bottom of line
|
||||
(lambda-line-space-bottom -.50)
|
||||
(lambda-line-symbol-position 0.1) ;; adjust the vertical placement of symbol
|
||||
:config
|
||||
;; add evil indicator
|
||||
(advice-add 'lambda-line-compose :around
|
||||
(lambda (orig-fun status name primary tertiary secondary)
|
||||
(funcall orig-fun
|
||||
status
|
||||
(concat name evil-mode-line-tag)
|
||||
primary tertiary secondary)))
|
||||
;; activate lambda-line
|
||||
(lambda-line-mode)
|
||||
(lambda-line-clockface-update-fontset "ClockFaceRect")
|
||||
(customize-set-variable 'flymake-mode-line-counter-format '("" flymake-mode-line-error-counter flymake-mode-line-warning-counter flymake-mode-line-note-counter ""))
|
||||
(customize-set-variable 'flymake-mode-line-format '(" " flymake-mode-line-exception flymake-mode-line-counters))
|
||||
;; set divider line in footer
|
||||
(when (eq lambda-line-position 'top)
|
||||
(setq-default mode-line-format (list "%_"))
|
||||
(setq mode-line-format (list "%_"))))
|
||||
|
||||
(use-package lambda-themes
|
||||
:ensure (:host github :repo "lambda-emacs/lambda-themes")
|
||||
:custom
|
||||
(lambda-themes-set-italic-comments t)
|
||||
(lambda-themes-set-italic-keywords t)
|
||||
(lambda-themes-set-variable-pitch t)
|
||||
:config
|
||||
;; load preferred theme
|
||||
(load-theme 'lambda-dark))
|
||||
|
||||
;;;;; Long line handling
|
||||
|
||||
(use-package visual-fill-column
|
||||
:custom
|
||||
(visual-fill-column-enable-sensible-window-split t)
|
||||
:hook
|
||||
(prog-mode . visual-line-mode)
|
||||
visual-line-mode
|
||||
;; :config
|
||||
;; (add-hook 'prog-mode-hook #'visual-line-mode)
|
||||
;; (add-hook 'visual-line-mode-hook #'visual-fill-column-mode)
|
||||
)
|
||||
|
||||
(use-package adaptive-wrap
|
||||
:config
|
||||
(setq-default adaptive-wrap-extra-indent 4)
|
||||
;;(add-hook 'visual-line-mode-hook #'adaptive-wrap-prefix-mode)
|
||||
:hook
|
||||
(visual-line-mode . adaptive-wrap-prefix-mode))
|
||||
|
||||
(use-package password-store)
|
||||
(use-package password-store-otp
|
||||
:ensure (:version (lambda (_) "0.1.5")))
|
||||
|
||||
(use-package pass)
|
||||
|
||||
;;;; Evil Mode
|
||||
(use-package evil
|
||||
:init
|
||||
(setq evil-want-keybinding nil
|
||||
evil-emacs-state-tag " "
|
||||
evil-normal-state-tag " "
|
||||
evil-visual-state-tag " "
|
||||
evil-insert-state-tag " "
|
||||
evil-motion-state-tag " "
|
||||
evil-operator-state-tag " ")
|
||||
:config
|
||||
(evil-set-leader 'normal (kbd "<SPC>"))
|
||||
(evil-set-leader 'normal (kbd "z") t)
|
||||
(evil-mode 1)
|
||||
:bind
|
||||
(:map evil-normal-state-map
|
||||
("<leader>f" . 'find-file)
|
||||
("<leader>k" . 'kill-buffer)))
|
||||
|
||||
(use-package evil-collection
|
||||
:after evil
|
||||
:ensure t
|
||||
:delight evil-collection-unimpaired-mode
|
||||
:custom
|
||||
(evil-collection-outline-bind-tab-p 1)
|
||||
:commands evil-collection-init
|
||||
:init
|
||||
(evil-collection-init))
|
||||
|
||||
;;;; Search, Completion, Execution
|
||||
;;;;; Preliminary Packages
|
||||
(use-package savehist
|
||||
:ensure nil
|
||||
:init
|
||||
(savehist-mode))
|
||||
|
||||
(use-package orderless
|
||||
:after consult
|
||||
:config
|
||||
(with-eval-after-load 'eglot
|
||||
(setq completion-category-defaults nil))
|
||||
(setq completion-styles '(orderless basic)
|
||||
completion-category-defaults nil
|
||||
completion-category-overrides '((file (styles basic partial-completion)))))
|
||||
|
||||
(use-package embark-consult
|
||||
:hook
|
||||
(embark-collect-mode . consult-preview-at-point-mode)
|
||||
:config
|
||||
(require 'consult-flymake)
|
||||
(require 'consult-xref)
|
||||
:custom
|
||||
(xref-show-xrefs-function #'consult-xref)
|
||||
:bind
|
||||
(:map evil-normal-state-map
|
||||
("<leader><SPC>" . 'consult-find)
|
||||
("<leader>gs" . 'consult-eglot-symbols)
|
||||
("<leader>b" . 'consult-buffer)
|
||||
("<leader>gb" . 'consult-project-buffer)
|
||||
("<leader>g/" . 'consult-git-grep)
|
||||
("<leader>/" . 'consult-grep)
|
||||
("/" . 'consult-line))
|
||||
("C-<SPC>" . 'embark-act)
|
||||
("C-M-<return>" . 'embark-bindings))
|
||||
|
||||
(use-package wgrep
|
||||
:config
|
||||
(setq wgrep-auto-save-buffer t))
|
||||
|
||||
(use-package vertico
|
||||
:commands
|
||||
vertico-mode
|
||||
:init
|
||||
(vertico-mode))
|
||||
|
||||
(use-package marginalia
|
||||
:commands
|
||||
marginalia-mode
|
||||
:init
|
||||
(marginalia-mode))
|
||||
|
||||
(use-package nerd-icons-completion
|
||||
:after marginalia
|
||||
:commands
|
||||
nerd-icons-completion-mode
|
||||
:hook
|
||||
(marginalia-mode-hook . nerd-icons-completion-marginalia-setup)
|
||||
:init
|
||||
(nerd-icons-completion-mode))
|
||||
|
||||
(use-package which-key
|
||||
:commands
|
||||
which-key-setup-minibuffer
|
||||
:init
|
||||
(which-key-setup-minibuffer)
|
||||
:config
|
||||
(which-key-mode t))
|
||||
|
||||
;;;;; Code Completion
|
||||
(use-package cape
|
||||
:config
|
||||
(require 'cape-char)
|
||||
(require 'cape-keyword)
|
||||
(defun my/capf ()
|
||||
(setq completion-at-point-functions
|
||||
(list (cape-capf-super
|
||||
#'tempel-complete
|
||||
#'cape-dabbrev
|
||||
#'cape-file
|
||||
#'cape-dict
|
||||
#'cape-line
|
||||
#'cape-emoji
|
||||
#'cape-keyword))))
|
||||
(defun my/eglot-capf ()
|
||||
(setq completion-at-point-functions
|
||||
(list (cape-capf-super
|
||||
#'eglot-completion-at-point
|
||||
#'tempel-complete
|
||||
#'cape-dabbrev
|
||||
#'cape-file
|
||||
#'cape-dict
|
||||
#'cape-line
|
||||
#'cape-emoji
|
||||
#'cape-keyword))))
|
||||
(defun my/geiser-capf ()
|
||||
(setq completion-at-point-functions
|
||||
(list (apply #'cape-capf-super
|
||||
(append geiser-capf--capfs
|
||||
(list
|
||||
#'tempel-complete
|
||||
#'cape-dabbrev
|
||||
#'cape-file
|
||||
#'cape-dict
|
||||
#'cape-line
|
||||
#'cape-emoji
|
||||
#'cape-keyword))))))
|
||||
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
|
||||
:hook
|
||||
(org-mode . my/capf)
|
||||
(prog-mode . my/capf)
|
||||
(eglot-managed-mode . my/eglot-capf)
|
||||
(geiser-mode . my/geiser-capf))
|
||||
|
||||
(defun my/corfu-combined-sort (candidates)
|
||||
"Sort CANDIDATES using both display-sort-function and corfu-sort-function."
|
||||
(let ((candidates
|
||||
(let ((display-sort-func (corfu--metadata-get 'display-sort-function)))
|
||||
(if display-sort-func
|
||||
(funcall display-sort-func candidates)
|
||||
candidates))))
|
||||
(if corfu-sort-function
|
||||
(funcall corfu-sort-function candidates)
|
||||
candidates)))
|
||||
|
||||
(use-package corfu
|
||||
:custom
|
||||
(corfu-cycle t)
|
||||
(corfu-preselect 'prompt)
|
||||
(corfu-auto t)
|
||||
(corfu-scroll-margin 5)
|
||||
(corfu-quit-no-match 'separator)
|
||||
(evil-collection-corfu-key-themes '(tab-n-go))
|
||||
(corfu-popupinfo-delay '(0.1 . 0.5))
|
||||
:config
|
||||
(setq corfu-sort-override-function #'my/corfu-combined-sort)
|
||||
(add-to-list 'savehist-additional-variables 'corfu-history)
|
||||
:commands
|
||||
global-corfu-mode
|
||||
:init
|
||||
(require 'corfu-popupinfo)
|
||||
(require 'corfu-history)
|
||||
(global-corfu-mode)
|
||||
(corfu-popupinfo-mode 1)
|
||||
(corfu-history-mode 1))
|
||||
|
||||
(use-package nerd-icons-corfu
|
||||
:after corfu
|
||||
:init
|
||||
(add-to-list 'corfu-margin-formatters 'nerd-icons-corfu-formatter))
|
||||
|
||||
(use-package corfu-terminal
|
||||
:if (not (display-graphic-p))
|
||||
:after corfu
|
||||
:hook
|
||||
global-corfu-mode)
|
||||
|
||||
(use-package tempel)
|
||||
|
||||
(use-package xref-union
|
||||
:custom
|
||||
(xref-union-excluded-backends (lambda (b) (eq b #'etags--xref-backend)))
|
||||
:hook
|
||||
cider-mode)
|
||||
|
||||
;;;; Basic Navigation
|
||||
(use-package goto-chg
|
||||
:bind
|
||||
(:map evil-normal-state-map
|
||||
("g," . 'goto-last-change)
|
||||
("g;" . 'goto-last-change-reverse)))
|
||||
|
||||
(use-package evil-snipe
|
||||
:after evil-easymotion
|
||||
:custom
|
||||
(evil-snipe-scope 'whole-visible)
|
||||
(evil-snipe-repeat-scope 'whole-buffer)
|
||||
(evil-snipe-spillover-scope 'whole-buffer)
|
||||
(evil-snipe-tab-increment t)
|
||||
:commands
|
||||
evil-snipe-override-mode
|
||||
:init
|
||||
(evil-snipe-override-mode 1)
|
||||
:hook
|
||||
(magit-mode . turn-off-evil-snipe-override-mode)
|
||||
;; See https://github.com/hlissner/evil-snipe/issues/95
|
||||
;; :config
|
||||
;; (evilem-define "gs" 'evil-snipe-repeat
|
||||
;; :bind ((evil-snipe-scope 'buffer)
|
||||
;; (evil-snipe-enable-highlight)
|
||||
;; (evil-snipe-enable-incremental-highlight)))
|
||||
)
|
||||
|
||||
(use-package evil-easymotion
|
||||
:after evil
|
||||
:config
|
||||
(evilem-default-keybindings "<leader>"))
|
||||
|
||||
;;;; Lisp Navigation and Editing
|
||||
;;;;; Helper Functions
|
||||
(defun cc/move-sexp-backward ()
|
||||
"Move balanced expression (sexp) to the right of point backward one sexp.
|
||||
Point must be at the beginning of balanced expression (sexp)."
|
||||
(interactive)
|
||||
(transpose-sexps 1)
|
||||
(forward-sexp -2))
|
||||
|
||||
(defun cc/move-sexp-forward ()
|
||||
"Move balanced expression (sexp) to the right of point forward one sexp.
|
||||
Point must be at the beginning of balanced expression (sexp)."
|
||||
(interactive)
|
||||
(forward-sexp 1)
|
||||
(transpose-sexps 1)
|
||||
(forward-sexp -1))
|
||||
|
||||
(defvar last-sexp nil)
|
||||
|
||||
(defun cc/clone-sexp ()
|
||||
"Clone the sexp right after the cursor."
|
||||
(interactive)
|
||||
(call-interactively #'mark-sexp)
|
||||
(call-interactively #'kill-ring-save)
|
||||
(call-interactively #'evil-paste-before)
|
||||
(call-interactively #'forward-char)
|
||||
(call-interactively #'paredit-newline))
|
||||
|
||||
(defun cc/slurp-forward ()
|
||||
"Slurps forward when the key is after the closing paren."
|
||||
(interactive)
|
||||
(call-interactively #'backward-char)
|
||||
(call-interactively #'paredit-forward-slurp-sexp))
|
||||
|
||||
(defun cc/barf-forward ()
|
||||
"Barfs forward even when the key is after the closing paren."
|
||||
(interactive)
|
||||
(call-interactively #'backward-char)
|
||||
(call-interactively #'paredit-forward-barf-sexp))
|
||||
|
||||
(defun looking-at-opening-paren ()
|
||||
(looking-at (rx (or "(" "{" "["))))
|
||||
|
||||
(defun being-past-closing-paren ()
|
||||
(looking-back (rx (or ")" "}" "]"))))
|
||||
|
||||
;;;;; Basic
|
||||
|
||||
(use-package paredit
|
||||
:config
|
||||
;; (add-hook 'clojure-ts-mode-hook #'paredit-mode)
|
||||
;; (add-hook 'emacs-lisp-mode-hook #'paredit-mode)
|
||||
;; (add-hook 'scheme-mode-hook #'paredit-mode)
|
||||
(evil-define-key 'insert paredit-mode-map
|
||||
(kbd "r") (conditional-keybind #'looking-at-opening-paren
|
||||
#'paredit-raise-sexp)
|
||||
(kbd "w") (conditional-keybind #'looking-at-opening-paren
|
||||
#'cc/move-sexp-backward)
|
||||
(kbd "s") (conditional-keybind #'looking-at-opening-paren
|
||||
#'cc/move-sexp-forward)
|
||||
(kbd "c") (conditional-keybind #'looking-at-opening-paren
|
||||
#'cc/clone-sexp)
|
||||
(kbd ">") (conditional-keybind #'being-past-closing-paren
|
||||
#'cc/slurp-forward)
|
||||
(kbd "<") (conditional-keybind #'being-past-closing-paren
|
||||
#'cc/barf-forward))
|
||||
:hook
|
||||
clojure-ts-mode
|
||||
clojure-mode
|
||||
emacs-lisp-mode
|
||||
scheme-mode)
|
||||
|
||||
;;;;; Visual Aid
|
||||
;; (use-package rainbow-delimiters
|
||||
;; :hook
|
||||
;; emacs-lisp-mode
|
||||
;; scheme-mode)
|
||||
|
||||
;;;; Programming
|
||||
(use-package editorconfig
|
||||
:delight editorconfig-mode
|
||||
:commands
|
||||
editorconfig-mode
|
||||
:init
|
||||
(editorconfig-mode 1))
|
||||
|
||||
(use-package flymake
|
||||
:ensure nil
|
||||
:delight '(:eval (cons " " (flymake--mode-line-counters))))
|
||||
|
||||
(use-package eglot
|
||||
:ensure nil
|
||||
:custom
|
||||
(eglot-connect-timeout 90)
|
||||
(eglot-autoshutdown t)
|
||||
(eglot-report-progress t)
|
||||
:config
|
||||
(setq-default eglot-workspace-configuration
|
||||
'((clojure-lsp (maxCompletions . 300))))
|
||||
:hook
|
||||
(eglot-managed-mode . (lambda ()
|
||||
(add-hook 'before-save-hook
|
||||
(lambda ()
|
||||
(call-interactively #'eglot-format-buffer))
|
||||
nil 'local)))
|
||||
(eglot-managed-mode . eglot-inlay-hints-mode)
|
||||
(clojure-mode . eglot-ensure))
|
||||
|
||||
(use-package consult-eglot
|
||||
:after (consult eglot))
|
||||
|
||||
;;;;; Clojure
|
||||
(use-package clojure-mode
|
||||
:preface
|
||||
(defun embark-eglot-rename (from to)
|
||||
"Renames the symbol at point."
|
||||
(interactive "sRename: \nsRename %s to: ")
|
||||
(funcall-interactively #'eglot-rename to))
|
||||
:delight ""
|
||||
:after (embark cider)
|
||||
:config
|
||||
(defvar-keymap embark-clj-identifier-map
|
||||
:parent embark-identifier-map
|
||||
"c" #'embark-eglot-rename)
|
||||
(add-to-list 'embark-keymap-alist '(identifier . embark-clj-identifier-map))
|
||||
:hook
|
||||
(clojure-mode . (lambda ()
|
||||
(setq xref-backend-functions (list))
|
||||
(setq-local prettify-symbols-alist
|
||||
'(("fn" . "λ")
|
||||
("comp" . "∘")
|
||||
("and" . "∧")
|
||||
("or" . "∨")
|
||||
("not" . "¬"))))))
|
||||
|
||||
(use-package cider
|
||||
;;:elpaca (:host github :repo "clojure-emacs/cider" :tag "v1.12.0")
|
||||
:delight (cider-mode '(:eval (concat " [" (cider--modeline-info) "]")))
|
||||
:config
|
||||
(evil-define-key 'normal 'cider-mode-map
|
||||
(kbd "<localleader>ce") #'cider-eval-sexp-at-point))
|
||||
|
||||
;;;;; Scheme
|
||||
|
||||
(use-package geiser
|
||||
:custom
|
||||
(geiser-chicken-match-limit 200)
|
||||
:config
|
||||
(defalias 'run-geiser 'geiser))
|
||||
|
||||
(use-package paren-face
|
||||
:hook
|
||||
scheme-mode
|
||||
emacs-lisp-mode
|
||||
clojure-ts-mode
|
||||
;; :config
|
||||
;; (add-hook 'scheme-mode-hook #'paren-face-mode)
|
||||
;; (add-hook 'emacs-lisp-mode-hook #'paren-face-mode)
|
||||
;; (add-hook 'clojure-ts-mode-hook #'paren-face-mode)
|
||||
)
|
||||
|
||||
(use-package highlight-parentheses
|
||||
:hook
|
||||
prog-mode
|
||||
;; :config
|
||||
;; (add-hook 'prog-mode-hook #'highlight-parentheses-mode)
|
||||
)
|
||||
|
||||
;;;;;; Chicken Scheme
|
||||
(use-package scheme
|
||||
:ensure nil
|
||||
:hook
|
||||
(scheme-mode . (lambda ()
|
||||
(setq-local prettify-symbols-alist
|
||||
'(("lambda" . "λ")
|
||||
("compose" . "∘")
|
||||
("and" . "∧")
|
||||
("or" . "∨")
|
||||
("not" . "¬"))))))
|
||||
|
||||
(defun flymake-chicken-init ()
|
||||
(add-hook flymake-diagnostic-functions
|
||||
flymake-chicken-backend nil t)
|
||||
(flymake-mode))
|
||||
|
||||
(use-package geiser-chicken)
|
||||
|
||||
;;;;;; Guile
|
||||
|
||||
(use-package geiser-guile
|
||||
:config
|
||||
(when (executable-find "guix")
|
||||
(add-to-list 'geiser-guile-load-path
|
||||
(expand-file-name "~/.config/guix/current/share/guile/site/3.0"))))
|
||||
|
||||
;; (use-package flymake-chicken
|
||||
;; :hook
|
||||
;; ((scheme-mode . flymake-chicken-init)
|
||||
;; (scheme-mode . flymake-mode))
|
||||
;; :custom
|
||||
;; (flycheck-global-modes '(not scheme-mode))
|
||||
;; :config
|
||||
;; (add-hook 'flymake-diagnostic-functions #'flymake-chicken-backend nil t))
|
||||
|
||||
;;;; Other Languages
|
||||
|
||||
(use-package zig-mode
|
||||
:hook
|
||||
(zig-mode . eglot-ensure)
|
||||
:mode ("\\.zig\\'" . zig-mode))
|
||||
|
||||
;; (use-package lsp-tailwindcss
|
||||
;; :init
|
||||
;; (setq lsp-tailwindcss-add-on-mode t
|
||||
;; lsp-tailwindcss-experimental-class-regex ["\"([^\"]*)\""])
|
||||
;; :config
|
||||
;; (add-to-list 'lsp-tailwindcss-major-modes 'clojurescript-ts-mode)
|
||||
;; (add-to-list 'lsp-tailwindcss-major-modes 'clojurec-ts-mode))
|
||||
|
||||
(use-package dhall-mode
|
||||
:mode "\\.dhall\'"
|
||||
:hook
|
||||
((dhall-mode . lsp)))
|
||||
|
||||
;;;; Version Control
|
||||
|
||||
;;;;; Git
|
||||
|
||||
;; Magit requires 'transient' >= 0.5.0, but due to bad defaults, Emacs' package manager refuses to
|
||||
;; upgrade this and other built-in packages to higher releases from GNU Elpa.
|
||||
(use-package transient
|
||||
:init
|
||||
(progn (unload-feature 'transient t)
|
||||
(require 'transient)))
|
||||
;; To fix this, you have to add this to your init file:
|
||||
;; (setq package-install-upgrade-built-in t)
|
||||
;; You must also make sure the updated version is loaded, by evaluating the `progn` form below.
|
||||
(use-package magit
|
||||
:after magit-popup
|
||||
:init
|
||||
(progn (unload-feature 'transient t)
|
||||
(require 'transient)))
|
||||
|
||||
(use-package hl-todo
|
||||
:ensure (:version (lambda (_) "3.6.0")))
|
||||
|
||||
(use-package magit-todos
|
||||
:after (magit hl-todo)
|
||||
:hook
|
||||
(magit-mode . magit-todos-mode))
|
||||
|
||||
(use-package magit-popup)
|
||||
|
||||
(use-package forge
|
||||
:after magit
|
||||
:config
|
||||
(advice-add 'magit :after (lambda (&rest _args)
|
||||
(call-interactively #'forge-pull))))
|
||||
|
||||
(use-package git-gutter
|
||||
:hook
|
||||
prog-mode
|
||||
;; :config
|
||||
;; (add-hook 'prog-mode-hook #'git-gutter-mode)
|
||||
)
|
||||
|
||||
;;;; File Formats
|
||||
;;;;; Asciidoc
|
||||
(use-package adoc-mode
|
||||
:hook
|
||||
(adoc-mode . visual-line-mode)
|
||||
(adoc-mode . (lambda () (setq-local visual-fill-column-center-text t))))
|
||||
|
||||
;;;; LaTeX
|
||||
;; https://github.com/politza/pdf-tools/#known-problems
|
||||
(add-hook 'TeX-after-compilation-finished-functions
|
||||
#'TeX-revert-document-buffer)
|
||||
|
||||
;;;; Communication
|
||||
;;;;; IRC
|
||||
(use-package rcirc
|
||||
:ensure nil
|
||||
:after password-store
|
||||
:custom
|
||||
(rcirc-server-alist
|
||||
`(("liberachat.irc.lyrion.ch"
|
||||
:server-alias "irc.libera.chat"
|
||||
:port 6697
|
||||
:nick "zilti"
|
||||
:full-name "Daniel Ziltener"
|
||||
:user-name "zilti/irc.libera.chat"
|
||||
:password ,(password-store-get "Privat/Soju")
|
||||
:encryption tls
|
||||
:channels ("#chicken")))
|
||||
`(("oftc.irc.lyrion.ch"
|
||||
:server-alias "irc.oftc.net"
|
||||
:port 6697
|
||||
:nick "zilti"
|
||||
:full-name "Daniel Ziltener"
|
||||
:user-name "zilti/irc.oftc.net"
|
||||
:password ,(password-store-get "Privat/Soju")
|
||||
:encryption tls
|
||||
:channels ()))))
|
||||
|
||||
;;;; Wrapping Up
|
||||
(use-package envrc
|
||||
:config
|
||||
(envrc-global-mode))
|
||||
|
||||
(provide 'init)
|
||||
;;; init.el ends here
|
|
@ -1,156 +0,0 @@
|
|||
#+TITLE: Emacs Init File
|
||||
#+AUTHOR: Daniel Ziltener
|
||||
|
||||
* Initialization
|
||||
|
||||
** Requirements
|
||||
|
||||
Since I am using ~cl-defun~ in this init file, I need to import ~cl-macs~.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(require 'cl-macs)
|
||||
#+end_src
|
||||
|
||||
** Personal Information
|
||||
|
||||
#+NAME: pers-info-table
|
||||
| Name | Mail |
|
||||
|-----------------+---------------------|
|
||||
| Daniel Ziltener | dziltener@lyrion.ch |
|
||||
|
||||
#+begin_src emacs-lisp :var input=pers-info-table
|
||||
(let ((row (car input)))
|
||||
(setq user-full-name (cl-first row))
|
||||
(setq user-mail-address (cl-second row)))
|
||||
#+end_src
|
||||
|
||||
For storage of passwords, I use [[https://www.passwordstore.org/][pass]]: src_emacs-lisp[]{(auth-source-pass-enable)}
|
||||
|
||||
** Customizations
|
||||
|
||||
Since this init file is version controlled, and I set all customizations
|
||||
myself in =use-package= blocks, I want Emacs to use a separate file
|
||||
for authorized =.dir-local= variables and similar stuff.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq custom-file "~/.emacs.d/custom.el")
|
||||
(when (file-exists-p custom-file)
|
||||
(load custom-file))
|
||||
#+end_src
|
||||
|
||||
** Package Manager
|
||||
|
||||
Most packages are being installed using =Guix=, for the few remaining ones that have to be fetched from Git, I use
|
||||
[[https://github.com/progfolio/elpaca][Elpaca]].
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defvar elpaca-installer-version 0.6)
|
||||
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
|
||||
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
||||
:ref nil
|
||||
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
|
||||
:build (:not elpaca--activate-package)))
|
||||
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
|
||||
(build (expand-file-name "elpaca/" elpaca-builds-directory))
|
||||
(order (cdr elpaca-order))
|
||||
(default-directory repo))
|
||||
(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 (call-process "git" nil buffer t "clone"
|
||||
(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)
|
||||
(load "./elpaca-autoloads")))
|
||||
(add-hook 'after-init-hook #'elpaca-process-queues)
|
||||
(elpaca `(,@elpaca-order))
|
||||
#+end_src
|
||||
|
||||
A few additional lines are necessary to integrate it with =use-package=:
|
||||
#+begin_src emacs-lisp
|
||||
(elpaca elpaca-use-package
|
||||
(elpaca-use-package-mode)
|
||||
(setq elpaca-use-package-by-default nil))
|
||||
(elpaca-wait)
|
||||
#+end_src
|
||||
|
||||
* Helper Functions
|
||||
|
||||
Those are meant to reduce code duplication, and add some basic useful features.
|
||||
The first one is a function to create conditional keybindings.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(cl-defun conditional-keybind
|
||||
"Creates a keybinding that checks `filter-fn`. If it succeeds,
|
||||
`target-fn` is run, otherwise `fail-fn`. If no fail-fn is given,
|
||||
`self-insert-command` is run instead.
|
||||
`target-fn` and `fail-fn` must both be interactive."
|
||||
(lambda (_prefix)
|
||||
(interactive "P")
|
||||
(if (funcall filter-fn)
|
||||
(call-interactively target-fn)
|
||||
(call-interactively fail-fn))))
|
||||
#+end_src
|
||||
|
||||
* Core Emacs Customization :important:
|
||||
|
||||
Enabled core modes:
|
||||
|
||||
#+NAME: enabled-core-modes
|
||||
- display-time-mode
|
||||
- global-hl-line-mode
|
||||
- global-prettify-symbols-mode
|
||||
- recentf-mode
|
||||
|
||||
Disabled core modes:
|
||||
|
||||
#+NAME: disabled-core-modes
|
||||
- indent-tabs-mode
|
||||
- menu-bar-mode
|
||||
- scroll-bar-mode
|
||||
- tool-bar-mode
|
||||
|
||||
#+begin_src emacs-lisp :var enabled=enabled-core-modes :var disabled=disabled-core-modes
|
||||
(use-package emacs
|
||||
:custom
|
||||
(completion-cycle-threshold 10)
|
||||
(display-time-mode t)
|
||||
(enable-recursive-minibuffers t)
|
||||
(enable-remote-dir-locals t)
|
||||
(fill-column 100)
|
||||
(global-hl-line-mode t)
|
||||
(global-prettify-symbols-mode t)
|
||||
(indent-tabs-mode nil)
|
||||
(menu-bar-mode nil)
|
||||
(minibuffer-prompt-properties (read-only t cursor-intangible t face minibuffer-prompt))
|
||||
(read-extended-command-predicate #'command-completion-default-include-p)
|
||||
(recentf-mode t)
|
||||
(scroll-bar-mode nil)
|
||||
(tab-always-indent 'complete)
|
||||
(tool-bar-mode nil)
|
||||
:custom-face
|
||||
(default ((t (:weight bold :height 113 :width normal :family "VictorMono Nerd Font"))))
|
||||
:hook
|
||||
(minibuffer-setup . cursor-intangible-mode)
|
||||
:config
|
||||
(advice-add 'risky-local-variable-p :override #'ignore))
|
||||
#+end_src
|
||||
|
||||
** Sending Mail
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
fundamental-mode
|
||||
|
||||
(sign "-- DZ " (format-time-string "%Y-%m-%d"))
|
||||
|
||||
prog-mode
|
||||
|
||||
(vip-title (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) " " (make-string (length str) ?=) " " n
|
||||
(if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) " " (s str) " " n
|
||||
(if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) " " (make-string (length str) ?=) " " n)
|
||||
|
||||
(fixme (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "FIXME ")
|
||||
(todo (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "TODO ")
|
||||
(bug (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "BUG ")
|
||||
(hack (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "HACK ")
|
||||
|
||||
scheme-mode
|
||||
|
||||
(crate-dependency
|
||||
"(\"rust-" crate-name "\" ,rust-" (s crate-name) "-" p ")")
|
||||
|
||||
(define-guix-crate
|
||||
"(define-public rust-" (s egg-name) "-" (s maj-version)
|
||||
n> "(package"
|
||||
n> "(name \"rust-" egg-name "\")"
|
||||
n> "(version \"" maj-version "." (s egg-version) "\")"
|
||||
n> "(source"
|
||||
n> "(origin"
|
||||
n> "(method url-fetch)"
|
||||
n> "(uri (crate-uri \"" egg-name "\" version))"
|
||||
n> "(sha256"
|
||||
n> "(base32"
|
||||
n> "\"0z05x7f154n9bgmainrsmncf5i6dil43r9ymr3rdgwbg4wnxmz4s\"))))"
|
||||
n> "(build-system cargo-build-system)"
|
||||
n> "(arguments"
|
||||
n> "`(#:cargo-inputs"
|
||||
n> "(" p ")"
|
||||
n> "#:cargo-development-inputs"
|
||||
n> "(" p ")"
|
||||
n> "#:cargo-build-inputs"
|
||||
n> "(" p ")))"
|
||||
n> "(synopsis \"" (s synopsis) "\")"
|
||||
n> "(home-page \"https://crates.io/crates/" egg-name "\")"
|
||||
n> "(description \"" synopsis ".\")"
|
||||
n> "(license license:" (s license) ")))")
|
||||
|
||||
(define-guix-egg
|
||||
"(define-public chicken-" (s egg-name)
|
||||
n> "(package"
|
||||
n> "(name \"chicken-" egg-name "\")"
|
||||
n> "(version \"" (s egg-version) "\")"
|
||||
n> "(source"
|
||||
n> "(origin"
|
||||
n> "(method url-fetch)"
|
||||
n> "(uri (egg-uri \"" egg-name "\" version))"
|
||||
n> "(sha256"
|
||||
n> "(base32"
|
||||
n> "\"0z05x7f154n9bgmainrsmncf5i6dil43r9ymr3rdgwbg4wnxmz4s\"))))"
|
||||
n> "(propagated-inputs"
|
||||
n> "(list " (s inputs) "))"
|
||||
n> "(native-inputs"
|
||||
n> "(list " (s native-inputs) "))"
|
||||
n> "(build-system chicken-build-system)"
|
||||
n> "(arguments '(#:egg-name \"" egg-name "\"))"
|
||||
n> "(synopsis \"" (s synopsis) "\")"
|
||||
n> "(home-page \"https://wiki.call-cc.org/eggref/5/" egg-name "\")"
|
||||
n> "(description \"" synopsis "\")"
|
||||
n> "(license license:" (s license) ")))")
|
||||
|
||||
org-mode
|
||||
|
||||
(src
|
||||
"#+begin_src " p
|
||||
n p n
|
||||
"#+end_src")
|
||||
|
||||
(advent-of-code-day
|
||||
"* Day " (s day) ": " p
|
||||
n> n> "Get the puzzle solution as [[./day" day ".scm][tangled .scm file]]."
|
||||
n> n> "** Part One"
|
||||
n> n> "#+NAME: day" day "-imports"
|
||||
n> "#+begin_src scheme :exports none :noweb yes :tangle day" day ".scm"
|
||||
n>
|
||||
n> "#+end_src"
|
||||
n> n> "#+NAME: day" day "-input-scm"
|
||||
n> "#+begin_src scheme :exports none :noweb yes :tangle day" day ".scm"
|
||||
n> "(define input \""
|
||||
n> "<<day" day "-input>>\")"
|
||||
n> "#+end_src"
|
||||
n> n> "*** Quest"
|
||||
n> n> "*** Puzzle Solution"
|
||||
n> n> "**** Calculation"
|
||||
n> n> "#+NAME: day" day "-part1-calc-fn"
|
||||
n> "#+begin_src scheme :tangle day" day ".scm :noweb strip-tangle"
|
||||
n> ""
|
||||
n> "#+end_src"
|
||||
n> n> "#+CALL: day" day "-part1-calc-fn[:var input=day" day "-input[] :epilogue \"(calc-part-1)\"]()"
|
||||
n> n> "** Part Two"
|
||||
n> n> "*** Quest"
|
||||
n> n> "*** Puzzle Solution"
|
||||
n> n> "**** Calculation"
|
||||
n> n> "#+NAME: day" day "-part2-calc-fn"
|
||||
n> "#+begin_src scheme :tangle day" day ".scm :noweb strip-tangle"
|
||||
n> ""
|
||||
n> "#+end_src"
|
||||
n>n> "#+CALL: day" day "-part2-calc-fn[:var input=day" day "-input[] :epilogue \"(calc-part-2)\"]()"
|
||||
n> n> "** Puzzle Input"
|
||||
n> n> "#+NAME: day" day "-input"
|
||||
n> "#+begin_src fundamental"
|
||||
n> "#+end_src")
|
||||
|
||||
;; Local Variables:
|
||||
;; mode: lisp-data
|
||||
;; outline-regexp: "[a-z]"
|
||||
;; End:
|
|
@ -1,7 +0,0 @@
|
|||
[main]
|
||||
fields=filename,name,generic,exec
|
||||
filter-desktop=false
|
||||
layer=overlay
|
||||
show-actions=true
|
||||
terminal=kitty
|
||||
width=100
|
|
@ -1,48 +0,0 @@
|
|||
[commit]
|
||||
gpgSign = true
|
||||
user = dziltener@lyrion.ch
|
||||
|
||||
[core]
|
||||
pager = "diff-so-fancy | less '--tabs=4' '-RFX'"
|
||||
|
||||
[diff-so-fancy]
|
||||
changeHunkIndicators = true
|
||||
markEmptyLines = true
|
||||
stripLeadingSymbols = true
|
||||
useUnicodeRuler = true
|
||||
|
||||
[gpg]
|
||||
program = "gpg"
|
||||
|
||||
[interactive]
|
||||
diffFilter = "diff-so-fancy --patch"
|
||||
|
||||
[pull]
|
||||
rebase = true
|
||||
|
||||
[push]
|
||||
autoSetupRemote = true
|
||||
|
||||
[rebase]
|
||||
autoStash = true
|
||||
|
||||
[sendemail]
|
||||
sendmailCmd = msmtp -t
|
||||
annotate = yes
|
||||
|
||||
[tag]
|
||||
gpgSign = true
|
||||
|
||||
[user]
|
||||
email = "dziltener@lyrion.ch"
|
||||
name = "Daniel Ziltener"
|
||||
signingKey = "37F655BAF43BC0FF300A91A1B38976E82C9DAE42"
|
||||
|
||||
[init]
|
||||
defaultBranch = master
|
||||
|
||||
[github]
|
||||
user = dziltener@lyrion.ch
|
||||
|
||||
[gitlab]
|
||||
user = zilti
|
|
@ -89,17 +89,7 @@
|
|||
`(("sway/config" ,(local-file "./sway/sway"))
|
||||
("swaylock/config" ,(local-file "./swaylock/config"))
|
||||
("swayidle/config" ,(local-file "./swayidle/config"))
|
||||
("waybar/config" ,(local-file "./waybar/config"))
|
||||
("waybar/style.css" ,(local-file "./waybar/style.css"))
|
||||
("fuzzel/fuzzel.ini" ,(local-file "./fuzzel/fuzzel.ini"))
|
||||
("git/config" ,(local-file "./git/config"))
|
||||
("liquidpromptrc" ,(local-file "./liquidprompt/liquidpromptrc"))
|
||||
("emacs/init.el" ,(local-file "./emacs/init.el"))
|
||||
("emacs/early-init.el" ,(local-file "./emacs/early-init.el"))
|
||||
("emacs/init.org" ,(local-file "./emacs/init.org"))
|
||||
("emacs/templates" ,(local-file "./emacs/templates"))
|
||||
("kitty/kitty.conf" ,(local-file "./kitty/kitty.conf"))
|
||||
("senpai/senpai.scfg" ,(local-file "./senpai/senpai.scfg"))
|
||||
("xdg-desktop-portal-wlr/config" ,(local-file "./xdg-desktop-portal-wlr/config"))))
|
||||
(service home-syncthing-service-type)
|
||||
(service home-bash-service-type
|
||||
|
@ -206,6 +196,7 @@
|
|||
"slurp"
|
||||
"sshfs"
|
||||
"steam"
|
||||
"stow"
|
||||
;; "sponge" https://linux.die.net/man/1/sponge
|
||||
"swappy"
|
||||
"swayidle"
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
font_family MonaspiceXe Nerd Font Mono
|
||||
font_size 10
|
||||
background_opacity 0.85
|
||||
kitty_mod ctrl+shift
|
||||
enabled_layouts horizontal
|
||||
map kitty_mod+enter new_window
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
address ircs://lyrion.ch
|
||||
nickname zilti
|
||||
realname "Daniel Ziltener"
|
||||
password-cmd pass show Privat/Soju
|
||||
|
|
@ -1,166 +0,0 @@
|
|||
[
|
||||
{
|
||||
"backlight": {
|
||||
"format": "{percent}% {icon}",
|
||||
"format-icons": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"on-scroll-down": "brightnessctl set 1%-",
|
||||
"on-scroll-up": "brightnessctl set +1%"
|
||||
},
|
||||
"battery": {
|
||||
"format": "{capacity}% {icon}",
|
||||
"format-icons": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"states": {
|
||||
"critical": 15,
|
||||
"warning": 30
|
||||
}
|
||||
},
|
||||
"battery#bat2": {
|
||||
"bat": "BAT2"
|
||||
},
|
||||
"clock": {
|
||||
"format": "{:%H:%M} ",
|
||||
"format-alt": "{:%Y-%m-%d} ",
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
|
||||
},
|
||||
"cpu": {
|
||||
"format": "{usage}% {icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}",
|
||||
"format-icons": [
|
||||
"▁",
|
||||
"▂",
|
||||
"▃",
|
||||
"▄",
|
||||
"▅",
|
||||
"▆",
|
||||
"▇",
|
||||
"█"
|
||||
],
|
||||
"tooltip": false
|
||||
},
|
||||
"hyprland/window": {
|
||||
"format": "{}"
|
||||
},
|
||||
"hyprland/workspaces": {
|
||||
"format": "{id}: {icon}",
|
||||
"on-click": "activate",
|
||||
"on-scroll-down": "/nix/store/d25qnrva96v58dq10779sgfz9dachvlb-hyprland-0.32.3/bin/hyprctl dispatch workspace e-1",
|
||||
"on-scroll-up": "/nix/store/d25qnrva96v58dq10779sgfz9dachvlb-hyprland-0.32.3/bin/hyprctl dispatch workspace e+1"
|
||||
},
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": [
|
||||
" ",
|
||||
" "
|
||||
]
|
||||
},
|
||||
"layer": "top",
|
||||
"memory": {
|
||||
"format": "{}% "
|
||||
},
|
||||
"modules-center": [
|
||||
"hyprland/window"
|
||||
],
|
||||
"modules-left": [
|
||||
"hyprland/workspaces",
|
||||
"wlr/mode",
|
||||
"wlr/scratchpad",
|
||||
"user"
|
||||
],
|
||||
"modules-right": [
|
||||
"idle_inhibitor",
|
||||
"network",
|
||||
"cpu",
|
||||
"memory",
|
||||
"temperature",
|
||||
"backlight",
|
||||
"battery",
|
||||
"battery#bat2",
|
||||
"clock",
|
||||
"wireplumber",
|
||||
"tray",
|
||||
"custom/notifications"
|
||||
],
|
||||
"network": {
|
||||
"format-alt": "{ifname}: {ipaddr}/{cidr}",
|
||||
"format-disconnected": "Disconnected ⚠",
|
||||
"format-ethernet": "{ipaddr}/{cidr} ",
|
||||
"format-linked": "{ifname} (No IP) ",
|
||||
"format-wifi": "{essid} ({signalStrength}%) ",
|
||||
"tooltip-format": "{ifname} via {gwaddr} "
|
||||
},
|
||||
"spacing": 4,
|
||||
"temperature": {
|
||||
"critical-threshold": 80,
|
||||
"format": "{temperatureC}°C",
|
||||
"format-icons": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"tray": {
|
||||
"spacing": 10
|
||||
},
|
||||
"user": {
|
||||
"format": "{user} (up {work_d} days ↑)",
|
||||
"icon": true,
|
||||
"interval": 60
|
||||
},
|
||||
"wireplumber": {
|
||||
"format": "{volume}% {icon}",
|
||||
"format-icons": [
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"format-muted": "🔇",
|
||||
"on-click": "/nix/store/v35aidzfvgwzk6nvlnzx5z83vbfdj5av-pwvucontrol-0.2/bin/pwvucontrol"
|
||||
},
|
||||
"wlr/mode": {
|
||||
"format": "<span style=\"italic\">{}</span>"
|
||||
},
|
||||
"wlr/scratchpad": {
|
||||
"format": "{icon} {count}",
|
||||
"format-icons": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"show-empty": true,
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{app}: {title}"
|
||||
},
|
||||
"custom/notifications": {
|
||||
"tooltip": false,
|
||||
"format": "{} {icon}",
|
||||
"format-icons": {
|
||||
"notification": "<span foreground='red'><sup></sup></span>",
|
||||
"none": "",
|
||||
"dnd-notification": "<span foreground='red'><sup></sup></span>",
|
||||
"dnd-none": "",
|
||||
"inhibited-notification": "<span foreground='red'><sup></sup></span>",
|
||||
"inhibited-none": "",
|
||||
"dnd-inhibited-notification": "<span foreground='red'><sup></sup></span>",
|
||||
"dnd-inhibited-none": ""
|
||||
},
|
||||
"return-type": "json",
|
||||
"exec-if": "which swaync-client",
|
||||
"exec": "swaync-client -swb",
|
||||
"on-click": "swaync-client -t -sw",
|
||||
"on-click-right": "swaync-client -d -sw",
|
||||
"escape": true
|
||||
}
|
||||
}
|
||||
]
|
|
@ -1,280 +0,0 @@
|
|||
* {
|
||||
/* `otf-font-awesome` is required to be installed for icons */
|
||||
font-family: 'MPlus Nerd Font', FontAwesome, Roboto, Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(43, 48, 59, 0.5);
|
||||
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
||||
color: #ffffff;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
/*
|
||||
window#waybar.empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
window#waybar.solo {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
*/
|
||||
|
||||
window#waybar.termite {
|
||||
background-color: #3F3F3F;
|
||||
}
|
||||
|
||||
window#waybar.chromium {
|
||||
background-color: #000000;
|
||||
border: none;
|
||||
}
|
||||
|
||||
button {
|
||||
/* Use box-shadow instead of border so the text isn't offset */
|
||||
box-shadow: inset 0 -3px transparent;
|
||||
/* Avoid rounded borders under each button name */
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
button:hover {
|
||||
background: inherit;
|
||||
box-shadow: inset 0 -3px #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background-color: transparent;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background-color: #64727D;
|
||||
box-shadow: inset 0 -3px #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background-color: #64727D;
|
||||
border-bottom: 3px solid #ffffff;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#wireplumber,
|
||||
#custom-media,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#scratchpad,
|
||||
#mpd {
|
||||
padding: 0 10px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#window,
|
||||
#workspaces {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
/* If workspaces is the leftmost module, omit left margin */
|
||||
.modules-left > widget:first-child > #workspaces {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* If workspaces is the rightmost module, omit right margin */
|
||||
.modules-right > widget:last-child > #workspaces {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#clock {
|
||||
background-color: #64727D;
|
||||
}
|
||||
|
||||
#battery {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#battery.charging, #battery.plugged {
|
||||
color: #ffffff;
|
||||
background-color: #26A65B;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: #f53c3c;
|
||||
color: #ffffff;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
background-color: #2ecc71;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#memory {
|
||||
background-color: #9b59b6;
|
||||
}
|
||||
|
||||
#disk {
|
||||
background-color: #964B00;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
background-color: #90b1b1;
|
||||
}
|
||||
|
||||
#network {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
background-color: #f53c3c;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
background-color: #f1c40f;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
background-color: #90b1b1;
|
||||
color: #2a5c45;
|
||||
}
|
||||
|
||||
#wireplumber {
|
||||
background-color: #fff0f5;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#wireplumber.muted {
|
||||
background-color: #f53c3c;
|
||||
}
|
||||
|
||||
#custom-media {
|
||||
background-color: #66cc99;
|
||||
color: #2a5c45;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
#custom-media.custom-spotify {
|
||||
background-color: #66cc99;
|
||||
}
|
||||
|
||||
#custom-media.custom-vlc {
|
||||
background-color: #ffa000;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
background-color: #f0932b;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
|
||||
#tray > .passive {
|
||||
-gtk-icon-effect: dim;
|
||||
}
|
||||
|
||||
#tray > .needs-attention {
|
||||
-gtk-icon-effect: highlight;
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
background-color: #2d3436;
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
background-color: #ecf0f1;
|
||||
color: #2d3436;
|
||||
}
|
||||
|
||||
#mpd {
|
||||
background-color: #66cc99;
|
||||
color: #2a5c45;
|
||||
}
|
||||
|
||||
#mpd.disconnected {
|
||||
background-color: #f53c3c;
|
||||
}
|
||||
|
||||
#mpd.stopped {
|
||||
background-color: #90b1b1;
|
||||
}
|
||||
|
||||
#mpd.paused {
|
||||
background-color: #51a37a;
|
||||
}
|
||||
|
||||
#language {
|
||||
background: #00b093;
|
||||
color: #740864;
|
||||
padding: 0 5px;
|
||||
margin: 0 5px;
|
||||
min-width: 16px;
|
||||
}
|
||||
|
||||
#keyboard-state {
|
||||
background: #97e1ad;
|
||||
color: #000000;
|
||||
padding: 0 0px;
|
||||
margin: 0 5px;
|
||||
min-width: 16px;
|
||||
}
|
||||
|
||||
#keyboard-state > label {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
#keyboard-state > label.locked {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#scratchpad {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#scratchpad.empty {
|
||||
background-color: transparent;
|
||||
}
|
Loading…
Reference in a new issue