mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-08-10 18:11:13 +10:00
Updating dotfiles.
This commit is contained in:
@@ -114,6 +114,10 @@ possible."
|
||||
(setq-default indent-tabs-mode nil
|
||||
tab-width 4)
|
||||
|
||||
;; Only indent the line when at BOL or in a line's indentation. Anywhere else,
|
||||
;; insert literal indentation.
|
||||
(setq-default tab-always-indent nil)
|
||||
|
||||
;; Make `tabify' and `untabify' only affect indentation. Not tabs/spaces in the
|
||||
;; middle of a line.
|
||||
(setq tabify-regexp "^\t* [ \t]+")
|
||||
@@ -189,17 +193,23 @@ possible."
|
||||
;; Only prompts for confirmation when buffer is unsaved.
|
||||
revert-without-query (list "."))
|
||||
|
||||
;; Instead of `auto-revert-mode' or `global-auto-revert-mode', we lazily auto
|
||||
;; revert; when we save a file or switch buffers/windows (or focus on Emacs).
|
||||
;; `auto-revert-mode' and `global-auto-revert-mode' would, normally, abuse the
|
||||
;; heck out of inotify handles _or_ aggresively poll your buffer list every X
|
||||
;; seconds. Too many inotify handles can grind Emacs to a halt if you preform
|
||||
;; expensive or batch processes on files outside of Emacs (e.g. their mtime
|
||||
;; changes), and polling your buffer list is terribly inefficient as your
|
||||
;; buffer list grows into the tens or hundreds.
|
||||
;;
|
||||
;; Autorevert normally abuses the heck out of inotify handles which can grind
|
||||
;; Emacs to a halt if you do expensive IO (outside of Emacs) on the files you
|
||||
;; have open (like compression). The only alternative is aggressive polling,
|
||||
;; which is unreliable and expensive with a lot of buffers open.
|
||||
;; So Doom uses a different strategy: we lazily auto revert buffers when the
|
||||
;; user a) saves a file, b) switches to a buffer (or its window), or c) you
|
||||
;; focus Emacs (after using another program). This way, Emacs only ever has to
|
||||
;; operate on, at minimum, a single buffer and, at maximum, X buffers, where X
|
||||
;; is the number of open windows (which is rarely, if ever, over 10).
|
||||
(defun doom-auto-revert-buffer-h ()
|
||||
"Auto revert current buffer, if necessary."
|
||||
(unless (or auto-revert-mode (active-minibuffer-window))
|
||||
(auto-revert-handler)))
|
||||
(let ((auto-revert-mode t))
|
||||
(auto-revert-handler))))
|
||||
|
||||
(defun doom-auto-revert-buffers-h ()
|
||||
"Auto revert stale buffers in visible windows, if necessary."
|
||||
@@ -220,9 +230,15 @@ possible."
|
||||
(file-truename file)
|
||||
file))
|
||||
(setq recentf-filename-handlers
|
||||
'(substring-no-properties ; strip out lingering text properties
|
||||
doom--recent-file-truename ; resolve symlinks of local files
|
||||
abbreviate-file-name) ; replace $HOME with ~
|
||||
'(;; Text properties inflate the size of recentf's files, and there is
|
||||
;; no purpose in persisting them, so we strip them out.
|
||||
substring-no-properties
|
||||
;; Resolve symlinks of local files. Otherwise we get duplicate
|
||||
;; entries opening symlinks.
|
||||
doom--recent-file-truename
|
||||
;; Replace $HOME with ~, which is more portable, and reduces how much
|
||||
;; horizontal space the recentf listing uses to list recent files.
|
||||
abbreviate-file-name)
|
||||
recentf-save-file (concat doom-cache-dir "recentf")
|
||||
recentf-auto-cleanup 'never
|
||||
recentf-max-menu-items 0
|
||||
@@ -309,7 +325,6 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||
|
||||
(use-package! better-jumper
|
||||
:hook (doom-first-input . better-jumper-mode)
|
||||
:hook (better-jumper-post-jump . recenter)
|
||||
:commands doom-set-jump-a doom-set-jump-maybe-a doom-set-jump-h
|
||||
:preface
|
||||
;; REVIEW Suppress byte-compiler warning spawning a *Compile-Log* buffer at
|
||||
|
||||
Reference in New Issue
Block a user