;;; post-init.el --- User Init -*- lexical-binding: t; -*- (load-theme 'modus-vivendi) ;; Set default font to IBM Plex Mono (set-face-attribute 'default nil :family "IBM Plex Mono" :height 100) ;; Variable-pitch font for proportional text (set-face-attribute 'variable-pitch nil :family "IBM Plex Sans" :height 1.1) ; Slightly larger than fixed-pitch; relative scaling ;; Fixed-pitch fallback ensures code blocks stay monospace (set-face-attribute 'fixed-pitch nil :family "IBM Plex Mono") (add-to-list 'default-frame-alist '(font . "IBM Plex Mono-10")) (add-hook 'org-mode-hook #'variable-pitch-mode) (add-hook 'markdown-mode-hook #'variable-pitch-mode) (repeat-mode 1) (setq auth-sources '(password-store "~/.authinfo.gpg")) (require 'auth-source-pass) (auth-source-pass-enable) (use-package abbrev :ensure nil :custom (save-abbrevs nil) :config (defun emacs-solo/abbrev--replace-placeholders () "Replace placeholders ###1###, ###2###, ... with minibuffer input. If ###@### is found, remove it and place point there at the end." (let ((cursor-pos nil)) (save-excursion (goto-char (point-min)) (let ((loop 0) (values (make-hash-table :test 'equal))) (while (re-search-forward "###\\([0-9]+\\|@\\)###" nil t) (setq loop (1+ loop)) (let* ((index (match-string 1)) (start (match-beginning 0)) (end (match-end 0))) (cond ((string= index "@") (setq cursor-pos start) (delete-region start end)) (t (let* ((key (format "###%s###" index)) (val (or (gethash key values) (let ((input (read-string (format "Value for %s: " key)))) (puthash key input values) input)))) (goto-char start) (delete-region start end) (insert val) (goto-char (+ start (length val)))))))))) (when cursor-pos (goto-char cursor-pos)))) (define-abbrev-table 'global-abbrev-table '(;; Arrows ("ra" "→") ("la" "←") ("ua" "↑") ("da" "↓") ;; HTML entities ("nb" " ") ("lt" "<") ("gt" ">") ;; Markdown ("cb" "```@\n\n```" (lambda () (search-backward "@") (delete-char 1))) ;; ORG ("ocb" "#+BEGIN_SRC @\n\n#+END_SRC" (lambda () (search-backward "@") (delete-char 1))) ("oheader" "#+TITLE: ###1###\n#+AUTHOR: ###2###\n#+EMAIL: ###3###\n#+OPTIONS: toc:nil\n" emacs-solo/abbrev--replace-placeholders)))) (setopt tab-always-indent 'complete read-buffer-completion-ignore-case t read-file-name-completion-ignore-case t ;; This *may* need to be set to 'always just so that you don't ;; miss other possible good completions that match the input ;; string. completion-auto-help 'always ;; Include more information with completion listings completions-detailed t ;; Move focus to the completions window after hitting tab ;; twice. completion-auto-select 'second-tab ;; Cycle through completion options vertically, not ;; horizontally. completions-format 'vertical ;; Sort recently used completions first. completions-sort 'historical ;; Only show up to 10 lines in the completions window. completions-max-height 10 ;; Don't show the unneeded help string at the top of the ;; completions buffer. completion-show-help nil ;; Add more `completion-styles' to improve candidate selection. completion-styles '(basic partial-completion substring initials)) (keymap-set minibuffer-local-map "C-p" #'minibuffer-previous-completion) (keymap-set minibuffer-local-map "C-n" #'minibuffer-next-completion) (completion-preview-mode 1) (electric-pair-mode 1) (setq load-prefer-newer t) (use-package compile-angel :ensure nil :config (setq compile-angel-verbose nil) (push "/init.el" compile-angel-excluded-files) (push "/early-init.el" compile-angel-excluded-files) (push "/post-init.el" compile-angel-excluded-files) (push "/eshell.el" compile-angel-excluded-files) (push "/gnus.el" compile-angel-excluded-files) (compile-angel-on-load-mode 1)) (use-package paren :ensure nil :hook (after-init-hook . show-paren-mode) :custom (show-paren-delay 0) (show-paren-style 'mixed) (show-paren-context-when-offscreen t)) (use-package guix :ensure nil) (use-package geiser-guile :ensure nil) (use-package rainbow-delimiters :ensure nil :init (rainbow-delimiters-mode)) (use-package pinentry :ensure nil) (use-package pass :ensure nil) (use-package bluetooth :ensure nil) (use-package enwc :ensure nil :init (setq enwc-default-backend 'nm)) (use-package nix-mode :ensure nil :mode "\\.nix\\'") (use-package markdown-mode :ensure nil :mode "\\.md\\'" :init (setq markdown-command "lowdown") :bind (:map markdown-mode-map ("C-c C-e" . markdown-do))) (use-package yaml-mode :ensure nil :mode "\\.yml\\'") (load-file (expand-file-name "gnus.el" user-emacs-directory)) (load-file (expand-file-name "eshell.el" user-emacs-directory)) (server-start)