;; Time-stamp: <2024-07-13 14h57 CEST (471b3659)> ;; ----------------------------------------------------------------------------- ;; Interface (tool-bar-mode -1) (menu-bar-mode -1) (scroll-bar-mode -1) (fset 'yes-or-no-p 'y-or-n-p) (setq select-enable-clipboard t select-enable-primary t save-interprogram-paste-before-kill t require-final-newline t visible-bell nil) (setq echo-keystrokes 0.1 confirm-kill-emacs 'y-or-n-p disabled-command-function nil ring-bell-function 'ignore) (size-indication-mode t) (defun enlarge-to-fill () "Stretch the buffer to accomodate `fill-column` many columns." (interactive) (let ((ww (window-width))) (when (< ww (+ 1 fill-column)) (enlarge-window-horizontally (- (+ 1 fill-column) ww))))) (global-set-key (kbd "C-c 3") (lambda () (interactive) (split-window-horizontally) (enlarge-to-fill))) (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/") (load-theme 'acme t) (defun my-disable-bold-fonts () (interactive) (mapc (lambda (face) (set-face-attribute face nil :weight 'normal)) (face-list))) (progn (setq my-font "PxPlus IBM VGA 9x16-24") (setq my-font "Commit Mono-24") (setq my-font "Sudo-22") (setq my-font "Berkeley Mono-24") (set-frame-font my-font) (set-face-attribute 'font-lock-comment-face nil :slant 'italic)) (setq-default line-spacing nil) (blink-cursor-mode 0) (setq cursor-type 'box) ;; (set-cursor-color "orange") (set-fringe-style 0) ;; (set-fringe-mode 128) ;; ----------------------------------------------------------------------------- ;; Backups (setq backup-by-copying t backup-directory-alist '(("." . "/home/user/store/backups/")) delete-old-versions t kept-new-versions 6 kept-old-versions 2 version-control t) (setq create-lockfiles nil) ;; ----------------------------------------------------------------------------- ;; Defaults (setq fill-column 80) (setq standard-indent 4) (setq-default tab-width 4 indent-tabs-mode nil) (add-hook 'before-save-hook #'whitespace-cleanup) (show-paren-mode t) (setq-default truncate-lines t truncate-partial-width-windows nil) (setq scroll-step 1 scroll-margin 5) (setq next-line-add-newlines nil) (setq enable-dir-local-variables nil) (setq shell-file-name "bash") ;; ----------------------------------------------------------------------------- ;; Basic packages (use-package recentf :demand t :config (setq recentf-max-saved-items 42) (recentf-mode)) (use-package uniquify :config (setq uniquify-buffer-name-style 'forward)) (use-package tramp :config :defer (setq tramp-use-ssh-controlmaster-options nil)) (require 'saveplace) (save-place-mode) (use-package ctrlf :ensure t :config (ctrlf-mode 1)) ;; ----------------------------------------------------------------------------- ;; Scratch buffer (defun immortal-scratch () (if (eq (current-buffer) (get-buffer "*scratch*")) (progn (bury-buffer) nil) t)) (add-hook 'kill-buffer-query-functions 'immortal-scratch) ;; I couldn't understand the config options, so this is the next best thing (defun display-startup-echo-area-message () nil) (setq initial-scratch-message nil initial-buffer-choice t) (add-hook 'after-init-hook (lambda () (setq default-directory "~/")))