2020-02-26 23:07:19 +01:00
|
|
|
;;; global-variables.el --- Set some global variables. -*- lexical-binding: t; -*-
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;; * Banish customizations.
|
|
|
|
;; * Fewer startup messages.
|
|
|
|
;; * Configure backup settings.
|
|
|
|
;; * Set username and email-address.
|
2020-02-26 23:07:19 +01:00
|
|
|
;; * Set up authentication sources
|
2020-03-10 14:33:47 +01:00
|
|
|
;; * Set `LC_MESSAGES'.
|
|
|
|
;; * Set `slow-computer'.
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2020-03-18 15:00:17 +01:00
|
|
|
(require 'basics/package-management)
|
|
|
|
|
2019-10-14 17:38:14 +02:00
|
|
|
(use-package emacs
|
2020-11-18 18:38:55 +01:00
|
|
|
:straight (:type built-in)
|
2020-05-24 22:59:31 +02:00
|
|
|
:demand t
|
2020-02-11 17:59:12 +01:00
|
|
|
:diminish abbrev-mode
|
2020-02-11 18:04:27 +01:00
|
|
|
:diminish auto-fill-function
|
2019-10-14 17:38:14 +02:00
|
|
|
;; Banish customizations to another file.
|
2020-03-10 14:33:47 +01:00
|
|
|
: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.
|
2020-05-17 17:28:28 +02:00
|
|
|
(cons (symbol-value 'user-mail-address) '()))
|
2020-12-03 21:43:43 +01:00
|
|
|
(what-cursor-show-names t)
|
2020-12-08 15:49:23 +01:00
|
|
|
(read-process-output-max (* 1024 1024))) ; LSP needs this.
|
2020-03-10 14:33:47 +01:00
|
|
|
: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"))
|
2020-10-27 09:50:20 +01:00
|
|
|
(setq slow-computer t)) ; localhost is schnibble.
|
2020-12-05 10:55:36 +01:00
|
|
|
(defcustom my/reformat-save t
|
2020-10-27 09:50:20 +01:00
|
|
|
"Make changes to the buffer on save.
|
2020-12-05 10:55:36 +01:00
|
|
|
If t, run `whitespace-cleanup', `clang-format-buffer' and so on."
|
|
|
|
:type 'boolean
|
2020-12-13 19:04:05 +01:00
|
|
|
:safe #'booleanp
|
|
|
|
:group 'my)
|
2020-12-08 15:49:23 +01:00
|
|
|
(defun my/set-garbage-collection-threshold ()
|
|
|
|
"Set garbage collection threshold to final value."
|
|
|
|
(let ((multiplier 2))
|
|
|
|
(customize-set-variable
|
|
|
|
'gc-cons-threshold
|
|
|
|
(* (car (get 'gc-cons-threshold 'standard-value))
|
|
|
|
multiplier)))))
|
|
|
|
:hook (after-init . my/set-garbage-collection-threshold))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
2021-05-25 12:43:33 +02:00
|
|
|
(use-package with-editor
|
|
|
|
:after (server)
|
2021-05-28 14:13:14 +02:00
|
|
|
:demand t
|
2021-05-25 12:43:33 +02:00
|
|
|
:config (progn
|
2021-05-27 22:10:59 +02:00
|
|
|
(setenv "EDITOR" (with-editor-locate-emacsclient))))
|
2021-05-25 12:43:33 +02:00
|
|
|
|
2019-10-14 17:38:14 +02:00
|
|
|
(provide 'basics/global-variables)
|
|
|
|
;;; global-variables.el ends here
|