emacs.d/init.el

164 lines
6.1 KiB
EmacsLisp

(global-set-key (kbd "M-o") 'other-window)
;; Thinkpad keyboards have PrtSc where right alt should be
(global-set-key (kbd "<print>") 'execute-extended-command)
;; OpenBSD prefixes gnu coreutils programs with g
;; Requires installation of coreutils package
(global-set-key (kbd "M-\\") 'cycle-spacing)
(setq dired-chown-program "gchown"
dired-touch-program "gtouch"
dired-grep-program "ggrep"
insert-directory-program "gls")
(setq custom-safe-themes
'("dde643b0efb339c0de5645a2bc2e8b4176976d5298065b8e6ca45bc4ddf188b7" default))
(eval-when-compile
(require 'use-package))
(use-package magit
:ensure t
:bind (("C-x g" . magit-status)
("<f8>" . magit-status)))
(use-package modus-themes
:ensure t
:init
;;(modus-themes-load-themes)
:config
;;(modus-themes-load-vivendi)
(load-theme 'modus-vivendi)
:bind
;;("<f5>" . modus-themes-toggle)
)
(use-package vertico
:ensure t
:config
(vertico-mode))
(use-package orderless
:ensure t)
(use-package smartparens-config
:ensure smartparens
:config (progn (show-smartparens-global-mode t)))
(use-package org-journal
:ensure t
:defer t)
(use-package corfu
:ensure t
:init
(global-corfu-mode))
(use-package slime
:ensure t
:init
(setq inferior-lisp-program "sbcl")
:defer t)
(use-package project
:ensure t)
(use-package consult
:ensure t
: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 expand-region
:ensure t
:bind ("C-=" . er/expand-region))
(use-package racket-mode
:ensure t)
(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.
'(column-number-mode t)
'(completion-category-overrides '((file (styles partial-completion))))
'(completion-styles '(orderless basic))
'(consult-grep-args
"ggrep --null --line-buffered --color=never --ignore-case --line-number -I -r .")
'(desktop-save-mode nil)
'(dired-dwim-target 'dired-dwim-target-next)
'(display-time-24hr-format t)
'(display-time-day-and-date t)
'(display-time-mode t)
'(gnus-secondary-select-methods '((nnml "")))
'(gnus-select-method '(nntp "news.gmane.io"))
'(mail-sources '((file :path "/var/mail/olly")))
'(org-agenda-files '("~/org/home.org"))
'(org-journal-dir "~/journal")
'(org-journal-file-type 'monthly)
'(package-archives
'(("melpa-stable" . "https://stable.melpa.org/packages/")
("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
'(package-selected-packages
'(haskell-mode undo-tree expand-region project consult pdf-tools slime corfu org-journal smartparens modus-themes orderless solarized-theme vertico use-package racket-mode magit))
'(prog-mode-hook
'(flyspell-prog-mode display-line-numbers-mode turn-on-smartparens-strict-mode))
'(save-place-mode t)
'(savehist-mode t)
'(scroll-bar-mode nil)
'(text-mode-hook
'(turn-on-flyspell turn-on-auto-fill text-mode-hook-identify))
'(tool-bar-mode nil)
'(use-package-compute-statistics 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 :height 100 :family "Terminus")))))
(put 'narrow-to-region 'disabled nil)