.emacs.d/init.d/basics/global-variables.el
2020-12-05 14:20:44 +01:00

64 lines
2.8 KiB
EmacsLisp

;;; global-variables.el --- Set some global variables. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-12-05T14:20:19+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)
(read-process-output-max (* 1024 1024)) ; LSP needs this.
(gc-cons-threshold (* 800000 2))) ; LSP needs this.
:config (progn
(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.
(defcustom my/reformat-save t
"Make changes to the buffer on save.
If t, run `whitespace-cleanup', `clang-format-buffer' and so on."
:type 'boolean
:safe #'booleanp)))
(provide 'basics/global-variables)
;;; global-variables.el ends here