Flake lock file updates:
• Added input 'flake-utils':
'github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b?narHash=sha256-l0KFg5HjrsfsO/JpG%2Br7fRrqm12kzFHyUHqHCVpMMbI%3D' (2024-11-13)
• Added input 'flake-utils/systems':
'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D' (2023-04-09)
• Added input 'nixpkgs':
'github:NixOS/nixpkgs/64c08a7ca051951c8eae34e3e3cb1e202fe36786?narHash=sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o%3D' (2026-05-23)
170 lines
6.6 KiB
EmacsLisp
170 lines
6.6 KiB
EmacsLisp
;; -*- lexical-binding: t; -*-
|
|
|
|
(require 'package)
|
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
|
|
(setq package-install-upgrade-built-in t)
|
|
(package-initialize)
|
|
;(package-refresh-contents) ;; Avoid long startup times, I think this is handled by Nix anyway?
|
|
|
|
(use-package transient
|
|
:ensure t)
|
|
|
|
;; Global settings
|
|
(desktop-save-mode 1) ;; Remember window layouts and open buffers
|
|
(electric-pair-mode 1) ;; Automatic bracket matching
|
|
(global-auto-revert-mode t) ;; Automatically refresh buffers when changes on disk
|
|
(global-display-line-numbers-mode 1)
|
|
(save-place-mode 1) ;; Remember cursor/scroll position
|
|
(setq-default indent-tabs-mode nil)
|
|
|
|
;; Isolate backup and auto-save files
|
|
(setq backup-directory-alist
|
|
`(("." . ,(expand-file-name "backups" user-emacs-directory))))
|
|
(setq auto-save-file-name-transforms
|
|
`((".*" ,(expand-file-name "auto-saves/" user-emacs-directory) t)))
|
|
(setq create-lockfiles nil) ;; Disables .#filename lockfiles
|
|
|
|
;; External modules
|
|
(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
|
|
(load (expand-file-name "modules/my-org.el" user-emacs-directory))
|
|
|
|
;; Search and navigation
|
|
|
|
(use-package vertico ;; https://github.com/minad/vertico
|
|
:ensure t
|
|
;:custom
|
|
;(vertico-scroll-margin 0) ;; Different scroll margin
|
|
;(vertico-count 20) ;; Show more candidates
|
|
;(vertico-resize t) ;; Grow and shrink the Vertico minibuffer
|
|
;(vertico-cycle t) ;; Enable cycling for `vertico-next/previous'
|
|
:init
|
|
(vertico-mode)
|
|
)
|
|
|
|
(use-package savehist
|
|
:init
|
|
(savehist-mode)
|
|
)
|
|
|
|
(use-package saveplace-pdf-view
|
|
:ensure t
|
|
:after (:any doc-view pdf-tools)
|
|
:demand t)
|
|
|
|
(use-package orderless
|
|
:ensure t
|
|
:custom
|
|
;; Configure a custom style dispatcher (see the Consult wiki)
|
|
;; (orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch))
|
|
;; (orderless-component-separator #'orderless-escapable-split-on-space)
|
|
(completion-styles '(orderless basic))
|
|
(completion-category-overrides '((file (styles partial-completion))))
|
|
(completion-category-defaults nil) ;; Disable defaults, use our settings
|
|
(completion-pcm-leading-wildcard t) ;; Emacs 31: partial-completion behaves like substring
|
|
)
|
|
|
|
(use-package marginalia
|
|
:ensure t
|
|
:init
|
|
(marginalia-mode)
|
|
)
|
|
|
|
(use-package emacs
|
|
:custom
|
|
;; Enable context menu. `vertico-multiform-mode' adds a menu in the minibuffer
|
|
;; to switch display modes.
|
|
(context-menu-mode t)
|
|
;; Support opening new minibuffers from inside existing minibuffers.
|
|
(enable-recursive-minibuffers t)
|
|
;; Hide commands in M-x which do not work in the current mode. Vertico
|
|
;; commands are hidden in normal buffers. This setting is useful beyond
|
|
;; Vertico.
|
|
(read-extended-command-predicate #'command-completion-default-include-p)
|
|
;; Do not allow the cursor in the minibuffer prompt
|
|
(minibuffer-prompt-properties
|
|
'(read-only t cursor-intangible t face minibuffer-prompt)))
|
|
|
|
(use-package consult ;; https://github.com/minad/consult
|
|
:ensure t
|
|
:bind (("C-x b" . consult-buffer) ;; Fuzzy find open buffers, recents, & bookmarks
|
|
("M-y" . consult-yank-pop) ;; Better paste history
|
|
("M-s r" . consult-ripgrep) ;; Search text INSIDE all your files
|
|
("M-g g" . consult-goto-line)))
|
|
|
|
;; Interaction & tools
|
|
|
|
(use-package evil
|
|
:ensure t
|
|
:init
|
|
(setq evil-shift-width 2)
|
|
:config
|
|
(evil-mode 1)
|
|
(with-eval-after-load 'evil-maps (define-key evil-motion-state-map (kbd "TAB") nil))
|
|
)
|
|
|
|
(use-package pdf-tools ;; https://github.com/vedang/pdf-tools
|
|
:ensure t
|
|
:custom
|
|
(pdf-util-convert-program "magick") ;; "The pdf-util-convert-program is unset or non-executable"
|
|
(pdf-view-incompatible-modes nil) ;; Silences the annoying warning popup
|
|
:init
|
|
(add-hook 'pdf-view-mode-hook (lambda () (display-line-numbers-mode -1)))
|
|
(add-hook 'pdf-view-mode-hook (lambda () (blink-cursor-mode -1)))
|
|
:config
|
|
(pdf-loader-install)
|
|
)
|
|
|
|
(use-package olivetti
|
|
:ensure t
|
|
) ;; Activate with M-x olivetti-mode
|
|
|
|
(use-package auto-dark
|
|
:ensure t
|
|
:custom
|
|
(auto-dark-themes '((modus-vivendi) (modus-operandi)))
|
|
:hook
|
|
(auto-dark-dark-mode
|
|
. (lambda ()
|
|
(pdf-view-midnight-minor-mode 1)
|
|
))
|
|
(auto-dark-light-mode
|
|
. (lambda ()
|
|
;; something to execute when light mode is detected
|
|
(pdf-view-midnight-minor-mode -1)
|
|
))
|
|
:init
|
|
(auto-dark-mode)
|
|
)
|
|
|
|
;; TODO Make M-x also fuzzy
|
|
;; TODO Make Find file fuzzy
|
|
;; TODO Save file search history across sessions
|
|
|
|
;; TODO Clicking links shows the content of that link in the adjacent pane. Often there is a PDF in that pane. I would like to choose to open links in the current pane instead. Idk, is Shift+Click or some actual keybind possible? Also, what is the current keybind for following links using key strokes?
|
|
;; TODO Is there some quicker way to switch between buffers, other than using the Buffer tab in the Menu bar, or :b with matching?
|
|
|
|
;; TODO org-roam stores everything with a prefix. Is there a way to disable that or not?
|
|
;; TODO Put exports in their own directory? (now filename-prefix.pdf)
|
|
;; TODO Put dailies in "journals" instead of "daily"
|
|
;; TODO I store my lecture PDFs in ~/Nextcloud/Documents/UGent/<course>/theory/*.pdf, is there some way to make a shortcut for this (related to Fuzzy finding files etc.). Maybe consider integrating with Zotero and storing PDFs there?
|
|
|
|
;; Additional package to explore
|
|
;; TODO https://magit.vc/ <-> Nextcloud WebDAV? What about mobile? FolderSync seems unreliable (currently using for LogSeq, often reports failures without actually being recently modified files.) I have my own Git server, but what about keys - I don't really like just making new keysets for this..?
|
|
|
|
;; Turn on Auto Fill mode automatically in Text mode and related modes (see Hooks).
|
|
;; TODO (add-hook 'text-mode-hook 'auto-fill-mode)
|
|
;; Do I want this?
|
|
|
|
;; TODO Automatically save buffer when going to other file -- maybe interactively?
|
|
;; TODO Spellchecking (UK & Dutch)
|
|
|
|
;; TODO Some automation to create anki cards intext without having to write the boilerplate
|
|
;; TODO Currently, failing exports (latexmk) just show that something has gone wrong. I have to run the command manually to see the output. Is there some log buffer or something?
|
|
|
|
;; TODO Is there some way to split the "org-mode/org-roam" environment from the rest of the config? Say that I want to use this for editing programming languages in the future too?
|
|
|
|
;; TODO I was thinking of syncing (1-way) Org TO-DO's to CalDav (Nextcloud), new calendar, so I can quickly see them in my tasklist. (https://github.com/dengste/org-caldav)
|
|
|
|
;; TODO Finally, compare experience to organice https://organice.200ok.ch/
|
|
|
|
;; TODO Remember collapse states in files
|