From 038e5de1adf2de6cdf28a428a44b0753813b928c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 29 Dec 2021 22:55:55 -0600 Subject: Lots and lots of changes, oh jeez --- lisp/+emacs.el | 95 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 41 deletions(-) (limited to 'lisp/+emacs.el') diff --git a/lisp/+emacs.el b/lisp/+emacs.el index 7ad6768..2d63e82 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el @@ -11,7 +11,8 @@ ;; Emacs. But like, why would I want to? ;; Other notable packages include -;; https://git.sr.ht/~technomancy/better-defaults/ +;; - https://git.sr.ht/~technomancy/better-defaults/ +;; - https://github.com/susam/emfy ;;; Code: @@ -45,6 +46,7 @@ Do this only if the buffer is not visiting a file." completion-category-overrides '((file (styles . (partial-completion)))) completion-ignore-case t completion-styles '(substring partial-completion) + create-lockfiles nil cursor-in-non-selected-windows 'hollow cursor-type 'bar custom-file (.etc "custom.el") @@ -64,6 +66,8 @@ Do this only if the buffer is not visiting a file." hscroll-step 1 imenu-auto-rescan t indent-tabs-mode nil + indicate-empty-lines t + indicate-buffer-boundaries 'left inhibit-startup-screen t initial-buffer-choice t kill-do-not-save-duplicates t @@ -75,8 +79,8 @@ Do this only if the buffer is not visiting a file." mark-ring-max 50 minibuffer-eldef-shorten-default t minibuffer-prompt-properties (list 'read-only t - 'cursor-intangible t - 'face 'minibuffer-prompt) + 'cursor-intangible t + 'face 'minibuffer-prompt) mode-require-final-newline 'visit-save mouse-drag-copy-region t mouse-yank-at-point t @@ -84,8 +88,8 @@ Do this only if the buffer is not visiting a file." read-answer-short t read-buffer-completion-ignore-case t read-extended-command-predicate (when (fboundp - 'command-completion-default-include-p) - 'command-completion-default-include-p) + 'command-completion-default-include-p) + 'command-completion-default-include-p) recenter-positions '(top middle bottom) regexp-search-ring-max 100 regexp-search-ring-max 200 @@ -101,7 +105,9 @@ Do this only if the buffer is not visiting a file." show-paren-style 'mixed show-paren-when-point-in-periphery t show-paren-when-point-inside-paren t + ;;show-trailing-whitespace t tab-bar-show 1 + tab-width 4 tramp-backup-directory-alist backup-directory-alist use-dialog-box nil use-file-dialog nil @@ -117,6 +123,13 @@ Do this only if the buffer is not visiting a file." yank-pop-change-selection t ) +;; Programming language offsets. +;; Set these after the initial block so I can use `tab-width' +(setq-default + c-basic-offset tab-width) + +;; Emacs 28 ships with an option, `use-short-answers', that makes this form +;; obsolete, but I still use 27 at work. (when (version< emacs-version "28") (fset 'yes-or-no-p 'y-or-n-p)) @@ -150,23 +163,23 @@ Do this only if the buffer is not visiting a file." ;;; Modes (dolist (enable-mode '(global-auto-revert-mode - blink-cursor-mode - electric-pair-mode - show-paren-mode - global-so-long-mode - minibuffer-depth-indicate-mode - file-name-shadow-mode - minibuffer-electric-default-mode - delete-selection-mode - column-number-mode)) + blink-cursor-mode + electric-pair-mode + show-paren-mode + global-so-long-mode + minibuffer-depth-indicate-mode + file-name-shadow-mode + minibuffer-electric-default-mode + delete-selection-mode + column-number-mode)) (when (fboundp enable-mode) (funcall enable-mode +1))) (dolist (disable-mode '(tooltip-mode tool-bar-mode - menu-bar-mode - scroll-bar-mode - horizontal-scroll-bar-mode)) + menu-bar-mode + scroll-bar-mode + horizontal-scroll-bar-mode)) (when (fboundp disable-mode) (funcall disable-mode -1))) @@ -187,19 +200,19 @@ PRESERVE-NL-BACK and MODE." (cycle-spacing (- n) preserve-nl-back mode)) (defun +save-buffers-quit (&optional arg) - "Silently save each buffer, then kill the current connection. + "Silently save each buffer, then kill the current connection. If the current frame has no client, kill Emacs itself using `save-buffers-kill-emacs' after confirming with the user. With prefix ARG, silently save all file-visiting buffers, then kill without asking." - (interactive "P") - (save-some-buffers t) - (if (and (not (frame-parameter nil 'client)) - (and (not arg))) - (when (yes-or-no-p "Sure you want to quit? ") - (save-buffers-kill-emacs)) - (server-save-buffers-kill-terminal nil))) + (interactive "P") + (save-some-buffers t) + (if (and (not (frame-parameter nil 'client)) + (and (not arg))) + (when (yes-or-no-p "Sure you want to quit? ") + (save-buffers-kill-emacs)) + (server-save-buffers-kill-terminal nil))) ;;; Bindings @@ -225,9 +238,9 @@ kill without asking." (when (require 'uniquify nil :noerror) (setq-default uniquify-buffer-name-style 'forward - uniquify-separator path-separator - uniquify-after-kill-buffer-p t - uniquify-ignore-buffers-re "^\\*")) + uniquify-separator path-separator + uniquify-after-kill-buffer-p t + uniquify-ignore-buffers-re "^\\*")) (when (require 'goto-addr) (if (fboundp 'global-goto-address-mode) @@ -236,34 +249,34 @@ kill without asking." (when (require 'recentf nil :noerror) (setq-default recentf-save-file (.etc "recentf.el") - recentf-max-menu-items 100 - recentf-max-saved-items nil - recentf-auto-cleanup 'mode) + recentf-max-menu-items 100 + recentf-max-saved-items nil + recentf-auto-cleanup 'mode) (add-to-list 'recentf-exclude .etc) (recentf-mode +1)) (when (require 'repeat nil :noerror) (setq-default repeat-exit-key "g" - repeat-exit-timeout 5) + repeat-exit-timeout 5) (repeat-mode +1)) (when (require 'savehist nil :noerror) (setq-default history-length t - history-delete-duplicates t - history-autosave-interval 60 - savehist-file (.etc "savehist.el")) + history-delete-duplicates t + history-autosave-interval 60 + savehist-file (.etc "savehist.el")) (dolist (var '(extended-command-history - global-mark-ring - kill-ring - regexp-search-ring - search-ring - mark-ring)) + global-mark-ring + kill-ring + regexp-search-ring + search-ring + mark-ring)) (add-to-list 'savehist-additional-variables var)) (savehist-mode +1)) (when (require 'saveplace nil :noerror) (setq-default save-place-file (.etc "places.el") - save-place-forget-unreadable-files (eq system-type 'gnu/linux)) + save-place-forget-unreadable-files (eq system-type 'gnu/linux)) (save-place-mode +1)) ;; (when (require 'tramp) -- cgit 1.4.1-21-gabe81