]> git.earman.xyz Git - emacsinit.git/commitdiff
Various updates
authorrearman <rearman@r717.net>
Thu, 13 Jun 2024 20:27:18 +0000 (16:27 -0400)
committerrearman <rearman@r717.net>
Thu, 13 Jun 2024 20:27:18 +0000 (16:27 -0400)
Try out garbage-collector-magic-hack
Update the remap bindings to the new style
Add some dired and bookmark options

config.org
early-init.el

index ca79e6de966ac0a8c94fa6fd147734a6d9160fa0..d83cfa5f6cecf058eb6be292fff591501deebfa9 100644 (file)
@@ -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 "<remap> <move-beginning-of-line>" '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 "<remap> <goto-line>" '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 "<insert>" 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 "<remap> <capitalize-word>" 'capitalize-dwim)
+(keymap-global-set "<remap> <downcase-word>" 'downcase-dwim)
+(keymap-global-set "<remap> <upcase-word>" '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
 
index fd4d7323fd3827ae83a3a89c5ff31298b59a9d8b..26ed6d837f910e58fc3ecfd96612e6858804bc70 100644 (file)
@@ -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)