Use setq-default for global variables

This commit is contained in:
Marcus Kammer 2024-08-27 08:39:06 +02:00
parent 8a0bc113e1
commit d80c7ce139
Signed by: marcuskammer
GPG key ID: C374817BE285268F

46
init.el
View file

@ -9,22 +9,22 @@
(global-prettify-symbols-mode -1)
;; (setq display-time-format "W%V %a %d %b %Y %R %z")
(setq display-time-format "W%V %a %d %b %R")
(setq display-time-24hr-format t)
(setq-default display-time-format "W%V %a %d %b %R")
(setq-default display-time-24hr-format t)
;; Cursor and mouse
(column-number-mode 1)
(mouse-wheel-mode 1)
(blink-cursor-mode -1)
(setq grep-command "grep -i -nH -e ")
(setq-default grep-command "grep -i -nH -e ")
(when (eq system-type 'gnu/linux)
(setq shell-file-name "/bin/bash")
(setq tex-shell-file-name "/bin/bash"))
(setq-default shell-file-name "/bin/bash")
(setq-default tex-shell-file-name "/bin/bash"))
;; Files and sessions
(setq auto-save-timeout 60)
(setq-default auto-save-timeout 60)
;; Tabs, spaces, lines and parenthesis
(show-paren-mode 1)
@ -36,8 +36,8 @@
;; Miscellaneous
(require 'cl-lib)
(setq default-major-mode 'text-mode)
(setq inhibit-startup-buffer-menu t inhibit-startup-screen t)
(setq-default default-major-mode 'text-mode)
(setq-default inhibit-startup-buffer-menu t inhibit-startup-screen t)
(put 'narrow-to-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
@ -56,20 +56,20 @@
(add-hook 'write-file-hooks 'delete-trailing-whitespace)
(add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
(add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files)
(setq compilation-ask-about-save nil)
(setq vc-handled-backends '(Git Hg)) ;; Only use Git and Hg for VC
(setq-default compilation-ask-about-save nil)
(setq-default vc-handled-backends '(Git Hg)) ;; Only use Git and Hg for VC
(setq horizontal-scroll-bar nil)
(setq vertical-scroll-bar nil)
(setq-default horizontal-scroll-bar nil)
(setq-default vertical-scroll-bar nil)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((meta)) ((control) . text-scale)))
(setq-default mouse-wheel-scroll-amount '(1 ((shift) . 1) ((meta)) ((control) . text-scale)))
;; SIMPLE
(setq completion-auto-wrap t)
(setq completion-auto-select nil)
(setq-default completion-auto-wrap t)
(setq-default completion-auto-select t)
;; MINIBUFFER
(setq completions-format 'one-column)
(setq completions-format 'horizontal)
(setq completions-header-format nil)
(setq completions-max-height 20)
@ -86,30 +86,30 @@
(set-default-coding-systems 'utf-8-unix)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8-unix)
(setq-default default-buffer-file-coding-system 'utf-8-unix)
(setenv "PYTHONIOENCODING" "UTF-8")
(when (eq system-type 'gnu/linux)
(setq custom-file "~/.emacs.d/bundle/custom_gnu.el"
(setq-default custom-file "~/.emacs.d/bundle/custom_gnu.el"
browse-url-secondary-browser-function 'browse-url-firefox)
(unless (file-directory-p "~/cl-sites/")
(async-shell-command "git clone git@git.sr.ht:~marcuskammer/cl-sites ~/cl-sites")))
(when (eq system-type 'windows-nt)
(setq explicit-shell-file-name
(setq-default explicit-shell-file-name
(seq-find 'file-executable-p
'("C:\\Program Files\\PowerShell\\7\\pwsh.exe"
"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe")))
(setq explicit-powershell.exe-args '("-NoProfile" "-InputFormat" "Text"))
(setq custom-file "~/.emacs.d/bundle/custom_win32.el")
(setq-default explicit-powershell.exe-args '("-NoProfile" "-InputFormat" "Text"))
(setq-default custom-file "~/.emacs.d/bundle/custom_win32.el")
(when (string= system-name "XPS-8930")
(cd "~/")
(setq custom-file "~/.emacs.d/bundle/custom_win32_XPS8930.el"))
(setq-default custom-file "~/.emacs.d/bundle/custom_win32_XPS8930.el"))
(when (string= system-name "EVG03435NB")
(cd "~/OneDrive - Siemens AG/")
(setq custom-file "~/.emacs.d/bundle/custom_win32_EVG03435NB.el")))
(setq-default custom-file "~/.emacs.d/bundle/custom_win32_EVG03435NB.el")))
(load custom-file :noerror)