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

66 lines
2.2 KiB
EmacsLisp
Raw Normal View History

2019-10-14 17:38:14 +02:00
;;; global-variables.el --- Set global variables. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-01-26T19:32:07+0100>
2019-10-14 17:38:14 +02:00
;;; Commentary:
;; * Set `slow-computer'.
;; * Set `LANG'.
;; * Banish customizations.
;; * Fewer startup messages.
;; * Configure backup settings.
;; * Set username and email-address.
;;; Code:
(defvar slow-computer nil)
(if (member (system-name) '("steuerbeamter" "azimuth" "localhost"))
(setq slow-computer t)) ; localhost is schnibble
2019-10-14 17:38:14 +02:00
;; Show manpages and error messages from compilers in English.
(setenv "LANG" "en_US.utf8")
(use-package emacs
:ensure nil
:init
;; Banish customizations to another file.
(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 ~/.emacs.d/backups/.
`((".*" ,(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) ; Keep this number of buffers in history.
2019-10-14 17:38:14 +02:00
2019-11-20 04:52:01 +01:00
;; Preference of authentication sources.
(auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc"))
;; Encrypt to these users.
(auth-source-gpg-encrypt-to (cons (symbol-value 'user-mail-address) '()))
2019-10-14 17:38:14 +02:00
:config
(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.
(defun my/clangd-version ()
"Returns the version of clangd as float."
(string-to-number
(nth 2 (split-string (shell-command-to-string "clangd --version")))))
2019-10-14 17:38:14 +02:00
)
(provide 'basics/global-variables)
;;; global-variables.el ends here