2024-04-17 11:43:59 +01:00
|
|
|
;;; init.el -- My emacs config -*- lexical-binding: t -*-
|
2024-02-15 08:18:41 +00:00
|
|
|
;;; Commentary:
|
|
|
|
;; Moving my Emacs config from separate directory
|
2024-04-17 12:54:51 +01:00
|
|
|
;; To install packages on non-NixOS systems run `install.el'
|
2024-02-15 08:18:41 +00:00
|
|
|
;;; Code:
|
2024-07-01 10:13:56 +01:00
|
|
|
|
|
|
|
;; Customise `use-package' behaviour, must be set before first time
|
|
|
|
;; it's used
|
|
|
|
(setopt use-package-check-before-init t
|
|
|
|
use-package-enable-imenu-support t)
|
|
|
|
|
2024-04-02 18:06:05 +01:00
|
|
|
;; Stop popups for warning messages, keep in log buffer
|
2024-04-05 13:31:58 +01:00
|
|
|
(setopt warning-minimum-level :error)
|
2024-04-02 18:06:05 +01:00
|
|
|
|
2024-07-05 06:17:25 +01:00
|
|
|
;; Configure packages archives, with priority, and list of installed
|
|
|
|
;; packages
|
|
|
|
(load-file (locate-user-emacs-file "lib/my-packages.el"))
|
2024-02-19 07:43:02 +00:00
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(setq custom-file (locate-user-emacs-file "custom.el"))
|
2024-06-18 06:55:34 +01:00
|
|
|
(when (and custom-file
|
|
|
|
(file-exists-p custom-file))
|
2024-04-17 11:43:59 +01:00
|
|
|
(load custom-file nil 'nomessage))
|
|
|
|
|
2024-06-15 09:02:18 +01:00
|
|
|
(set-default-coding-systems 'utf-8)
|
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(setq user-full-name "Evie Litherland-Smith"
|
|
|
|
user-mail-address "evie@xenia.me.uk"
|
2024-06-15 09:02:18 +01:00
|
|
|
inhibit-splash-screen t
|
2024-04-17 11:43:59 +01:00
|
|
|
use-short-answers t
|
2024-05-24 08:57:53 +01:00
|
|
|
tab-always-indent 'complete
|
2024-05-24 12:12:20 +01:00
|
|
|
completion-cycle-threshold nil
|
2024-04-17 11:43:59 +01:00
|
|
|
completions-detailed t
|
2024-04-22 08:19:20 +01:00
|
|
|
kill-do-not-save-duplicates t)
|
|
|
|
|
2024-06-15 09:02:18 +01:00
|
|
|
(setq-default truncate-lines t
|
|
|
|
truncate-partial-width-windows nil)
|
|
|
|
|
|
|
|
(setopt indent-tabs-mode nil
|
|
|
|
async-shell-command-display-buffer nil
|
|
|
|
compilation-scroll-output t)
|
|
|
|
|
|
|
|
(global-prettify-symbols-mode +1)
|
|
|
|
(global-auto-revert-mode +1)
|
|
|
|
(delete-selection-mode +1)
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
(scroll-bar-mode -1)
|
2024-04-22 11:16:25 +01:00
|
|
|
|
2024-04-22 08:19:20 +01:00
|
|
|
(use-package pixel-scroll
|
|
|
|
:init
|
|
|
|
(pixel-scroll-precision-mode +1))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-04-22 11:12:46 +01:00
|
|
|
(use-package mwheel
|
|
|
|
:custom
|
|
|
|
(mouse-wheel-scroll-amount '(1 ((shift) . 1)))
|
|
|
|
(mouse-wheel-progressive-speed nil)
|
|
|
|
(mouse-wheel-follow-mouse t))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
;; Bind normal forward/back buttons on mouse to next/previous buffer respectively
|
|
|
|
(keymap-global-set "<mouse-8>" #'previous-buffer)
|
|
|
|
(keymap-global-set "<mouse-9>" #'next-buffer)
|
|
|
|
|
|
|
|
;; Quick bind for calling `git-sync-all'
|
|
|
|
(defun my/git-sync-all ()
|
|
|
|
"Run shell command `git-sync-all' asynchronously."
|
|
|
|
(interactive)
|
2024-05-31 14:59:01 +01:00
|
|
|
(async-shell-command "git-sync-all" "*git-sync-all*" "*git-sync-errors*"))
|
2024-04-17 11:43:59 +01:00
|
|
|
(keymap-global-set "C-c g s" #'my/git-sync-all)
|
|
|
|
|
|
|
|
;; Make shebang (#!) file executable when saved
|
|
|
|
(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)
|
|
|
|
|
2024-06-10 14:34:47 +01:00
|
|
|
;; Remap `upcase-word' and `downcase-word' to DWIM versions
|
|
|
|
(keymap-global-set "<remap> <upcase-word>" 'upcase-dwim)
|
|
|
|
(keymap-global-set "<remap> <downcase-word>" 'downcase-dwim)
|
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(setq backup-directory-alist '(("." . "~/.local/state/emacs/backups")))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-06-12 07:28:50 +01:00
|
|
|
(use-package savehist
|
|
|
|
:demand
|
|
|
|
:config
|
|
|
|
(savehist-mode +1))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package dired
|
|
|
|
:custom
|
|
|
|
(dired-auto-revert-buffer t)
|
|
|
|
(dired-dwim-target t))
|
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(use-package recentf
|
|
|
|
:config
|
|
|
|
(run-at-time nil (* 5 60) 'recentf-save-list)
|
|
|
|
(recentf-mode +1)
|
|
|
|
:custom
|
|
|
|
(recentf-max-saved-items 2048))
|
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package auth-source
|
|
|
|
:custom
|
|
|
|
(auth-sources '("secrets:Login")))
|
|
|
|
|
|
|
|
(use-package auth-source-pass
|
|
|
|
:requires auth-source
|
|
|
|
:config
|
|
|
|
(auth-source-pass-enable))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
;; Make `describe-*' screens more helpful
|
|
|
|
(use-package helpful
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines helpful-mode-map
|
2024-04-17 11:43:59 +01:00
|
|
|
:bind (("<remap> <describe-command>" . helpful-command)
|
|
|
|
("<remap> <describe-function>" . helpful-callable)
|
|
|
|
("<remap> <describe-key>" . helpful-key)
|
|
|
|
("<remap> <describe-symbol>" . helpful-symbol)
|
|
|
|
("<remap> <describe-variable>" . helpful-variable)
|
|
|
|
("C-h F" . helpful-function)
|
|
|
|
:map helpful-mode-map
|
|
|
|
("<remap> <revert-buffer>" . helpful-update)))
|
|
|
|
|
|
|
|
;; Bind extra `describe-*' commands
|
|
|
|
(keymap-global-set "C-h K" #'describe-keymap)
|
|
|
|
|
|
|
|
;; turn on spell checking, if available.
|
|
|
|
(use-package ispell
|
|
|
|
:custom
|
2024-06-16 06:54:01 +01:00
|
|
|
(ispell-dictionary "en_GB")
|
|
|
|
(ispell-personal-dictionary (locate-user-emacs-file "dictionary")))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package flyspell
|
|
|
|
:hook ((text-mode . flyspell-mode)
|
|
|
|
(prog-mode . flyspell-prog-mode))
|
|
|
|
:init
|
|
|
|
(require 'ispell)
|
2024-06-04 08:09:58 +01:00
|
|
|
(require 'org) ; Fails without org-mode-map for some reason...
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
|
|
|
(flyspell-mode-line-string nil)
|
|
|
|
(flyspell-use-meta-tab nil)
|
|
|
|
:config
|
|
|
|
(require 'flyspell-correct)
|
|
|
|
(require 'consult-flyspell))
|
|
|
|
|
|
|
|
(use-package flyspell-correct
|
|
|
|
:after flyspell
|
|
|
|
:bind ( :map flyspell-mode-map
|
|
|
|
("C-;" . flyspell-correct-wrapper)))
|
|
|
|
|
|
|
|
(use-package consult-flyspell
|
|
|
|
:after (consult flyspell)
|
|
|
|
:bind ( :map flyspell-mode-map
|
|
|
|
("C-c s ;" . consult-flyspell))
|
2024-06-04 08:09:58 +01:00
|
|
|
:custom
|
|
|
|
(consult-flyspell-always-check-buffer t))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package ibuffer
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines ibuffer-filter-groups
|
2024-04-17 11:43:59 +01:00
|
|
|
:bind (("C-c b" . ibuffer)))
|
|
|
|
|
2024-05-22 10:03:56 +01:00
|
|
|
(use-package ace-window
|
|
|
|
:bind (("<remap> <other-window>" . ace-window))
|
|
|
|
:custom
|
|
|
|
(aw-scope 'frame)
|
|
|
|
(aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)))
|
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(use-package link-hint
|
|
|
|
:bind (("C-c l o" . link-hint-open-link)
|
|
|
|
("C-c l c" . link-hint-copy-link)
|
|
|
|
("C-c l C-o" . link-hint-open-all-link)
|
|
|
|
("C-c l C-c" . link-hint-copy-all-link)))
|
|
|
|
|
|
|
|
(use-package avy
|
2024-05-31 10:29:11 +01:00
|
|
|
:bind (("<remap> <goto-char>" . avy-goto-char)))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-06-19 08:35:50 +01:00
|
|
|
(use-package comint
|
|
|
|
:bind ( :map comint-mode-map
|
|
|
|
("<remap> <comint-history-isearch-backward-regexp>" . consult-history)))
|
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(use-package shell
|
|
|
|
:bind (("C-c t s" . shell)))
|
|
|
|
|
|
|
|
(use-package eshell
|
2024-06-19 08:35:50 +01:00
|
|
|
:bind (("C-c t e" . eshell))
|
|
|
|
:config
|
|
|
|
(require 'esh-mode))
|
|
|
|
|
|
|
|
(use-package esh-mode
|
2024-06-18 18:10:46 +01:00
|
|
|
:defines eshell-mode-map
|
2024-06-19 08:35:50 +01:00
|
|
|
:bind ( :map eshell-mode-map
|
|
|
|
("<remap> <eshell-previous-matching-input>" . consult-history)))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-06-14 18:04:02 +01:00
|
|
|
(use-package calc
|
|
|
|
:bind (("<Calculator>" . calc)))
|
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package xref
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
2024-06-04 08:09:58 +01:00
|
|
|
(xref-show-definitions-function 'xref-show-definitions-completing-read))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-07-02 17:50:24 +01:00
|
|
|
(use-package appt
|
|
|
|
:custom
|
|
|
|
(appt-display-diary nil)
|
|
|
|
(appt-display-format 'echo))
|
|
|
|
|
2024-04-19 14:55:46 +01:00
|
|
|
(use-package calendar
|
2024-07-02 17:50:24 +01:00
|
|
|
:after appt
|
2024-04-24 13:28:09 +01:00
|
|
|
:bind (("C-c >" . calendar))
|
2024-06-29 14:13:50 +01:00
|
|
|
:hook ((calendar-today-visible . calendar-mark-today))
|
2024-04-19 14:55:46 +01:00
|
|
|
:custom
|
|
|
|
(calendar-date-style 'iso)
|
|
|
|
(calendar-mark-holidays-flag t)
|
|
|
|
(calendar-mark-diary-entries-flag nil)
|
|
|
|
(calendar-view-holidays-initially-flag nil)
|
2024-06-27 09:18:45 +01:00
|
|
|
(calendar-view-diary-initially-flag nil)
|
|
|
|
:config
|
2024-07-02 17:50:24 +01:00
|
|
|
(appt-activate +1)
|
2024-06-27 09:18:45 +01:00
|
|
|
(add-to-list 'display-buffer-alist
|
|
|
|
'("\\*Calendar\\*"
|
|
|
|
(display-buffer-in-side-window)
|
|
|
|
(side . bottom)
|
|
|
|
(slot . 0)
|
|
|
|
(window-height . 0.2)
|
|
|
|
(window-parameters . ((no-delete-other-windows . t))))))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(add-hook 'prog-mode-hook #'(lambda () (display-line-numbers-mode +1)))
|
|
|
|
|
|
|
|
(use-package which-key
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions which-key-mode
|
2024-04-17 11:43:59 +01:00
|
|
|
:config (which-key-mode +1))
|
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package elec-pair
|
|
|
|
:config
|
|
|
|
(electric-pair-mode +1))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package paren
|
|
|
|
:config
|
|
|
|
(show-paren-mode +1))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
;; add visual pulse when changing focus, like beacon but built-in
|
|
|
|
;; from from https://karthinks.com/software/batteries-included-with-emacs/
|
|
|
|
(defun pulse-line (&rest _)
|
|
|
|
"Pulse the current line."
|
|
|
|
(pulse-momentary-highlight-one-line (point)))
|
|
|
|
|
2024-05-10 14:18:42 +01:00
|
|
|
(use-package base16-theme
|
2024-06-06 17:26:46 +01:00
|
|
|
:demand
|
2024-06-08 07:13:55 +01:00
|
|
|
:defines (base16-one-light-theme-colors
|
2024-06-06 17:26:46 +01:00
|
|
|
my/load-theme-and-configure)
|
|
|
|
:hook (server-after-make-frame . my/load-theme-and-configure)
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
2024-05-14 17:02:09 +01:00
|
|
|
(base16-theme-distinct-fringe-background nil)
|
2024-05-10 14:18:42 +01:00
|
|
|
(base16-theme-highlight-mode-line 'contrast)
|
2024-06-06 17:26:46 +01:00
|
|
|
:init
|
|
|
|
(defun my/load-theme-and-configure ()
|
|
|
|
"Load theme and configure some faces."
|
2024-06-08 07:13:55 +01:00
|
|
|
(load-theme 'base16-one-light t)
|
2024-06-06 17:26:46 +01:00
|
|
|
|
|
|
|
;; Change outline headers to follow rainbow order
|
|
|
|
(require 'outline)
|
|
|
|
(dolist (pairing '((outline-1 . :base08)
|
|
|
|
(outline-2 . :base09)
|
|
|
|
(outline-3 . :base0A)
|
|
|
|
(outline-4 . :base0B)
|
|
|
|
(outline-5 . :base0C)
|
|
|
|
(outline-6 . :base0D)
|
|
|
|
(outline-7 . :base0E)
|
|
|
|
(outline-8 . :base0F)))
|
|
|
|
(set-face-attribute (car pairing) nil
|
|
|
|
:foreground
|
2024-06-08 07:13:55 +01:00
|
|
|
(plist-get base16-one-light-theme-colors (cdr pairing)))))
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
2024-06-06 17:26:46 +01:00
|
|
|
(if (display-graphic-p) (my/load-theme-and-configure)))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package nerd-icons
|
2024-06-06 17:26:46 +01:00
|
|
|
:functions (nerd-icons-octicon))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package nerd-icons-dired
|
2024-05-31 10:01:41 +01:00
|
|
|
:diminish
|
2024-06-04 11:21:20 +01:00
|
|
|
:requires nerd-icons
|
2024-04-17 11:43:59 +01:00
|
|
|
:hook (dired-mode))
|
|
|
|
|
|
|
|
(use-package nerd-icons-ibuffer
|
2024-05-31 10:01:41 +01:00
|
|
|
:diminish
|
2024-06-04 11:21:20 +01:00
|
|
|
:requires nerd-icons
|
2024-04-17 11:43:59 +01:00
|
|
|
:hook (ibuffer-mode))
|
|
|
|
|
|
|
|
(use-package nerd-icons-completion
|
2024-05-31 10:01:41 +01:00
|
|
|
:diminish
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions nerd-icons-completion-mode
|
2024-06-04 11:21:20 +01:00
|
|
|
:requires nerd-icons
|
|
|
|
:hook (after-init . (lambda () (nerd-icons-completion-mode +1))))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package ligature
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions (ligature-set-ligatures
|
|
|
|
global-ligature-mode)
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
|
|
|
(ligature-set-ligatures
|
|
|
|
'(text-mode prog-mode org-mode)
|
2024-07-03 16:46:23 +01:00
|
|
|
'("<--" "<---" "<-" "->" "-->" "--->"
|
|
|
|
"<==" "<===" "<=" "=>" "==>" "===>"
|
|
|
|
"<->" "<-->" "<--->" "<---->"
|
|
|
|
"<=>" "<==>" "<===>" "<====>"
|
|
|
|
"==" "!=" "===" "!==" "!==="
|
|
|
|
"<|" "<|>" "|>" "<>" "</" "</>" "/>"
|
|
|
|
"/*" "*/" "+++" "<~~" "~~>" "<!---" "---!>"))
|
2024-04-17 11:43:59 +01:00
|
|
|
(global-ligature-mode +1))
|
|
|
|
|
|
|
|
(use-package whitespace
|
|
|
|
:custom
|
|
|
|
(whitespace-style '(face
|
|
|
|
empty
|
|
|
|
trailing
|
|
|
|
tab-mark
|
|
|
|
indentation::space))
|
|
|
|
(whitespace-action '(report-on-bogus
|
|
|
|
cleanup
|
|
|
|
auto-cleanup)))
|
|
|
|
|
|
|
|
(setq mode-line-compact 'long)
|
|
|
|
|
2024-05-23 14:06:34 +01:00
|
|
|
(line-number-mode -1)
|
|
|
|
(column-number-mode -1)
|
2024-05-02 08:53:53 +01:00
|
|
|
(size-indication-mode +1)
|
2024-06-24 06:36:59 +01:00
|
|
|
|
2024-06-29 13:04:07 +01:00
|
|
|
;; (require 'battery)
|
|
|
|
;; (when (and battery-status-function
|
|
|
|
;; (not ( string-match-p "unknown"
|
|
|
|
;; ( battery-format "%B"
|
|
|
|
;; (funcall battery-status-function)))))
|
|
|
|
;; (display-battery-mode +1))
|
2024-06-24 06:36:59 +01:00
|
|
|
|
2024-06-25 14:26:24 +01:00
|
|
|
(use-package time
|
|
|
|
:custom
|
2024-06-29 13:04:07 +01:00
|
|
|
(display-time-24hr-format t))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package diff-hl
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions (diff-hl-magit-pre-refresh
|
|
|
|
diff-hl-magit-post-refresh
|
|
|
|
global-diff-hl-mode)
|
2024-04-17 11:43:59 +01:00
|
|
|
:init
|
|
|
|
(add-hook 'magit-pre-refresh-hook #'diff-hl-magit-pre-refresh)
|
|
|
|
(add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh)
|
|
|
|
:custom
|
|
|
|
(diff-hl-disable-on-remote t)
|
2024-05-16 07:13:20 +01:00
|
|
|
(diff-hl-draw-borders t)
|
|
|
|
:config
|
|
|
|
(global-diff-hl-mode))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(setq split-height-threshold nil
|
|
|
|
split-width-threshold 160)
|
|
|
|
|
|
|
|
(use-package winner
|
|
|
|
:demand
|
|
|
|
:config
|
|
|
|
(winner-mode))
|
|
|
|
|
|
|
|
(use-package ediff
|
|
|
|
:bind (("C-c d f" . ediff-files)
|
|
|
|
("C-c d b" . ediff-buffers)
|
|
|
|
("C-c d 3 f" . ediff-files3)
|
|
|
|
("C-c d 3 b" . ediff-buffers3))
|
|
|
|
:custom
|
|
|
|
(ediff-window-setup-function #'ediff-setup-windows-plain))
|
|
|
|
|
|
|
|
(use-package emms
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines (emms-browser-mode-map
|
|
|
|
emms-playlist-mode-map)
|
|
|
|
:functions (emms-all
|
|
|
|
emms-default-players
|
|
|
|
emms-mpris-enable
|
|
|
|
emms-cache-enable
|
|
|
|
emms-show)
|
2024-04-17 11:43:59 +01:00
|
|
|
:bind (("C-c e e" . emms-smart-browse)
|
|
|
|
("C-c e p" . emms-pause)
|
|
|
|
("C-c e s" . emms-stop)
|
|
|
|
("C-c e z" . emms-toggle-repeat-track)
|
|
|
|
("C-c e C-r" . emms-toggle-repeat-playlist)
|
|
|
|
("C-c e C-b" . emms-browser)
|
|
|
|
("C-c e C-p" . emms-playlist-mode-go)
|
|
|
|
("<XF86AudioPlay>" . emms-pause)
|
|
|
|
("<XF86AudioPrev>" . emms-previous)
|
|
|
|
("<XF86AudioNext>" . emms-next)
|
|
|
|
:map emms-browser-mode-map
|
|
|
|
("e" . emms-smart-browse)
|
|
|
|
("P" . emms-pause)
|
|
|
|
("S" . emms-stop)
|
|
|
|
("z" . emms-toggle-repeat-track)
|
|
|
|
:map emms-playlist-mode-map
|
|
|
|
("e" . emms-smart-browse))
|
|
|
|
:custom
|
|
|
|
(emms-source-file-default-directory "~/Music/")
|
|
|
|
(emms-lyrics-dir (expand-file-name "lyrics" "~/Music/"))
|
|
|
|
(emms-browser-covers #'emms-browser-cache-thumbnail-async)
|
|
|
|
(emms-browser-default-covers (list (expand-file-name "placeholder.jpg" "~/Music/")))
|
|
|
|
(emms-repeat-playlist t)
|
|
|
|
:config
|
|
|
|
(emms-all)
|
|
|
|
(emms-default-players)
|
|
|
|
(emms-mpris-enable)
|
|
|
|
(emms-cache-enable)
|
|
|
|
(add-hook 'emms-player-started-hook #'emms-show))
|
|
|
|
|
|
|
|
(use-package org
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines org-mode-map
|
2024-05-15 07:42:38 +01:00
|
|
|
:hook ((org-mode . turn-on-auto-fill))
|
2024-06-19 08:35:50 +01:00
|
|
|
:bind ( :map org-mode-map
|
|
|
|
("<remap> <imenu>" . consult-org-heading)
|
|
|
|
("<remap> <org-goto>" . consult-org-heading))
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
2024-05-15 07:55:32 +01:00
|
|
|
(org-directory "~/Documents/org")
|
2024-04-18 14:24:49 +01:00
|
|
|
(org-default-notes-file (expand-file-name "notes.org" org-directory))
|
2024-06-22 12:37:41 +01:00
|
|
|
(org-archive-location "::* Archived Tasks")
|
2024-06-27 06:30:36 +01:00
|
|
|
(org-hide-emphasis-markers t)
|
|
|
|
(org-use-sub-superscripts '{})
|
2024-06-10 14:34:47 +01:00
|
|
|
(org-pretty-entities t)
|
2024-04-18 14:24:49 +01:00
|
|
|
(org-pretty-entities-include-sub-superscripts t)
|
|
|
|
(org-fontify-done-headline t)
|
|
|
|
(org-fontify-todo-headline t)
|
|
|
|
(org-fontify-emphasized-text t)
|
|
|
|
(org-fontify-quote-and-verse-blocks t)
|
|
|
|
(org-tags-column 0)
|
|
|
|
(org-enforce-todo-dependencies t)
|
|
|
|
(org-enforce-todo-checkbox-dependencies t)
|
2024-04-17 11:43:59 +01:00
|
|
|
(org-yank-folded-subtrees nil)
|
|
|
|
(org-yank-adjusted-subtrees t)
|
2024-05-22 16:03:56 +01:00
|
|
|
(org-display-remote-inline-images 'cache)
|
2024-04-17 11:43:59 +01:00
|
|
|
(org-M-RET-may-split-line '((default . nil)
|
|
|
|
(headline . nil)
|
|
|
|
(item . nil)
|
2024-06-03 18:16:53 +01:00
|
|
|
(table . t))))
|
2024-04-25 17:09:37 +01:00
|
|
|
|
2024-06-27 06:30:36 +01:00
|
|
|
(use-package ox
|
|
|
|
:after org
|
|
|
|
:custom
|
|
|
|
(org-export-with-sub-superscripts org-use-sub-superscripts))
|
|
|
|
|
2024-04-25 17:09:37 +01:00
|
|
|
(use-package org-faces
|
2024-05-11 14:04:38 +01:00
|
|
|
:after org
|
2024-04-25 17:09:37 +01:00
|
|
|
:config
|
2024-04-19 10:12:21 +01:00
|
|
|
;; Ensure tables and src blocks use fixed-pitch font.
|
2024-05-11 14:04:38 +01:00
|
|
|
(set-face-attribute 'org-block nil :inherit 'fixed-pitch)
|
|
|
|
(set-face-attribute 'org-code nil :inherit 'fixed-pitch)
|
|
|
|
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
|
2024-05-14 17:02:09 +01:00
|
|
|
(set-face-attribute 'org-verbatim nil :inherit 'org-code)
|
2024-04-17 11:43:59 +01:00
|
|
|
;; Let quote and verse blocks use variable-pitch font, if configured
|
|
|
|
(set-face-attribute 'org-quote nil :inherit 'variable-pitch)
|
2024-04-25 17:09:37 +01:00
|
|
|
(set-face-attribute 'org-verse nil :inherit 'variable-pitch))
|
2024-04-18 14:24:49 +01:00
|
|
|
|
|
|
|
(use-package org-keys
|
2024-05-15 07:42:38 +01:00
|
|
|
:after org
|
2024-04-18 14:24:49 +01:00
|
|
|
:custom
|
|
|
|
(org-return-follows-link t)
|
|
|
|
(org-mouse-1-follows-link t))
|
|
|
|
|
|
|
|
(use-package org-indent
|
|
|
|
:after org
|
|
|
|
:hook org-mode)
|
|
|
|
|
2024-05-15 07:42:38 +01:00
|
|
|
(use-package org-attach
|
2024-04-19 14:55:46 +01:00
|
|
|
:after org
|
2024-05-15 07:42:38 +01:00
|
|
|
:custom
|
2024-05-26 22:10:03 +01:00
|
|
|
(org-attach-id-dir (expand-file-name "data/" org-directory))
|
|
|
|
(org-attach-dir-relative t)
|
|
|
|
(org-attach-use-inheritance t))
|
2024-05-15 07:42:38 +01:00
|
|
|
|
|
|
|
(use-package org-refile
|
|
|
|
:after (org org-agenda)
|
2024-04-18 14:24:49 +01:00
|
|
|
:custom
|
|
|
|
(org-outline-path-complete-in-steps nil)
|
|
|
|
(org-refile-use-outline-path t)
|
|
|
|
(org-refile-allow-creating-parent-nodes t)
|
|
|
|
(org-refile-use-outline-path 'file)
|
2024-06-05 19:43:58 +01:00
|
|
|
(org-refile-targets '((nil . (:maxlevel . 3))
|
|
|
|
(org-agenda-files . (:maxlevel . 3)))))
|
2024-04-18 14:24:49 +01:00
|
|
|
|
|
|
|
(use-package org-src
|
2024-05-15 07:42:38 +01:00
|
|
|
:after org
|
2024-04-18 14:24:49 +01:00
|
|
|
:custom
|
|
|
|
(org-src-window-setup 'current-window))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-05-20 14:07:51 +01:00
|
|
|
(use-package ob-core
|
|
|
|
:after org
|
2024-07-02 17:50:24 +01:00
|
|
|
:hook ((org-babel-after-execute . org-redisplay-inline-images))
|
|
|
|
:config
|
|
|
|
(let (babel-languages)
|
|
|
|
(push '(lua . t) babel-languages)
|
|
|
|
(push '(python . t) babel-languages)
|
|
|
|
(push '(emacs-lisp . t) babel-languages)
|
|
|
|
(org-babel-do-load-languages 'org-babel-load-languages babel-languages)))
|
2024-05-20 14:07:51 +01:00
|
|
|
|
2024-05-22 09:40:23 +01:00
|
|
|
(use-package ob-python
|
|
|
|
:after ob-core
|
|
|
|
:custom
|
|
|
|
(org-babel-python-command "python3"))
|
|
|
|
|
2024-04-18 09:24:03 +01:00
|
|
|
(use-package org-capture
|
|
|
|
:after org
|
2024-07-02 17:50:24 +01:00
|
|
|
:bind ("C-c n" . org-capture))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package org-roam
|
|
|
|
:after org
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines org-roam-directory
|
|
|
|
:functions org-roam-db-autosync-mode
|
2024-04-19 14:55:46 +01:00
|
|
|
:bind (("C-c r i" . org-roam-node-insert)
|
|
|
|
("C-c r f" . org-roam-node-find)
|
2024-05-17 11:30:49 +01:00
|
|
|
("C-c r n" . org-roam-capture)
|
2024-07-01 11:09:15 +01:00
|
|
|
("C-c r j" . org-roam-dailies-capture-today)
|
|
|
|
("M-g j" . org-roam-dailies-goto-today)
|
2024-07-01 13:30:08 +01:00
|
|
|
("M-g C-j" . org-roam-dailies-goto-date)
|
2024-05-17 11:30:49 +01:00
|
|
|
:map org-mode-map
|
|
|
|
("C-c r b" . org-roam-buffer-toggle))
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
|
|
|
(org-roam-directory (expand-file-name "roam" org-directory))
|
|
|
|
(org-roam-completion-everywhere nil)
|
2024-05-15 07:42:38 +01:00
|
|
|
(org-roam-node-display-template (concat
|
|
|
|
"${title:*} "
|
|
|
|
(propertize "${tags:24}" 'face 'org-tag)))
|
2024-06-22 12:37:41 +01:00
|
|
|
(org-roam-capture-templates '(("d" "default" plain "%?"
|
|
|
|
:target (file+head "${slug}.org" "#+title: ${title}\n")
|
|
|
|
:unnarrowed t)))
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
|
|
|
(mkdir org-roam-directory t)
|
|
|
|
(add-to-list 'display-buffer-alist
|
|
|
|
'("\\*org-roam\\*"
|
|
|
|
(display-buffer-in-side-window)
|
|
|
|
(side . right)
|
|
|
|
(slot . 0)
|
|
|
|
(window-width . 0.33)
|
2024-06-27 09:18:45 +01:00
|
|
|
(window-parameters . ((no-delete-other-windows . t)))))
|
2024-04-17 11:43:59 +01:00
|
|
|
(org-roam-db-autosync-mode +1))
|
|
|
|
|
2024-07-01 11:09:15 +01:00
|
|
|
(use-package org-roam-dailies
|
|
|
|
:custom
|
|
|
|
(org-roam-dailies-directory "./")
|
|
|
|
(org-roam-dailies-capture-templates
|
|
|
|
'(("d" "default" entry
|
2024-07-02 17:50:24 +01:00
|
|
|
"* %<%H:%M> %?"
|
2024-07-01 11:09:15 +01:00
|
|
|
:target (file+datetree "journal.org.gpg" week)))))
|
|
|
|
|
2024-04-19 14:55:46 +01:00
|
|
|
(use-package org-agenda
|
2024-07-02 17:50:24 +01:00
|
|
|
:after (org appt)
|
2024-04-19 14:55:46 +01:00
|
|
|
:bind (("C-c a" . org-agenda))
|
2024-07-02 17:50:24 +01:00
|
|
|
:hook (org-agenda-finalize . org-agenda-to-appt)
|
2024-04-19 14:55:46 +01:00
|
|
|
:custom
|
|
|
|
(org-agenda-span 'week)
|
|
|
|
(org-agenda-start-on-weekday 1)
|
|
|
|
(org-agenda-sticky nil)
|
|
|
|
(org-agenda-window-setup 'current-window)
|
|
|
|
(org-agenda-tags-column 0)
|
2024-07-01 13:30:08 +01:00
|
|
|
(org-agenda-diary-file (expand-file-name "calendar/diary.org.gpg" org-directory))
|
|
|
|
(org-agenda-include-diary nil)
|
2024-04-19 14:55:46 +01:00
|
|
|
(org-agenda-include-deadlines t)
|
|
|
|
(org-agenda-todo-ignore-scheduled 'future)
|
|
|
|
(org-agenda-todo-ignore-deadlines 'far)
|
|
|
|
(org-agenda-prefix-format '((agenda . " %-12:c%?-12t% s")
|
|
|
|
(todo . " %-12:c")
|
|
|
|
(tags . " %-12:c")
|
|
|
|
(search . " %-12:c")))
|
2024-06-05 19:43:58 +01:00
|
|
|
(org-agenda-file-regexp "\\`[^.].*\\.org\\\(\\.gpg\\\)?\\'")
|
2024-04-19 14:55:46 +01:00
|
|
|
(org-agenda-files (list
|
|
|
|
(expand-file-name org-directory)
|
2024-07-01 13:30:08 +01:00
|
|
|
(expand-file-name "calendar" org-directory)
|
2024-07-02 17:50:24 +01:00
|
|
|
(expand-file-name "roam/journal.org.gpg" org-directory)))
|
|
|
|
:config
|
|
|
|
(appt-activate +1))
|
2024-04-19 14:55:46 +01:00
|
|
|
|
|
|
|
(use-package ox-icalendar
|
|
|
|
:after org
|
|
|
|
:custom
|
|
|
|
(org-icalendar-store-UID t)
|
|
|
|
(org-icalendar-alarm-time 15)
|
|
|
|
(org-icalendar-include-body t)
|
|
|
|
(org-icalendar-include-sexps t)
|
|
|
|
(org-icalendar-include-todo t)
|
|
|
|
(org-icalendar-combined-name "org-mode")
|
|
|
|
(org-icalendar-combined-description "Emacs org-mode combined export"))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package org-noter
|
2024-05-15 07:42:38 +01:00
|
|
|
:after (org doc-view citar)
|
2024-06-04 08:09:58 +01:00
|
|
|
:commands org-noter
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
|
|
|
(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-doc-property-in-notes t)
|
2024-05-23 07:42:34 +01:00
|
|
|
(org-noter-notes-search-path
|
|
|
|
(list (expand-file-name "notes" org-directory)
|
|
|
|
(car citar-notes-paths)))
|
2024-04-17 11:43:59 +01:00
|
|
|
(org-noter-prefer-root-as-file-level nil))
|
|
|
|
|
|
|
|
(use-package citar
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines (citar-bibliography
|
|
|
|
citar-indicators)
|
|
|
|
:functions (citar-indicator-create
|
|
|
|
citar-has-files
|
|
|
|
citar-has-links
|
|
|
|
citar-has-notes
|
|
|
|
citar-is-cited)
|
|
|
|
:hook
|
|
|
|
(LaTeX-mode . citar-capf-setup)
|
|
|
|
(org-mode . citar-capf-setup)
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
2024-05-30 18:26:27 +01:00
|
|
|
(citar-bibliography
|
2024-05-23 07:42:34 +01:00
|
|
|
(list
|
|
|
|
(expand-file-name "citar/main.bib" org-directory)))
|
|
|
|
(citar-notes-paths
|
|
|
|
(list
|
|
|
|
(expand-file-name "citar/notes/" org-directory)))
|
2024-06-13 10:25:05 +01:00
|
|
|
(citar-library-paths
|
|
|
|
(list
|
|
|
|
(expand-file-name "~/Documents/library/")))
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
2024-05-30 18:26:27 +01:00
|
|
|
(require 'org)
|
2024-04-17 11:43:59 +01:00
|
|
|
(require 'nerd-icons)
|
|
|
|
(require 'citar-embark)
|
2024-05-30 18:26:27 +01:00
|
|
|
(setopt org-cite-insert-processor 'citar
|
|
|
|
org-cite-follow-processor 'citar
|
|
|
|
org-cite-activate-processor 'citar)
|
|
|
|
(dolist (bibfile citar-bibliography)
|
|
|
|
(add-to-list 'org-cite-global-bibliography bibfile))
|
2024-04-17 11:43:59 +01:00
|
|
|
(defvar citar-indicator-files-icons
|
|
|
|
(citar-indicator-create
|
|
|
|
:symbol (nerd-icons-octicon
|
|
|
|
"nf-oct-file"
|
|
|
|
:face 'nerd-icons-green
|
|
|
|
:v-adjust -0.1)
|
|
|
|
:function #'citar-has-files
|
|
|
|
:padding " " ; need this because the default padding is too low for these icons
|
|
|
|
:tag "has:files"))
|
|
|
|
(defvar citar-indicator-links-icons
|
|
|
|
(citar-indicator-create
|
|
|
|
:symbol (nerd-icons-octicon
|
|
|
|
"nf-oct-link"
|
|
|
|
:face 'nerd-icons-orange
|
|
|
|
:v-adjust 0.01)
|
|
|
|
:function #'citar-has-links
|
|
|
|
:padding " " ; need this because the default padding is too low for these icons
|
|
|
|
:tag "has:links"))
|
|
|
|
(defvar citar-indicator-notes-icons
|
|
|
|
(citar-indicator-create
|
|
|
|
:symbol (nerd-icons-octicon
|
|
|
|
"nf-oct-note"
|
|
|
|
:face 'nerd-icons-blue
|
|
|
|
:v-adjust -0.3)
|
|
|
|
:function #'citar-has-notes
|
|
|
|
:padding " " ; need this because the default padding is too low for these icons
|
|
|
|
:tag "has:notes"))
|
|
|
|
(defvar citar-indicator-cited-icons
|
|
|
|
(citar-indicator-create
|
|
|
|
:symbol (nerd-icons-octicon
|
|
|
|
"nf-oct-circle"
|
|
|
|
:face 'nerd-icon-green)
|
|
|
|
:function #'citar-is-cited
|
|
|
|
:padding " " ; need this because the default padding is too low for these icons
|
|
|
|
:tag "is:cited"))
|
|
|
|
(setq citar-indicators (list citar-indicator-files-icons
|
|
|
|
citar-indicator-links-icons
|
|
|
|
citar-indicator-notes-icons
|
|
|
|
citar-indicator-cited-icons)))
|
|
|
|
|
|
|
|
(use-package citar-embark
|
2024-05-29 14:59:50 +01:00
|
|
|
:diminish
|
2024-06-04 08:09:58 +01:00
|
|
|
:requires citar
|
|
|
|
:functions citar-embark-mode
|
2024-04-17 11:43:59 +01:00
|
|
|
:init
|
2024-05-30 18:26:27 +01:00
|
|
|
(require 'embark)
|
|
|
|
:config
|
2024-04-17 11:43:59 +01:00
|
|
|
(citar-embark-mode +1))
|
|
|
|
|
|
|
|
(setq org-latex-compiler "lualatex")
|
|
|
|
(setq org-preview-latex-default-process 'dvisvgm)
|
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package vertico
|
|
|
|
:functions vertico-mode
|
2024-06-04 11:21:20 +01:00
|
|
|
:hook (after-init . (lambda () (vertico-mode +1)))
|
2024-06-04 08:09:58 +01:00
|
|
|
:custom
|
|
|
|
(vertico-cycle t)
|
2024-06-04 11:21:20 +01:00
|
|
|
(require 'vertico-directory)
|
|
|
|
(require 'marginalia)
|
|
|
|
(require 'orderless))
|
2024-06-04 08:09:58 +01:00
|
|
|
|
|
|
|
(use-package marginalia
|
|
|
|
:functions marginalia-mode
|
|
|
|
:custom
|
|
|
|
(marginalia-annotators '(marginalia-annotators-heavy
|
|
|
|
marginalia-annotators-light
|
|
|
|
nil))
|
|
|
|
:config (marginalia-mode +1))
|
|
|
|
|
|
|
|
(use-package orderless
|
|
|
|
:custom
|
|
|
|
(completion-styles '(orderless basic))
|
|
|
|
(completion-category-defaults nil)
|
2024-06-06 05:47:49 +01:00
|
|
|
(completion-category-overrides '((file (styles basic partial-completion))
|
|
|
|
(eglot (styles orderless))
|
|
|
|
(eglot-capf (styles orderless)))))
|
2024-06-04 08:09:58 +01:00
|
|
|
|
2024-06-10 08:10:45 +01:00
|
|
|
(use-package nerd-icons-corfu
|
|
|
|
:diminish
|
|
|
|
:functions nerd-icons-corfu-formatter
|
|
|
|
:requires nerd-icons)
|
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package corfu
|
2024-06-04 10:04:35 +01:00
|
|
|
:defines (corfu-map
|
2024-06-06 17:26:46 +01:00
|
|
|
corfu-mode-map
|
|
|
|
corfu-margin-formatters)
|
2024-06-04 11:21:20 +01:00
|
|
|
:functions (corfu-mode
|
|
|
|
global-corfu-mode
|
2024-06-04 08:09:58 +01:00
|
|
|
corfu-history-mode)
|
2024-06-04 11:21:20 +01:00
|
|
|
:hook (minibuffer-setup . (lambda ()
|
|
|
|
"Enable `corfu-mode' for `M-:' and `M-!'."
|
|
|
|
(when (local-variable-p 'completion-at-point-functions)
|
|
|
|
(corfu-mode +1))))
|
2024-06-04 08:09:58 +01:00
|
|
|
:bind ( :map corfu-map
|
|
|
|
("M-SPC" . corfu-insert-separator)
|
|
|
|
("RET" . nil)
|
|
|
|
("TAB" . corfu-insert)
|
|
|
|
([tab] . corfu-insert))
|
2024-06-04 11:21:20 +01:00
|
|
|
:init
|
|
|
|
(global-corfu-mode +1)
|
2024-06-04 08:09:58 +01:00
|
|
|
:custom
|
|
|
|
(corfu-cycle t)
|
|
|
|
(corfu-auto nil)
|
2024-06-12 07:28:50 +01:00
|
|
|
(corfu-preselect 'directory)
|
2024-06-04 08:09:58 +01:00
|
|
|
:config
|
2024-06-12 07:28:50 +01:00
|
|
|
(require 'corfu-history)
|
2024-06-10 08:10:45 +01:00
|
|
|
(when (require 'nerd-icons-corfu nil :noerror)
|
|
|
|
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
|
|
|
|
(when (require 'corfu-popupinfo nil :noerror)
|
|
|
|
(corfu-popupinfo-mode +1))
|
|
|
|
(when (and (require 'corfu-terminal nil :noerror)
|
|
|
|
(not (display-graphic-p)))
|
|
|
|
(corfu-terminal-mode +1)))
|
2024-06-04 08:09:58 +01:00
|
|
|
|
2024-06-12 07:28:50 +01:00
|
|
|
(use-package corfu-history
|
|
|
|
:requires (corfu savehist)
|
|
|
|
:functions corfu-history
|
|
|
|
:config
|
|
|
|
(add-to-list 'savehist-additional-variables #'corfu-history))
|
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package corfu-popupinfo
|
|
|
|
:requires corfu
|
2024-06-04 11:21:20 +01:00
|
|
|
:defines corfu-popupinfo-map
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions corfu-popupinfo-mode
|
2024-06-10 08:10:45 +01:00
|
|
|
:bind ( :map corfu-popupinfo-map
|
|
|
|
("M-d" . corfu-popupinfo-toggle)
|
|
|
|
("M-n" . corfu-popupinfo-scroll-up)
|
|
|
|
("M-p" . corfu-popupinfo-scroll-down))
|
|
|
|
:custom
|
|
|
|
(corfu-popupinfo-delay 0.3))
|
2024-06-04 08:09:58 +01:00
|
|
|
|
|
|
|
(use-package corfu-terminal
|
|
|
|
:requires corfu
|
2024-06-10 08:10:45 +01:00
|
|
|
:functions corfu-terminal-mode)
|
2024-06-04 08:09:58 +01:00
|
|
|
|
|
|
|
(use-package cape
|
|
|
|
:after corfu
|
2024-06-04 11:21:20 +01:00
|
|
|
:functions (cape-emoji
|
|
|
|
cape-file
|
|
|
|
cape-dabbrev)
|
|
|
|
:hook ((conf-mode prog-mode text-mode) . (lambda ()
|
|
|
|
(dolist (cape-fn '(cape-dabbrev
|
|
|
|
cape-file
|
|
|
|
cape-emoji))
|
|
|
|
(add-hook 'completion-at-point-functions cape-fn nil t))))
|
2024-06-04 08:09:58 +01:00
|
|
|
:custom
|
|
|
|
(cape-dabbrev-min-length (+ corfu-auto-prefix 1)))
|
|
|
|
|
|
|
|
(use-package consult
|
2024-06-19 08:35:50 +01:00
|
|
|
:functions (consult-org-heading
|
|
|
|
consult-history)
|
2024-06-04 08:09:58 +01:00
|
|
|
:bind (("<remap> <imenu>" . consult-imenu)
|
|
|
|
("<remap> <switch-to-buffer>" . consult-buffer)
|
|
|
|
("<remap> <project-switch-to-buffer>" . consult-project-buffer)
|
|
|
|
("C-c s l" . consult-line)
|
|
|
|
("C-c s o" . consult-outline)
|
|
|
|
("C-c s f" . consult-fd)
|
|
|
|
("C-c s g" . consult-ripgrep)
|
|
|
|
("C-c s e" . consult-flymake)
|
|
|
|
("C-c s i" . consult-info)
|
|
|
|
:map minibuffer-local-map
|
2024-06-19 08:35:50 +01:00
|
|
|
("<remap> <previous-matching-history-element>" . consult-history)))
|
2024-06-04 08:09:58 +01:00
|
|
|
|
|
|
|
(use-package consult-eglot
|
|
|
|
:after (consult eglot)
|
|
|
|
:bind (("C-c s s" . consult-eglot-symbols)))
|
|
|
|
|
|
|
|
(use-package embark
|
|
|
|
:functions embark-prefix-help-command
|
|
|
|
:bind (("<remap> <describe-bindings>" . embark-bindings)
|
|
|
|
("C-." . embark-act))
|
|
|
|
:config
|
|
|
|
(setq prefix-help-command #'embark-prefix-help-command))
|
|
|
|
|
|
|
|
(use-package embark-consult
|
|
|
|
:after (embark consult)
|
|
|
|
:hook (embark-collect-mode . consult-preview-at-point-mode))
|
|
|
|
|
|
|
|
(use-package tempel
|
|
|
|
:defines tempel-path
|
|
|
|
:functions (tempel-expand
|
2024-06-04 11:21:20 +01:00
|
|
|
tempel-abbrev-mode)
|
2024-06-04 08:09:58 +01:00
|
|
|
:bind (("M-+" . tempel-complete)
|
|
|
|
("M-*" . tempel-insert))
|
2024-07-01 18:09:39 +01:00
|
|
|
:hook ((conf-mode prog-mode text-mode) . (lambda () (add-hook 'completion-at-point-functions 'tempel-complete nil t)))
|
2024-06-04 08:09:58 +01:00
|
|
|
:custom
|
2024-06-04 11:21:20 +01:00
|
|
|
(tempel-trigger-prefix "<"))
|
2024-06-04 08:09:58 +01:00
|
|
|
|
2024-05-04 10:06:38 +01:00
|
|
|
(require 'tramp)
|
2024-04-17 11:43:59 +01:00
|
|
|
(setq org-publish-project-alist
|
2024-05-04 10:06:38 +01:00
|
|
|
`(("xenia.me.uk"
|
2024-05-13 07:57:39 +01:00
|
|
|
:base-directory ,(expand-file-name "www/xenia.me.uk" "~/Projects/")
|
2024-04-17 11:43:59 +01:00
|
|
|
:base-extension "org"
|
2024-05-04 11:19:42 +01:00
|
|
|
:exclude "setup.org"
|
2024-04-17 11:43:59 +01:00
|
|
|
:recursive t
|
|
|
|
:publishing-function org-html-publish-to-html
|
2024-05-04 10:06:38 +01:00
|
|
|
:publishing-directory "/sshx:pixelifytica@legion:/var/www/xenia.me.uk"
|
2024-05-04 11:19:42 +01:00
|
|
|
:auto-sitemap t
|
|
|
|
:sitemap-title "Sitemap"
|
2024-04-17 11:43:59 +01:00
|
|
|
:section-numbers nil
|
|
|
|
:with-author t
|
|
|
|
:with-email t
|
|
|
|
:with-toc nil
|
2024-05-04 11:19:42 +01:00
|
|
|
:html-link-home "/"
|
|
|
|
:html-link-up "../"
|
|
|
|
;; :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/style.css\"/>"
|
2024-04-17 11:43:59 +01:00
|
|
|
)))
|
|
|
|
|
|
|
|
(use-package rainbow-delimiters
|
|
|
|
:hook (prog-mode))
|
|
|
|
|
2024-05-23 13:38:13 +01:00
|
|
|
(use-package envrc
|
|
|
|
:hook (after-init . envrc-global-mode)
|
|
|
|
:custom
|
|
|
|
(envrc-show-summary-in-minibuffer t))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-05-23 13:38:13 +01:00
|
|
|
(use-package gud
|
|
|
|
:defer t
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines gdb-many-windows
|
2024-05-23 13:38:13 +01:00
|
|
|
:config
|
|
|
|
(setq gdb-many-windows t))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package treesit
|
|
|
|
:custom
|
2024-05-14 13:43:18 +01:00
|
|
|
(treesit-font-lock-level 3))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package treesit-auto
|
2024-06-04 08:09:58 +01:00
|
|
|
:requires treesit
|
|
|
|
:functions (treesit-auto-add-to-auto-mode-alist
|
|
|
|
global-treesit-auto-mode)
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
|
|
|
(treesit-auto-add-to-auto-mode-alist)
|
|
|
|
(global-treesit-auto-mode +1))
|
|
|
|
|
|
|
|
(use-package eldoc
|
|
|
|
:custom
|
|
|
|
(eldoc-echo-area-display-truncation-message nil)
|
2024-07-04 10:11:34 +01:00
|
|
|
(eldoc-echo-area-prefer-doc-buffer 'maybe)
|
|
|
|
(eldoc-echo-area-use-multiline-p 3))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package eglot
|
|
|
|
:demand
|
2024-04-19 14:55:46 +01:00
|
|
|
:bind ( :map prog-mode-map
|
|
|
|
("C-c c a" . eglot-code-actions)
|
|
|
|
("C-c c r" . eglot-rename))
|
2024-06-26 13:37:07 +01:00
|
|
|
:hook (((nix-mode lua-mode js-base-mode typescript-ts-base-mode) . eglot-ensure)
|
2024-05-19 11:02:51 +01:00
|
|
|
(eglot-managed-mode . (lambda () (add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t))))
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
2024-07-04 10:11:34 +01:00
|
|
|
(eglot-menu-string "lsp")
|
|
|
|
(eglot-send-changes-idle-time 1)
|
2024-04-17 11:43:59 +01:00
|
|
|
(eglot-extend-to-xref t)
|
|
|
|
(eglot-autoshutdown t)
|
2024-07-04 10:11:34 +01:00
|
|
|
(eglot-sync-connect nil)
|
2024-06-26 13:37:07 +01:00
|
|
|
(eglot-autoreconnect (* 60 5))
|
2024-07-04 10:11:34 +01:00
|
|
|
(eglot-events-buffer-config '(:size 0))
|
|
|
|
(eglot-ignored-server-capabilities
|
|
|
|
'(:documentHighlightProvider
|
|
|
|
:documentFormattingProvider
|
|
|
|
:documentRangeFormattingProvider
|
|
|
|
:documentOnTypeFormattingProvider
|
|
|
|
:documentLinkProvider
|
|
|
|
:colorProvider
|
|
|
|
:foldingRangeProvider))
|
2024-04-26 13:54:21 +01:00
|
|
|
:init
|
2024-04-17 11:43:59 +01:00
|
|
|
(setq eglot-stay-out-of '(flymake))
|
2024-04-26 13:54:21 +01:00
|
|
|
:config
|
2024-04-17 11:43:59 +01:00
|
|
|
(setq-default eglot-workspace-configuration
|
2024-07-03 13:17:25 +01:00
|
|
|
'( :pylsp ( :plugins
|
|
|
|
( :autopep8 (:enabled nil)
|
|
|
|
:flake8 (:enabled nil)
|
|
|
|
:jedi_completion ( :enabled t
|
|
|
|
:include_params t
|
|
|
|
:include_class_objects t
|
|
|
|
:include_function_objects t
|
|
|
|
:fuzzy t)
|
|
|
|
:jedi_definition (:enabled t)
|
|
|
|
:jedi_hover (:enabled t)
|
|
|
|
:mccabe (:enabled nil)
|
|
|
|
:preload (:enabled nil)
|
|
|
|
:pycodestyle (:enabled nil)
|
|
|
|
:pydocstyle (:enabled nil)
|
|
|
|
:pyflakes (:enabled nil)
|
|
|
|
:pylint (:enabled nil)
|
|
|
|
:rope_autoimport ( :completions (:enabled t)
|
|
|
|
:code_actions (:enabled t))
|
|
|
|
:rope_completion (:enabled t)
|
|
|
|
:yapf (:enabled nil)))
|
2024-07-04 17:54:23 +01:00
|
|
|
:pyright (:python
|
|
|
|
(:analysis
|
|
|
|
( :autoSearchPaths t
|
|
|
|
:diagnosticMode "openFilesOnly"
|
|
|
|
:useLibraryCodeForTypes t)))
|
2024-07-03 13:17:25 +01:00
|
|
|
:nil ( :nix
|
|
|
|
( :maxMemoryMB nil
|
|
|
|
:flake
|
|
|
|
( :autoArchive t
|
|
|
|
:nixpkgsInputName "nixpkgs")))))
|
2024-06-04 08:09:58 +01:00
|
|
|
)
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package apheleia
|
2024-05-21 17:17:49 +01:00
|
|
|
:diminish
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines (apheleia-formatters
|
|
|
|
apheleia-mode-alist)
|
2024-04-17 11:43:59 +01:00
|
|
|
:bind (("C-c c f" . apheleia-format-buffer))
|
|
|
|
:hook (prog-mode)
|
2024-07-01 18:09:39 +01:00
|
|
|
:custom (apheleia-remote-algorithm 'cancel)
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
|
|
|
(add-to-list 'apheleia-formatters '(alejandra . ("alejandra")))
|
2024-05-15 11:47:20 +01:00
|
|
|
(add-to-list 'apheleia-formatters '(isort . ("isort" "--profile" "black" "-")))
|
2024-04-17 11:43:59 +01:00
|
|
|
(add-to-list 'apheleia-mode-alist '(nix-mode . alejandra))
|
2024-07-01 18:09:39 +01:00
|
|
|
(add-to-list 'apheleia-mode-alist '(python-base-mode . (black isort)))
|
|
|
|
(add-to-list 'apheleia-mode-alist '(python-mode . (black isort)))
|
|
|
|
(add-to-list 'apheleia-mode-alist '(python-ts-mode . (black isort))))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package flymake
|
|
|
|
:bind (("C-c C-." . flymake-goto-next-error)
|
|
|
|
("C-c C-," . flymake-goto-prev-error))
|
2024-07-04 10:11:34 +01:00
|
|
|
:hook (prog-mode . (lambda () (flymake-mode +1)))
|
|
|
|
:custom
|
|
|
|
(flymake-no-changes-timeout 1)
|
|
|
|
(flymake-show-diagnostics-at-end-of-line nil))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package flymake-popon
|
2024-05-21 17:17:49 +01:00
|
|
|
:diminish
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions flymake-popon-mode
|
2024-05-23 14:06:34 +01:00
|
|
|
:requires flymake
|
|
|
|
:hook (flymake-mode . (lambda () (flymake-popon-mode +1))))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(use-package flymake-shellcheck
|
2024-05-23 14:06:34 +01:00
|
|
|
:if (executable-find "shellcheck")
|
|
|
|
:requires flymake
|
2024-04-17 11:43:59 +01:00
|
|
|
:hook (sh-mode . flymake-shellcheck-load))
|
|
|
|
|
2024-05-23 14:06:34 +01:00
|
|
|
(use-package flymake-yamllint
|
|
|
|
:if (executable-find "yamllint")
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions flymake-yamllint-setup
|
2024-05-23 14:06:34 +01:00
|
|
|
:requires flymake
|
|
|
|
:hook (yaml-ts-mode . (lambda ()
|
|
|
|
(progn (flymake-mode +1)
|
|
|
|
(flymake-yamllint-setup)))))
|
|
|
|
|
2024-06-25 07:32:02 +01:00
|
|
|
(use-package flymake-eslint
|
|
|
|
:if (executable-find "eslint")
|
|
|
|
:functions flymake-eslint-enable
|
|
|
|
:requires flymake
|
|
|
|
:hook ((js-base-mode typescript-ts-base-mode) . flymake-eslint-enable))
|
|
|
|
|
2024-05-13 07:53:06 +01:00
|
|
|
(use-package project
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions (project-forget-zombie-projects
|
|
|
|
project-remember-projects-under)
|
2024-05-13 09:54:13 +01:00
|
|
|
:custom
|
|
|
|
(project-switch-use-entire-map t)
|
|
|
|
(project-switch-commands '((project-find-file "Find file")
|
|
|
|
(project-find-regexp "Find regexp")
|
|
|
|
(project-find-dir "Find directory")
|
|
|
|
(project-eshell "Eshell")
|
|
|
|
(magit-project-status "Magit")))
|
2024-05-13 07:53:06 +01:00
|
|
|
:config
|
2024-05-13 09:54:13 +01:00
|
|
|
(defun my/project-find-common-projects ()
|
2024-05-13 10:04:56 +01:00
|
|
|
"Search and remember common project directories.
|
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
Calls `project-remember-projects-under' for ~/Projects/"
|
2024-05-13 09:54:13 +01:00
|
|
|
(interactive)
|
|
|
|
(require 'project)
|
2024-05-13 10:04:56 +01:00
|
|
|
(project-forget-zombie-projects)
|
2024-06-13 07:49:55 +01:00
|
|
|
(project-remember-projects-under user-emacs-directory nil)
|
|
|
|
(project-remember-projects-under "/etc/nixos/" nil)
|
|
|
|
(project-remember-projects-under "~/Projects" t)
|
2024-05-13 10:04:56 +01:00
|
|
|
))
|
2024-05-13 07:53:06 +01:00
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(use-package magit
|
|
|
|
:bind (("C-c g g" . magit-status)
|
|
|
|
("C-c g d" . magit-dispatch)
|
|
|
|
("C-c g f" . magit-file-dispatch)
|
2024-05-23 14:37:00 +01:00
|
|
|
("C-c g b" . magit-blame-addition)
|
2024-04-17 11:43:59 +01:00
|
|
|
("C-c g p" . magit-pull)
|
|
|
|
("C-c g P" . magit-push)
|
|
|
|
("<remap> <project-vc-dir" . magit-project-status)
|
|
|
|
:map project-prefix-map
|
|
|
|
("m" . magit-project-status))
|
|
|
|
:custom
|
|
|
|
(magit-display-buffer-function 'magit-display-buffer-same-window-except-diff-v1)
|
|
|
|
(magit-define-global-key-bindings nil)
|
|
|
|
(magit-clone-default-directory "~/Projects/")
|
|
|
|
(magit-clone-set-remote.pushDefault t)
|
|
|
|
(magit-commit-show-diff t)
|
|
|
|
(magit-commit-diff-inhibit-same-window t)
|
|
|
|
(magit-diff-adjust-tab-width t)
|
|
|
|
(magit-diff-refine-hunk 'all)
|
|
|
|
(magit-diff-refine-ignore-whitespace t)
|
|
|
|
(magit-clone-name-alist '(("\\`\\(?:github:\\|gh:\\)?\\([^:]+\\)\\'" "github.com" "github.user")
|
|
|
|
("\\`\\(?:gitlab:\\|gl:\\)\\([^:]+\\)\\'" "gitlab.com" "gitlab.user")
|
|
|
|
("\\`\\(?:sourcehut:\\|sh:\\)\\([^:]+\\)\\'" "git.sr.ht" "sourcehut.user")
|
|
|
|
("\\`\\(?:gitea:\\|gt:\\)\\([^:]+\\)\\'" "git.xenia.me.uk" "gitea.user"))))
|
|
|
|
|
2024-06-25 17:10:47 +01:00
|
|
|
(use-package forge-topic
|
|
|
|
:custom
|
2024-06-26 06:39:21 +01:00
|
|
|
(forge-topic-list-limit '(60 . 10)))
|
2024-06-25 17:10:47 +01:00
|
|
|
|
2024-06-04 17:23:56 +01:00
|
|
|
(use-package treemacs
|
2024-06-06 17:26:46 +01:00
|
|
|
:functions (treemacs treemacs-load-theme)
|
2024-06-04 17:23:56 +01:00
|
|
|
:bind (("M-g t" . treemacs-select-window))
|
2024-06-10 08:10:45 +01:00
|
|
|
:hook (treemacs-mode . (lambda () (visual-line-mode -1)))
|
|
|
|
:config
|
|
|
|
(when (require 'treemacs-nerd-icons nil :noerror)
|
|
|
|
(treemacs-load-theme "nerd-icons")))
|
|
|
|
|
|
|
|
(use-package treemacs-nerd-icons
|
|
|
|
:diminish
|
|
|
|
:requires nerd-icons)
|
2024-06-04 17:23:56 +01:00
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(use-package aggressive-indent
|
|
|
|
:hook (elisp-mode
|
|
|
|
lisp-mode
|
|
|
|
lisp-data-mode
|
|
|
|
rust-mode))
|
|
|
|
|
|
|
|
(use-package nix-mode
|
|
|
|
:mode "\\.nix\\'"
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions nix-prettify-global-mode
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
|
|
|
(require 'nix)
|
|
|
|
(require 'nix-flake)
|
|
|
|
(require 'nix-repl)
|
|
|
|
(require 'nix-store)
|
|
|
|
(nix-prettify-global-mode +1))
|
|
|
|
|
|
|
|
(defun my/enable-fill-column (col)
|
|
|
|
"Set and enable fill column to `COL'."
|
|
|
|
(set-fill-column col)
|
|
|
|
(display-fill-column-indicator-mode +1))
|
|
|
|
|
|
|
|
(use-package python
|
2024-05-22 07:55:13 +01:00
|
|
|
:hook ((python-base-mode . (lambda () (my/enable-fill-column 88))))
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
2024-05-22 09:40:23 +01:00
|
|
|
(python-shell-interpreter "python3")
|
2024-06-27 18:15:04 +01:00
|
|
|
(python-indent-def-block-scale 1)
|
2024-07-01 18:09:39 +01:00
|
|
|
(python-check-command "mypy --check-untyped-defs --warn-unreachable --show-error-codes --ignore-missing-imports")
|
2024-04-26 13:54:21 +01:00
|
|
|
(python-flymake-command
|
2024-07-04 15:53:03 +01:00
|
|
|
(cond ((executable-find "ruff") '("ruff" "check" "--output-format=concise" "--stdin-filename=stdin" "-"))
|
2024-05-22 07:55:13 +01:00
|
|
|
((executable-find "flake8") '("flake8" "--max-line-length" "88" "-"))
|
|
|
|
(t '("pyflakes"))))
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
2024-04-26 13:54:21 +01:00
|
|
|
(setq python-ts-mode-hook python-mode-hook))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-04-26 13:54:21 +01:00
|
|
|
(use-package python-docstring
|
|
|
|
:hook python-base-mode)
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-05-22 09:39:04 +01:00
|
|
|
(use-package files
|
|
|
|
:custom
|
2024-06-10 14:34:47 +01:00
|
|
|
(view-read-only t)
|
2024-05-22 09:39:04 +01:00
|
|
|
(enable-remote-dir-locals t))
|
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(use-package tramp
|
|
|
|
:defer t
|
2024-05-20 09:53:44 +01:00
|
|
|
:custom
|
2024-05-20 10:14:03 +01:00
|
|
|
(tramp-default-method "scpx")
|
2024-06-04 08:09:58 +01:00
|
|
|
(tramp-backup-directory-alist backup-directory-alist)
|
|
|
|
(tramp-auto-save-directory (cdr (assoc "." tramp-backup-directory-alist)))
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
2024-04-26 14:05:00 +01:00
|
|
|
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
|
|
|
|
(add-to-list 'tramp-remote-path "~/.local/bin/"))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
|
|
|
(connection-local-set-profile-variables
|
|
|
|
'remote-no-corfu-auto
|
|
|
|
'((corfu-auto . nil)))
|
|
|
|
|
|
|
|
(connection-local-set-profiles
|
|
|
|
'(:application tramp)
|
|
|
|
'remote-no-corfu-auto)
|
|
|
|
|
|
|
|
(use-package doc-view
|
|
|
|
:defer t
|
|
|
|
:bind ( :map doc-view-mode-map
|
|
|
|
("<mouse-8>" . doc-view-previous-page)
|
|
|
|
("<mouse-9>" . doc-view-next-page))
|
|
|
|
:custom
|
|
|
|
(doc-view-resolution 200)
|
|
|
|
(doc-view-imenu-enabled t)
|
|
|
|
(doc-view-scale-internally t)
|
|
|
|
(doc-view-image-width 850))
|
|
|
|
|
|
|
|
(use-package markdown-mode
|
2024-05-27 08:34:02 +01:00
|
|
|
:hook
|
|
|
|
((markdown-mode . turn-on-auto-fill))
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
|
|
|
(markdown-enable-math t)
|
|
|
|
(markdown-enable-html t)
|
|
|
|
:config
|
|
|
|
(set-face-attribute 'markdown-code-face nil :inherit 'fixed-pitch)
|
|
|
|
(set-face-attribute 'markdown-inline-code-face nil :inherit 'fixed-pitch)
|
|
|
|
(set-face-attribute 'markdown-table-face nil :inherit 'fixed-pitch)
|
|
|
|
(set-face-attribute 'markdown-blockquote-face nil :inherit 'variable-pitch)
|
|
|
|
(set-face-attribute 'markdown-comment-face nil :inherit 'variable-pitch))
|
|
|
|
|
|
|
|
(use-package pandoc-mode
|
|
|
|
:after (markdown-mode)
|
|
|
|
:hook (markdown-mode . conditionally-turn-on-pandoc))
|
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package sendmail
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
2024-06-04 08:09:58 +01:00
|
|
|
(sendmail-program (executable-find "msmtp"))
|
|
|
|
(send-mail-function #'sendmail-send-it))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package message
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
2024-06-04 08:09:58 +01:00
|
|
|
(message-send-mail-function #'message-send-mail-with-sendmail)
|
|
|
|
(message-sendmail-f-is-evil t)
|
|
|
|
(message-sendmail-extra-arguments '("--read-envelope-from"))
|
|
|
|
(message-auto-save-directory nil)
|
|
|
|
(message-kill-buffer-on-exit t))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-06-12 07:10:12 +01:00
|
|
|
(use-package bbdb
|
2024-06-12 10:43:29 +01:00
|
|
|
:bind (("M-g b" . bbdb-display-all-records))
|
2024-06-12 07:10:12 +01:00
|
|
|
:custom
|
|
|
|
(bbdb-file (locate-user-emacs-file "bbdb.gpg")))
|
|
|
|
|
2024-06-24 11:25:41 +01:00
|
|
|
(load-file (locate-user-emacs-file "lib/mu4e-custom.el"))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-05-19 12:20:20 +01:00
|
|
|
(use-package erc
|
2024-06-04 08:09:58 +01:00
|
|
|
:commands erc-compute-nick
|
2024-05-19 12:20:20 +01:00
|
|
|
:custom
|
|
|
|
(erc-nick (user-login-name))
|
2024-06-04 08:09:58 +01:00
|
|
|
(erc-user-full-name (user-full-name))
|
|
|
|
:config
|
|
|
|
(when (require 'password-store nil :noerror)
|
|
|
|
(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 '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 'znc)))))
|
2024-05-19 12:20:20 +01:00
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
(use-package eww
|
|
|
|
:defer t
|
|
|
|
:custom
|
|
|
|
(browse-url-browser-function 'browse-url-default-browser)
|
|
|
|
(browse-url-secondary-browser-function 'browse-url-default-browser)
|
|
|
|
(browse-url-new-window-flag t)
|
|
|
|
(eww-default-download-directory "~/Downloads/")
|
|
|
|
(eww-auto-rename-buffer 'title)
|
|
|
|
(eww-browse-url-new-window-is-tab nil))
|
2024-05-19 12:20:20 +01:00
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(use-package elfeed
|
2024-04-24 13:28:09 +01:00
|
|
|
:bind (("C-c f" . elfeed))
|
2024-06-04 08:09:58 +01:00
|
|
|
:hook ((elfeed-search-mode . elfeed-update)
|
|
|
|
(elfeed-show-mode . (lambda () (visual-line-mode +1))))
|
2024-04-17 11:43:59 +01:00
|
|
|
:custom
|
2024-05-13 07:43:50 +01:00
|
|
|
(elfeed-search-filter "@2-months-ago +unread")
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
2024-05-15 07:42:38 +01:00
|
|
|
(require 'elfeed-db)
|
2024-04-24 13:28:09 +01:00
|
|
|
(require 'elfeed-org))
|
2024-04-17 11:43:59 +01:00
|
|
|
|
2024-05-15 07:42:38 +01:00
|
|
|
(use-package elfeed-db
|
2024-04-17 11:43:59 +01:00
|
|
|
:after (elfeed org)
|
|
|
|
:custom
|
2024-05-15 07:42:38 +01:00
|
|
|
(elfeed-db-directory (expand-file-name "elfeed" org-directory)))
|
|
|
|
|
|
|
|
(use-package elfeed-org
|
|
|
|
:after (elfeed elfeed-db org)
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines rmh-elfeed-org-files
|
|
|
|
:functions elfeed-org
|
2024-05-15 07:42:38 +01:00
|
|
|
:custom
|
|
|
|
(rmh-elfeed-org-files (list
|
|
|
|
(expand-file-name "feeds.org" elfeed-db-directory)))
|
2024-04-17 11:43:59 +01:00
|
|
|
:config
|
|
|
|
(elfeed-org))
|
|
|
|
|
2024-05-13 07:33:52 +01:00
|
|
|
(use-package elfeed-tube
|
|
|
|
:after elfeed
|
2024-06-04 08:09:58 +01:00
|
|
|
:defines (elfeed-show-mode-map
|
|
|
|
elfeed-search-mode-map)
|
|
|
|
:functions elfeed-tube-setup
|
2024-05-13 07:33:52 +01:00
|
|
|
:bind ( :map elfeed-show-mode-map
|
|
|
|
("F" . elfeed-tube-fetch)
|
|
|
|
([remap save-buffer] . elfeed-tube-save)
|
|
|
|
:map elfeed-search-mode-map
|
|
|
|
("F" . elfeed-tube-fetch)
|
|
|
|
([remap save-buffer] . elfeed-tube-save))
|
|
|
|
:custom
|
|
|
|
(elfeed-tube-auto-save-p nil)
|
|
|
|
(elfeed-tube-auto-fetch-p t)
|
|
|
|
:config
|
|
|
|
(elfeed-tube-setup))
|
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(use-package password-store
|
2024-06-04 08:09:58 +01:00
|
|
|
:functions password-store-get)
|
2024-04-05 15:22:48 +01:00
|
|
|
|
2024-04-17 11:43:59 +01:00
|
|
|
(use-package pass
|
|
|
|
:defer t
|
|
|
|
:bind (("C-c P" . pass))
|
|
|
|
:custom
|
|
|
|
(pass-show-keybindings nil)
|
|
|
|
(pass-username-field "login"))
|
2024-02-15 08:18:41 +00:00
|
|
|
|
2024-06-04 08:09:58 +01:00
|
|
|
;; Scratch buffer shortcut
|
|
|
|
(keymap-global-set "C-c w x" #'scratch-buffer)
|
|
|
|
|
|
|
|
;; Config file shortcut
|
|
|
|
(defun my/open-init-file ()
|
|
|
|
"Open Emacs init file."
|
|
|
|
(interactive)
|
|
|
|
(find-file (locate-user-emacs-file "init.el")))
|
|
|
|
(keymap-global-set "C-c w e" #'my/open-init-file)
|
|
|
|
|
|
|
|
;; Tempel template file shortcut
|
|
|
|
(defun my/open-template-file ()
|
|
|
|
"Open `tempel' template file."
|
|
|
|
(interactive)
|
|
|
|
(require 'tempel)
|
|
|
|
(find-file tempel-path))
|
|
|
|
(keymap-global-set "C-c w t" #'my/open-template-file)
|
|
|
|
|
|
|
|
;; Org directory shortcut
|
|
|
|
(defun my/open-org-directory ()
|
|
|
|
"Open base `org-mode' directory in Dired."
|
|
|
|
(interactive)
|
|
|
|
(require 'org)
|
|
|
|
(find-file org-directory))
|
|
|
|
(keymap-global-set "C-c w o" #'my/open-org-directory)
|
|
|
|
|
|
|
|
(defun my/open-global-bibliography ()
|
|
|
|
"Open `org-cite-global-bibliography'."
|
|
|
|
(interactive)
|
2024-07-06 06:22:07 +01:00
|
|
|
(require 'citar)
|
2024-06-04 08:09:58 +01:00
|
|
|
(find-file (car org-cite-global-bibliography)))
|
|
|
|
(keymap-global-set "C-c w b" #'my/open-global-bibliography)
|
|
|
|
|
|
|
|
;; Elfeed feeds directory shortcut
|
|
|
|
(defun my/open-feeds-file ()
|
|
|
|
"Open elfeed org source file."
|
|
|
|
(interactive)
|
|
|
|
(require 'elfeed)
|
|
|
|
(require 'elfeed-org)
|
|
|
|
(find-file (car rmh-elfeed-org-files)))
|
|
|
|
(keymap-global-set "C-c w f" #'my/open-feeds-file)
|
|
|
|
|
|
|
|
(defun my/open-documents-directory ()
|
|
|
|
"Open Documents directory."
|
|
|
|
(interactive)
|
|
|
|
(find-file "~/Documents/"))
|
|
|
|
(defun my/open-downloads-directory ()
|
|
|
|
"Open Downloads directory."
|
|
|
|
(interactive)
|
|
|
|
(find-file "~/Downloads/"))
|
|
|
|
(keymap-global-set "C-c w d" #'my/open-documents-directory)
|
|
|
|
(keymap-global-set "C-c w C-d" #'my/open-downloads-directory)
|
|
|
|
|
2024-02-15 08:18:41 +00:00
|
|
|
(provide 'init)
|
|
|
|
;;; init.el ends here
|