(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
(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
(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
****** 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)))
(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.
#+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
#+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 ()
*** 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