Add new settings
This commit is contained in:
17
README.md
17
README.md
@@ -153,6 +153,21 @@ You can also use the [vim-tab-bar](https://github.com/jamescherti/vim-tab-bar.el
|
|||||||
(vim-tab-bar-mode 1))
|
(vim-tab-bar-mode 1))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also install `vdiff`, which provides Vimdiff-like functionality for Emacs.
|
||||||
|
``` emacs-lisp
|
||||||
|
(use-package vdiff
|
||||||
|
:ensure t
|
||||||
|
:defer t
|
||||||
|
:commands (vdiff-buffers
|
||||||
|
vdiff-buffers3
|
||||||
|
vdiff-quit
|
||||||
|
vdiff-files
|
||||||
|
vdiff-files3)
|
||||||
|
:custom
|
||||||
|
(vdiff-auto-refine t)
|
||||||
|
(vdiff-only-highlight-refinements t))
|
||||||
|
```
|
||||||
|
|
||||||
### Automatically compile Emacs Lisp code (auto-compile)
|
### Automatically compile Emacs Lisp code (auto-compile)
|
||||||
|
|
||||||
The auto-compile package automates the byte-compilation of Emacs Lisp files, ensuring that your code runs more efficiently by converting it to byte-code. This process reduces the load time and execution time of your Emacs configuration and other Lisp files, leading to faster performance. Additionally, auto-compile helps maintain an up-to-date and optimized configuration by recompiling files automatically when they are saved, eliminating the need for manual compilation and minimizing potential issues caused by outdated byte-code.
|
The auto-compile package automates the byte-compilation of Emacs Lisp files, ensuring that your code runs more efficiently by converting it to byte-code. This process reduces the load time and execution time of your Emacs configuration and other Lisp files, leading to faster performance. Additionally, auto-compile helps maintain an up-to-date and optimized configuration by recompiling files automatically when they are saved, eliminating the need for manual compilation and minimizing potential issues caused by outdated byte-code.
|
||||||
@@ -178,6 +193,8 @@ To activate gcmh-mode, add the following to the beginning of `~/.emacs.d/post-in
|
|||||||
:ensure t
|
:ensure t
|
||||||
:hook (after-init . gcmh-mode)
|
:hook (after-init . gcmh-mode)
|
||||||
:custom
|
:custom
|
||||||
|
(gcmh-idle-delay 'auto)
|
||||||
|
(gcmh-auto-idle-delay-factor 10)
|
||||||
(gcmh-low-cons-threshold minimal-emacs-gc-cons-threshold))
|
(gcmh-low-cons-threshold minimal-emacs-gc-cons-threshold))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,8 @@
|
|||||||
|
|
||||||
(set-language-environment "UTF-8")
|
(set-language-environment "UTF-8")
|
||||||
|
|
||||||
|
(setq custom-theme-directory (expand-file-name "themes/" user-emacs-directory))
|
||||||
|
|
||||||
;; Set-language-environment sets default-input-method, which is unwanted.
|
;; Set-language-environment sets default-input-method, which is unwanted.
|
||||||
(setq default-input-method nil)
|
(setq default-input-method nil)
|
||||||
|
|
||||||
|
|||||||
76
init.el
76
init.el
@@ -54,7 +54,10 @@
|
|||||||
(require 'use-package))
|
(require 'use-package))
|
||||||
|
|
||||||
;;; Misc
|
;;; Misc
|
||||||
|
|
||||||
|
;; Allow nested minibuffers
|
||||||
(setq enable-recursive-minibuffers t)
|
(setq enable-recursive-minibuffers t)
|
||||||
|
|
||||||
(setq custom-file
|
(setq custom-file
|
||||||
(expand-file-name "custom.el"
|
(expand-file-name "custom.el"
|
||||||
minimal-emacs--default-user-emacs-directory))
|
minimal-emacs--default-user-emacs-directory))
|
||||||
@@ -62,6 +65,29 @@
|
|||||||
;; switch-to-buffer runs pop-to-buffer-same-window instead
|
;; switch-to-buffer runs pop-to-buffer-same-window instead
|
||||||
(setq switch-to-buffer-obey-display-actions t)
|
(setq switch-to-buffer-obey-display-actions t)
|
||||||
|
|
||||||
|
;; Keep the cursor out of the read-only portions of the.minibuffer
|
||||||
|
(setq minibuffer-prompt-properties
|
||||||
|
'(read-only t intangible t cursor-intangible t face
|
||||||
|
minibuffer-prompt))
|
||||||
|
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
||||||
|
|
||||||
|
(setq show-paren-delay 0.1
|
||||||
|
show-paren-highlight-openparen t
|
||||||
|
show-paren-when-point-inside-paren t
|
||||||
|
show-paren-when-point-in-periphery t)
|
||||||
|
|
||||||
|
(setq whitespace-line-column nil) ; whitespace-mode
|
||||||
|
|
||||||
|
;; I reduced the default value of 9 to simplify the font-lock keyword,
|
||||||
|
;; aiming to improve performance. This package helps differentiate
|
||||||
|
;; nested delimiter pairs, particularly in languages with heavy use of
|
||||||
|
;; parentheses.
|
||||||
|
(setq rainbow-delimiters-max-face-count 5)
|
||||||
|
|
||||||
|
;; Can be activated with `display-line-numbers-mode'
|
||||||
|
(setq-default display-line-numbers-width 3)
|
||||||
|
(setq-default display-line-numbers-widen t)
|
||||||
|
|
||||||
;;; Files
|
;;; Files
|
||||||
|
|
||||||
;; Disable the warning "X and Y are the same file". Ignoring this warning is
|
;; Disable the warning "X and Y are the same file". Ignoring this warning is
|
||||||
@@ -73,6 +99,27 @@
|
|||||||
(setq find-file-visit-truename t
|
(setq find-file-visit-truename t
|
||||||
vc-follow-symlinks t)
|
vc-follow-symlinks t)
|
||||||
|
|
||||||
|
;; Skip confirmation prompts when creating a new file or buffer
|
||||||
|
(setq confirm-nonexistent-file-or-buffer nil)
|
||||||
|
|
||||||
|
(setq uniquify-buffer-name-style 'forward)
|
||||||
|
|
||||||
|
(setq mouse-yank-at-point t)
|
||||||
|
|
||||||
|
(setq frame-title-format '("%b – Emacs")
|
||||||
|
icon-title-format frame-title-format)
|
||||||
|
|
||||||
|
;; Prefer vertical splits over horizontal ones
|
||||||
|
(setq split-width-threshold 170
|
||||||
|
split-height-threshold nil)
|
||||||
|
|
||||||
|
;; The native border "uses" a pixel of the fringe on the rightmost
|
||||||
|
;; splits, whereas `window-divider` does not.
|
||||||
|
(setq window-divider-default-bottom-width 1
|
||||||
|
window-divider-default-places t
|
||||||
|
window-divider-default-right-width 1)
|
||||||
|
(add-hook 'after-init-hook #'window-divider-mode)
|
||||||
|
|
||||||
;;; Backup files
|
;;; Backup files
|
||||||
|
|
||||||
;; Avoid generating backups or lockfiles to prevent creating world-readable
|
;; Avoid generating backups or lockfiles to prevent creating world-readable
|
||||||
@@ -97,9 +144,9 @@
|
|||||||
;; auto-saved data.
|
;; auto-saved data.
|
||||||
(setq auto-save-default t)
|
(setq auto-save-default t)
|
||||||
|
|
||||||
;; Do not auto-disable auto-save after deleting large chunks of text. The
|
;; Do not auto-disable auto-save after deleting large chunks of
|
||||||
;; purpose of auto-save is to provide a failsafe, and disabling it contradicts
|
;; text. The purpose of auto-save is to provide a failsafe, and
|
||||||
;; this objective.
|
;; disabling it contradicts this objective.
|
||||||
(setq auto-save-include-big-deletions t)
|
(setq auto-save-include-big-deletions t)
|
||||||
|
|
||||||
(setq auto-save-list-file-prefix
|
(setq auto-save-list-file-prefix
|
||||||
@@ -111,9 +158,11 @@
|
|||||||
(setq kill-buffer-delete-auto-save-files t)
|
(setq kill-buffer-delete-auto-save-files t)
|
||||||
|
|
||||||
;;; Auto revert
|
;;; Auto revert
|
||||||
(setq auto-revert-stop-on-user-input nil
|
;; Auto-revert in Emacs is a feature that automatically updates the
|
||||||
auto-revert-use-notify nil
|
;; contents of a buffer to reflect changes made to the underlying file
|
||||||
revert-without-query (list ".") ; Do not prompt
|
;; on disk.
|
||||||
|
(setq revert-without-query (list ".") ; Do not prompt
|
||||||
|
auto-revert-stop-on-user-input nil
|
||||||
auto-revert-verbose t)
|
auto-revert-verbose t)
|
||||||
|
|
||||||
;;; recentf
|
;;; recentf
|
||||||
@@ -121,6 +170,7 @@
|
|||||||
;; accessed files, making it easier to reopen files you have worked on
|
;; accessed files, making it easier to reopen files you have worked on
|
||||||
;; recently.
|
;; recently.
|
||||||
(setq recentf-max-saved-items 300) ; default is 20
|
(setq recentf-max-saved-items 300) ; default is 20
|
||||||
|
(setq recentf-auto-cleanup 'mode)
|
||||||
(add-hook 'after-init-hook #'recentf-mode)
|
(add-hook 'after-init-hook #'recentf-mode)
|
||||||
|
|
||||||
;;; savehist
|
;;; savehist
|
||||||
@@ -129,8 +179,9 @@
|
|||||||
|
|
||||||
;;; Subr
|
;;; Subr
|
||||||
;; Allow for shorter responses: "y" for yes and "n" for no.
|
;; Allow for shorter responses: "y" for yes and "n" for no.
|
||||||
(setq use-short-answers t)
|
(if (boundp 'use-short-answers)
|
||||||
(defalias #'yes-or-no-p 'y-or-n-p)
|
(setq use-short-answers t)
|
||||||
|
(advice-add #'yes-or-no-p :override #'y-or-n-p))
|
||||||
(defalias #'view-hello-file #'ignore) ; Never show the hello file
|
(defalias #'view-hello-file #'ignore) ; Never show the hello file
|
||||||
|
|
||||||
;;; Mule-util
|
;;; Mule-util
|
||||||
@@ -244,6 +295,15 @@
|
|||||||
;; Remove duplicates from the kill ring to reduce clutter
|
;; Remove duplicates from the kill ring to reduce clutter
|
||||||
(setq kill-do-not-save-duplicates t)
|
(setq kill-do-not-save-duplicates t)
|
||||||
|
|
||||||
|
;;; ansi-color
|
||||||
|
(setq comint-prompt-read-only t)
|
||||||
|
(setq comint-buffer-maximum-size 2048)
|
||||||
|
|
||||||
|
;;; compile
|
||||||
|
(setq compilation-always-kill t
|
||||||
|
compilation-ask-about-save nil
|
||||||
|
compilation-scroll-output 'first-error)
|
||||||
|
|
||||||
;;; Load post-init.el
|
;;; Load post-init.el
|
||||||
(minimal-emacs-load-user-init "post-init.el")
|
(minimal-emacs-load-user-init "post-init.el")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user