101 lines
2.9 KiB
EmacsLisp
101 lines
2.9 KiB
EmacsLisp
;; -*- lexical-binding: t; -*-
|
|
(require 'subr-x)
|
|
(require 'doom-themes)
|
|
|
|
(load-theme 'doom-badger t)
|
|
|
|
(setq inhibit-startup-screen t)
|
|
(setq initial-scratch-message nil)
|
|
|
|
(menu-bar-mode -1)
|
|
(tool-bar-mode -1)
|
|
(scroll-bar-mode -1)
|
|
|
|
(electric-pair-mode 1)
|
|
|
|
;; Backups in Backup-Ordner
|
|
(setq backup-directory-alist
|
|
'(("." . "~/.emacs.d/backups")))
|
|
|
|
(setq make-backup-files t) ;; Backups aktiv
|
|
(setq backup-by-copying t) ;; sicherer (keine Symlink-Probleme)
|
|
(setq version-control t) ;; mehrere Versionen behalten
|
|
(setq delete-old-versions t) ;; alte automatisch löschen
|
|
(setq kept-new-versions 6) ;; wie viele neue behalten
|
|
(setq kept-old-versions 2) ;; wie viele alte behalten
|
|
|
|
;; Autosave-Files in den auto-save-list Ordner
|
|
(setq auto-save-file-name-transforms
|
|
`((".*" "~/.emacs.d/auto-save-list/" t)))
|
|
|
|
;; Maus im Terminal
|
|
(unless (display-graphic-p)
|
|
(xterm-mouse-mode 1))
|
|
|
|
(when (file-exists-p "/etc/arch-release")
|
|
;; Clipboard
|
|
(setq select-enable-clipboard t)
|
|
(setq select-enable-primary t)
|
|
|
|
;; Wayland-Terminal Clipboard via wl-copy / wl-paste
|
|
(unless (display-graphic-p)
|
|
(setq interprogram-cut-function
|
|
(lambda (text &optional _push)
|
|
(let ((process-connection-type nil))
|
|
(let ((proc (start-process "wl-copy" nil "wl-copy")))
|
|
(process-send-string proc text)
|
|
(process-send-eof proc)))))
|
|
|
|
(setq interprogram-paste-function
|
|
(lambda ()
|
|
(string-trim-right
|
|
(shell-command-to-string "wl-paste -n 2>/dev/null"))))))
|
|
|
|
|
|
;; Clipboard
|
|
;; (setq select-enable-clipboard t)
|
|
;; (setq select-enable-primary t)
|
|
|
|
;; ;; Wayland-Terminal Clipboard via wl-copy / wl-paste
|
|
;; (unless (display-graphic-p)
|
|
;; (setq interprogram-cut-function
|
|
;; (lambda (text &optional _push)
|
|
;; (let ((process-connection-type nil))
|
|
;; (let ((proc (start-process "wl-copy" nil "wl-copy")))
|
|
;; (process-send-string proc text)
|
|
;; (process-send-eof proc)))))
|
|
|
|
;; (setq interprogram-paste-function
|
|
;; (lambda ()
|
|
;; (string-trim-right
|
|
;; (shell-command-to-string "wl-paste -n 2>/dev/null")))))
|
|
|
|
;; Hintergrund etwas neutraler
|
|
(set-face-background 'default "#1e1e1e")
|
|
(set-face-background 'fringe "#1e1e1e")
|
|
(set-face-background 'region "#3a3a3a")
|
|
|
|
|
|
|
|
;; WRITING
|
|
;; Schreiblayout für Textmodi
|
|
(defun my/text-indentation-setup ()
|
|
"Angenehme Einrückung und Umbrüche für Text."
|
|
(setq-local left-margin-width 2)
|
|
(setq-local right-margin-width 0)
|
|
(visual-line-mode 1)
|
|
(setq-local word-wrap t)
|
|
(set-window-buffer nil (current-buffer)))
|
|
|
|
(add-hook 'text-mode-hook #'my/text-indentation-setup)
|
|
|
|
(provide 'init-ui)
|
|
|
|
;; Automatisches Speichern wenn Buffer geändert wurde (.org + .md)
|
|
(defun my/auto-save-if-modified ()
|
|
(when (and (buffer-modified-p)
|
|
(derived-mode-p 'org-mode 'markdown-mode))
|
|
(save-buffer)))
|
|
|
|
(run-with-idle-timer 2 t #'my/auto-save-if-modified)
|