forked from SystemCrafters/crafted-emacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrational-defaults.el
62 lines (46 loc) · 1.94 KB
/
rational-defaults.el
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
;;; rational-defaults.el -*- lexical-binding: t; -*-
;; Copyright (C) 2022
;; SPDX-License-Identifier: MIT
;; Author: System Crafters Community
;; Commentary
;; General sane defaults
;;; Code:
;; Revert Dired and other buffers
(customize-set-variable 'global-auto-revert-non-file-buffers t)
;; Revert buffers when the underlying file has changed
(global-auto-revert-mode 1)
;; Use spaces instead of tabs
(setq-default indent-tabs-mode nil)
;; Use "y" and "n" to confirm/negate prompt instead of "yes" and "no"
;; Using `advice' here to make it easy to reverse in custom
;; configurations with `(advice-remove 'yes-or-no-p #'y-or-n-p)'
;;
;; N.B. Emacs 28 has a variable for using short answers, which should
;; be preferred if using that version or higher.
(if (boundp 'use-short-answers)
(setq use-short-answers t)
(advice-add 'yes-or-no-p :override #'y-or-n-p))
;; Turn on recentf mode
(add-hook 'after-init-hook #'recentf-mode)
(customize-set-variable 'recentf-save-file
(expand-file-name "recentf" rational-config-var-directory))
;; Do not saves duplicates in kill-ring
(customize-set-variable 'kill-do-not-save-duplicates t)
;; Make scrolling less stuttered
(setq auto-window-vscroll nil)
(customize-set-variable 'fast-but-imprecise-scrolling t)
(customize-set-variable 'scroll-conservatively 101)
(customize-set-variable 'scroll-margin 0)
(customize-set-variable 'scroll-preserve-screen-position t)
;; Better support for files with long lines
(setq-default bidi-paragraph-direction 'left-to-right)
(setq-default bidi-inhibit-bpa t)
(global-so-long-mode 1)
;; Make shebang (#!) file executable when saved
(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)
;; Enable savehist-mode for an command history
(savehist-mode 1)
(customize-set-variable 'savehist-file
(expand-file-name "history" rational-config-var-directory))
(provide 'rational-defaults)
;;; rational-defaults.el ends here