about summary refs log tree commit diff
path: root/init/settings.el
blob: 1c801cd09a07ea3e7d6dc3697827775494a72118 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
(require 'prescient)
(require 'ivy-prescient)
(require 'uniquify)
(require 'password-store)
(require 'ivy-pass)

;; Make ivy go!
(ivy-mode 1)
(counsel-mode 1)

(setq ivy-use-virtual-buffers t)
(setq enable-recursive-minibuffers t)

;; Enable support for prescient in ivy & configure it
(ivy-prescient-mode)
(prescient-persist-mode)
(add-to-list 'ivy-prescient-excluded-commands 'counsel-rg)

;; Move files to trash when deleting
(setq delete-by-moving-to-trash t)

;; We don't live in the 80s, but we're also not a shitty web app.
(setq gc-cons-threshold 20000000)

(setq uniquify-buffer-name-style 'forward)

; Fix some defaults
(setq visible-bell nil
      inhibit-startup-message t
      color-theme-is-global t
      sentence-end-double-space nil
      shift-select-mode nil
      uniquify-buffer-name-style 'forward
      whitespace-style '(face trailing lines-tail tabs)
      whitespace-line-column 80
      default-directory "~"
      fill-column 80
      ediff-split-window-function 'split-window-horizontally)

(add-to-list 'safe-local-variable-values '(lexical-binding . t))
(add-to-list 'safe-local-variable-values '(whitespace-line-column . 80))

(set-default 'indent-tabs-mode nil)

;; UTF-8 please
(setq locale-coding-system 'utf-8) ; pretty
(set-terminal-coding-system 'utf-8) ; pretty
(set-keyboard-coding-system 'utf-8) ; pretty
(set-selection-coding-system 'utf-8) ; please
(prefer-coding-system 'utf-8) ; with sugar on top

;; Make emacs behave sanely (overwrite selected text)
(delete-selection-mode 1)

;; Keep your temporary files in tmp, emacs!
(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))
(setq backup-directory-alist
      `((".*" . ,temporary-file-directory)))

(remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)

;; Show time in 24h format
(setq display-time-24hr-format t)

;; Make ace-window behave in a sane way:
(setq aw-keys '(?f ?j ?d ?k ?s ?l ?a)) ; Homerow keys in sensible order!
(setq aw-scope 'frame) ; There are many frames in exwm, I don't care!

;; Configure pinentry for use with GPG
(setq epa-pinentry-mode 'loopback)
(pinentry-start)

;; Configure password-store as an auth-source
;; (this requires emacs 26)
(require 'auth-source-pass)
(auth-source-pass-enable)

;; Close mail buffers after sending mail
(setq message-kill-buffer-on-exit t)

(provide 'settings)