From: rearman Date: Thu, 13 Jun 2024 20:27:18 +0000 (-0400) Subject: Various updates X-Git-Url: https://git.earman.xyz/?a=commitdiff_plain;h=2dcda96861b305cffa9dc20e16205be735b8810d;p=emacsinit.git Various updates Try out garbage-collector-magic-hack Update the remap bindings to the new style Add some dired and bookmark options --- diff --git a/config.org b/config.org index ca79e6d..d83cfa5 100644 --- a/config.org +++ b/config.org @@ -34,8 +34,8 @@ Set the GC threshold to max during startup, then set it back to a value that is (setq gc-cons-threshold most-positive-fixnum gc-cons-percentage 0.6) -(add-hook 'after-init-hook #'(lambda () (setq gc-cons-threshold (* 1024 1024 25) - gc-cons-percentage 0.1))) +;; (add-hook 'after-init-hook #'(lambda () (setq gc-cons-threshold (* 1024 1024 25) +;; gc-cons-percentage 0.1))) #+END_SRC ** Basic UI preferences @@ -84,6 +84,20 @@ Non-gnu is in the defaults now, so I only need to add melpa. (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) #+END_SRC +*** Garbage Collector Magic Hack +Better Performance? Taken from [[https://rossabaker.com/configs/emacs/#garbage-collection][rossbaker.com]] +#+BEGIN_SRC emacs-lisp +(use-package gcmh + :ensure t + :init + (setq gc-cons-threshold most-positive-fixnum) + :hook + (emacs-startup . gcmh-mode) + :custom + (gcmh-idle-delay 'auto) + (gcmh-auto-idle-delay-factor 10) + (gcmh-high-cons-threshold (* 16 1024 1024))) +#+END_SRC *** Ledger-mode Accounting @@ -471,6 +485,11 @@ Bind ~find-file-at-point~ and ~bookmark-jump-other-window~. (keymap-global-set "C-x r B" 'bookmark-jump-other-window) #+END_SRC +Save bookmarks every time I edit them. +#+BEGIN_SRC emacs-lisp +(setq bookmark-save-flag 1) +#+END_SRC + **** Undo/redo I like putting redo on ~C-\~. Easier for me to remember than the ~C-M-_~ default. #+BEGIN_SRC emacs-lisp @@ -671,7 +690,7 @@ as a visual-line respecter." ****** Re-mappings Remap =move-beginning-of-line=, then remap =beginning-of-visual-line= when going into =visual-line-mode=. A simple remap would not work for =visual-line-mode=, so I explicitly set =C-a=. #+BEGIN_SRC emacs-lisp -(global-set-key [remap move-beginning-of-line] 're/smart-beginning-of-line) +(keymap-global-set " " 're/smart-beginning-of-line) (add-hook 'visual-line-mode-hook (lambda () (keymap-global-set "C-a" 're/smart-beginning-of-visual-line))) @@ -686,7 +705,7 @@ I don't want line numbers in the margin unless I am actively trying to go to a l (call-interactively 'goto-line) (display-line-numbers-mode -1)) -(global-set-key [remap goto-line] 're/goto-line) +(keymap-global-set " " 're/goto-line) #+END_SRC ***** Other window or split window I ripped this defun and binding from [[https://github.com/lem-project/lem][lem]]. Can't live without it now. Does similar things as [[id:1c8d7229-796f-446a-8ae8-247cd6164a12][Windmove]], but without having to specify a direction. @@ -736,6 +755,13 @@ I keep accidentally enabling ~overwrite-mode~, so disable the ~insert~ key #+BEGIN_SRC emacs-lisp (keymap-global-set "" nil) #+END_SRC +**** DWIM Case +Case-changing functions that respect region. Taken from [[https://rossabaker.com/configs/emacs/#dwim-case][rossbaker.com]] +#+BEGIN_SRC emacs-lisp +(keymap-global-set " " 'capitalize-dwim) +(keymap-global-set " " 'downcase-dwim) +(keymap-global-set " " 'upcase-dwim) +#+END_SRC *** Elisp/Eval bindings **** Eval Region @@ -1375,9 +1401,11 @@ Give me logical in/out-denting on the easier binding, since I use that more ofte #+END_SRC ** Dired configuration -Make dired use the same switches I prefer for =ls=, give me a simpler listing, and default to using its current buffer for visiting a file, rather than creating a new one. +Make dired use the same switches I prefer for =ls=, give me a simpler listing, rename with version control, auto-revert on visit, and default to using its current buffer for visiting a file, rather than creating a new one. #+BEGIN_SRC emacs-lisp -(setq dired-listing-switches "-al") +(setq dired-listing-switches "-al" + dired-vc-rename-file t + dired-auto-revert-buffer t) (add-hook 'dired-mode-hook (lambda () @@ -1399,7 +1427,7 @@ Here are the various customizations I have for eshell. *** Make it play nice with corfu #+BEGIN_SRC emacs-lisp (add-hook 'eshell-mode-hook (lambda () - ;; (setq-local corfu-auto nil) + (setq-local corfu-auto nil) (corfu-mode))) #+END_SRC diff --git a/early-init.el b/early-init.el index fd4d732..26ed6d8 100644 --- a/early-init.el +++ b/early-init.el @@ -7,8 +7,8 @@ (setq gc-cons-threshold most-positive-fixnum gc-cons-percentage 0.6) -(add-hook 'after-init-hook #'(lambda () (setq gc-cons-threshold (* 1024 1024 25) - gc-cons-percentage 0.1))) +;; (add-hook 'after-init-hook #'(lambda () (setq gc-cons-threshold (* 1024 1024 25) +;; gc-cons-percentage 0.1))) (menu-bar-mode -1) (tool-bar-mode -1)