add `doom/large-file-check to prompt literal open of large files
This commit is contained in:
parent
eba9c382eb
commit
712c01f4f4
2 changed files with 28 additions and 0 deletions
|
@ -1,5 +1,16 @@
|
|||
;;; core-editor.el --- filling the editor shaped hole in the Emacs OS
|
||||
|
||||
|
||||
(defvar doom-large-file-size 1
|
||||
"Size (in MB) above which the user will be propmpted to open the file literally to avoid
|
||||
performance issues. Opening literally means that no major or minor modes are active and
|
||||
the buffer is readonly.")
|
||||
|
||||
(defvar doom-large-file-modes-list
|
||||
'(archive-mode tar-mode jka-compr git-commit-mode image-mode
|
||||
doc-view-mode doc-view-mode-maybe ebrowse-tree-mode pdf-view-mode)
|
||||
"Major modes which `doom/check-large-file' will not be automatically applied to")
|
||||
|
||||
(setq-default
|
||||
;; Save clipboard contents into kill-ring before replacing them
|
||||
save-interprogram-paste-before-kill t
|
||||
|
@ -88,6 +99,9 @@
|
|||
(insert linestr))))
|
||||
(advice-add #'delete-trailing-whitespace :around #'doom*delete-trailing-whitespace)
|
||||
|
||||
;; automatically check for large files and optionally prompt to open literally
|
||||
(add-hook 'find-file-hook 'doom/check-large-file)
|
||||
|
||||
|
||||
;;
|
||||
;; Core Plugins
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue