41 lines
1.5 KiB
EmacsLisp
41 lines
1.5 KiB
EmacsLisp
;; -*- lexical-binding: t; -*-
|
|
|
|
;; Fix Emacs' bad defaults
|
|
(use-package emacs
|
|
:init
|
|
;; Save backups and autosaves in a centralized place
|
|
(defvar autosave-directory (expand-file-name "autosaves" user-emacs-directory))
|
|
(defvar backup-directory (expand-file-name "backups" user-emacs-directory))
|
|
(make-directory autosave-directory t)
|
|
(setq auto-save-file-name-transforms `((".*" ,autosave-directory t))
|
|
backup-directory-alist `(("." . ,backup-directory)))
|
|
|
|
;; Sensible variable defaults
|
|
(setq ring-bell-function 'ignore
|
|
enable-recursive-minibuffers t
|
|
read-process-output-max (* 1024 1024)
|
|
vc-follow-symlinks t
|
|
display-line-numbers-type 'visual
|
|
display-buffer-alist '((".*"
|
|
(display-buffer-reuse-window display-buffer-same-window)
|
|
(reusable-frames . t)))
|
|
even-window-sizes nil)
|
|
(setq-default indent-tabs-mode nil)
|
|
|
|
;; default to utf-8 for all the things
|
|
(set-charset-priority 'unicode)
|
|
(setq locale-coding-system 'utf-8
|
|
coding-system-for-read 'utf-8
|
|
coding-system-for-write 'utf-8)
|
|
(set-terminal-coding-system 'utf-8)
|
|
(set-keyboard-coding-system 'utf-8)
|
|
(set-selection-coding-system 'utf-8)
|
|
(prefer-coding-system 'utf-8)
|
|
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
|
|
|
|
;; Always display line numbers in text/programming modes
|
|
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
|
|
(add-hook 'text-mode-hook #'display-line-numbers-mode))
|
|
|
|
(provide 'init-defaults)
|