emacs.d/init.el

184 lines
7.4 KiB
EmacsLisp

;; Restore gnus
;; customisation (why does it go to configured even with a bind.
;; Likewise for smartparen and yafolding)
;;Use-package customisation before loading use-package.
(setq use-package-compute-statistics t)
(setq use-package-verbose t)
(setq use-package-always-defer t)
(eval-when-compile
(require 'use-package))
(bind-key "M-o" #'other-window)
;; Thinkpad keyboards have PrtSc where right alt should be
(bind-key "<print>" #'execute-extended-command)
(bind-key "M-\\" #'cycle-spacing)
(bind-key "<f6>" #'switch-to-buffer)
(bind-key "S-<f6>" #'switch-to-buffer-other-window)
(bind-key "C-." #'embark-act)
(bind-key "M-." #'embark-act-dwim)
(use-package diminish)
(use-package emacs
:init
(setq-default auto-fill-function 'do-auto-fill)
(add-to-list 'Info-directory-list "~/.emacs.d/info"))
(use-package avy
:bind
(("M-j" . #'avy-goto-char-timer)
:map isearch-mode-map
("M-j" . #'avy-isearch)))
(use-package consult
:bind (;; C-c bindings (mode-specific-map)
;; C-x bindings (ctl-x-map)
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
("C-x r b" . consult-bookmark) ;; orig. bookmark-jump
("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
;; Custom M-# bindings for fast register access
("M-#" . consult-register-load)
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
("C-M-#" . consult-register)
;; Other custom bindings
("M-y" . consult-yank-pop) ;; orig. yank-pop
;; ("<help> a" . consult-apropos) ;; orig. apropos-command
;; M-g bindings (goto-map)
("M-g e" . consult-compile-error)
("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
("M-g g" . consult-goto-line) ;; orig. goto-line
("M-g M-g" . consult-goto-line) ;; orig. goto-line
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
("M-g m" . consult-mark)
("M-g k" . consult-global-mark)
("M-g i" . consult-imenu)
("M-g I" . consult-imenu-multi)
;; M-s bindings (search-map)
("M-s d" . consult-find)
("M-s D" . consult-locate)
("M-s g" . consult-grep)
("M-s G" . consult-git-grep)
("M-s r" . consult-ripgrep)
("M-s l" . consult-line)
("M-s L" . consult-line-multi)
("M-s m" . consult-multi-occur)
("M-s k" . consult-keep-lines)
("M-s u" . consult-focus-lines)
;; Isearch integration
("M-s e" . consult-isearch-history)
:map isearch-mode-map
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
("M-s l" . consult-line) ;; needed by consult-line to detect isearch
("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch
;; Minibuffer history
:map minibuffer-local-map
("M-s" . consult-history) ;; orig. next-matching-history-element
("M-r" . consult-history)) ;; orig. previous-matching-history-)
)
(use-package eat
:hook (eshell-load eat-eshell-visual-command-mode))
(use-package expand-region
:bind ("C-=" . er/expand-region))
(use-package gnus
:bind ("C-c n" . gnus)
:config
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(add-hook 'gnus-group-mode-hook 'gnus-agent-mode))
(use-package magit
:bind (("C-x g" . magit-status)
("<f8>" . magit-status)))
(use-package slime
:init
(setq inferior-lisp-program "sbcl")
:defer t)
(use-package smartparens
:hook (prog-mode . turn-on-smartparens-strict-mode)
:config
(require 'smartparens-config))
(use-package vertico
:bind
(
:map vertico-map
("RET" . vertico-directory-enter)
("DEL" . vertico-directory-delete-char)
("M-DEL" . vertico-directory-tidy)))
(use-package which-key
:defer t)
;; (use-package yafolding
;; :hook prog-mode)
;; OS specific customisation
;; OpenBSD prefixes gnu coreutils programs with g
;; Requires installation of coreutils package
(when (eq system-type 'berkely-unix)
(custom-set-variables
'(dired-chown-program "gchown")
'(dired-touch-program "gtouch")
'(dired-grep-program "ggrep")
'(insert-directory-program "gls")))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(async-shell-command-buffer 'new-buffer)
'(column-number-mode t)
'(comment-auto-fill-only-comments t)
'(completion-category-overrides '((file (styles partial-completion))))
'(completion-styles '(basic partial-completion orderless))
'(consult-grep-args
"ggrep --null --line-buffered --color=never --ignore-case --line-number -I -r .")
'(custom-enabled-themes '(modus-vivendi))
'(custom-safe-themes
'("2cc1b50120c0d608cc5064eb187bcc22c50390eb091fddfa920bf2639112adb6" "69f7e8101867cfac410e88140f8c51b4433b93680901bb0b52014144366a08c8" "eb50f36ed5141c3f702f59baa1968494dc8e9bd22ed99d2aaa536c613c8782db" "eb7cd622a0916358a6ef6305e661c6abfad4decb4a7c12e73d6df871b8a195f8" default))
'(dired-chown-program "gchown")
'(dired-dwim-target 'dired-dwim-target-next)
'(display-buffer-alist '(("\\*Async" display-buffer-no-window (nil))))
'(display-time-24hr-format t)
'(display-time-day-and-date t)
'(display-time-mode t)
'(eat-kill-buffer-on-exit t)
'(ediff-window-setup-function 'ediff-setup-windows-plain)
'(eshell-destroy-buffer-when-process-dies t)
'(global-corfu-mode t)
'(gnus-save-newsrc-file nil)
'(gnus-select-method '(nntp "news.gmane.io"))
'(isearch-lazy-count t)
'(mail-sources '((file :path "/var/mail/olly")))
'(menu-bar-mode nil)
'(org-agenda-files '("~/org/home.org"))
'(org-journal-dir "~/journal")
'(org-journal-file-type 'monthly)
'(package-archives
'(("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
'(package-selected-packages
'(marginalia embark-consult embark avy diminish sicp eat which-key eglot haskell-mode expand-region project consult slime corfu smartparens modus-themes orderless vertico racket-mode magit))
'(save-place-mode t)
'(savehist-mode t)
'(scroll-bar-mode nil)
'(scroll-preserve-screen-position 1)
'(set-mark-command-repeat-pop t)
'(text-mode-hook
'(turn-on-flyspell turn-on-auto-fill text-mode-hook-identify))
'(tool-bar-mode nil)
'(vertico-mode t)
'(xref-show-definitions-function 'consult-xref)
'(xref-show-xrefs-function 'consult-xref))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :extend nil :stipple nil :background "#000000" :foreground "#ffffff" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight medium :height 78 :width semi-condensed :family "terminus")))))
(put 'narrow-to-region 'disabled nil)