.emacs.d/init.d/basics/global-variables.el

63 lines
2.8 KiB
EmacsLisp

;;; global-variables.el --- Set some global variables. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-11-18T18:37:57+0100>
;;; Commentary:
;; * Banish customizations.
;; * Fewer startup messages.
;; * Configure backup settings.
;; * Set username and email-address.
;; * Set up authentication sources
;; * Set `LC_MESSAGES'.
;; * Set `slow-computer'.
;;; Code:
(require 'basics/package-management)
(use-package emacs
:straight (:type built-in)
:demand t
:diminish abbrev-mode
:diminish auto-fill-function
;; Banish customizations to another file.
:init (setq custom-file (concat user-emacs-directory "custom.el"))
:custom ((inhibit-startup-screen t)
(inhibit-startup-echo-area-message t)
(backup-directory-alist ; Save backups in ~/.emacs.d/backups/.
`(("." . ,(concat user-emacs-directory "backups"))))
(delete-old-versions t) ; Delete old backups.
(kept-new-versions 6) ; Keep 6 newest backups.
(backup-by-copying t) ; Copy to backup folder.
(version-control t) ; Append version numbers to file names.
(auto-save-file-name-transforms ; Save auto-saves in backup dir.
`((".*" ,(concat user-emacs-directory "backups/") t)))
(create-lockfiles nil) ; Don't create lockfiles (.#<file>).
(user-full-name "tastytea")
(user-mail-address "tastytea@tastytea.de")
(recentf-max-saved-items 200) ; Number of buffers to keep in history.
(auth-sources ; Preference of authentication sources.
'("~/.authinfo.gpg" "~/.authinfo" "~/.netrc"))
(auth-source-gpg-encrypt-to ; Encrypt to these users.
(cons (symbol-value 'user-mail-address) '()))
(what-cursor-show-names t))
:config (progn
;; read more data per chunk. LSP responses are large.
(setq read-process-output-max (* 1024 1024))
(defalias 'yes-or-no-p 'y-or-n-p) ; Just type y/n instead of yes/no.
(savehist-mode t) ; Save minibuffer history.
(global-auto-revert-mode t) ; Auto-revert file if changed on disk.
;; Show manpages and error messages from compilers in English.
(setenv "LC_MESSAGES" "en_US.utf8")
(defvar slow-computer nil) ; Slow computers load fewer packages.
(if (member (system-name) '("steuerbeamter" "azimuth" "localhost"))
(setq slow-computer t)) ; localhost is schnibble.
(defvar-local my/reformat-save t
"Make changes to the buffer on save.
If t, run `whitespace-cleanup', `clang-format-buffer' and so on.")
(put 'my/reformat-save 'safe-local-variable #'booleanp)))
(provide 'basics/global-variables)
;;; global-variables.el ends here