Config: Strip down and simplify Emacs config
- Remove consult-dir, nerd-icons-completion, org-contrib and some other unused package - Delete init-org-refile.el and related keybindings - Prune EMMS config - Remove EXWM flatpak launcher helpers (vscodium, localsend, steam) - Extract Windows dirvish video preview fix to standalone module - Drop built-in settings moved elsewhere (startup defaults, whitespace, etc.) - Clean up trailing whitespace / process list prettify configs
This commit is contained in:
@@ -16,45 +16,7 @@
|
||||
:config
|
||||
(gcmh-mode 1))
|
||||
|
||||
(use-package emacs
|
||||
:hook (((prog-mode markdown-mode conf-mode) . enable-trailing-whitespace))
|
||||
:init
|
||||
(setq kill-whole-line t ; Kill line including '\n'
|
||||
line-move-visual nil
|
||||
track-eol t ; Keep cursor at end of lines. Require line-move-visual is nil.
|
||||
set-mark-command-repeat-pop t) ; Repeating C-SPC after popping mark pops it again
|
||||
|
||||
;; Visualize TAB, (HARD) SPACE, NEWLINE
|
||||
(setq-default show-trailing-whitespace nil) ; Don't show trailing whitespace by default
|
||||
(defun enable-trailing-whitespace ()
|
||||
"Show trailing spaces and delete on saving."
|
||||
(setq show-trailing-whitespace t)
|
||||
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t))
|
||||
|
||||
;; Prettify the process list
|
||||
(with-no-warnings
|
||||
(defun my/list-processes--prettify ()
|
||||
"Prettify process list."
|
||||
(when-let* ((entries tabulated-list-entries))
|
||||
(setq tabulated-list-entries nil)
|
||||
(dolist (p (process-list))
|
||||
(when-let* ((val (cadr (assoc p entries)))
|
||||
(name (aref val 0))
|
||||
(pid (aref val 1))
|
||||
(status (aref val 2))
|
||||
(status (list status
|
||||
'face
|
||||
(if (memq status '(stop exit closed failed))
|
||||
'error
|
||||
'success)))
|
||||
(buf-label (aref val 3))
|
||||
(tty (list (aref val 4) 'face 'font-lock-doc-face))
|
||||
(thread (list (aref val 5) 'face 'font-lock-doc-face))
|
||||
(cmd (list (aref val 6) 'face 'completions-annotations)))
|
||||
(push (list p (vector name pid status buf-label tty thread cmd))
|
||||
tabulated-list-entries)))))
|
||||
(advice-add #'list-processes--refresh :after #'my/list-processes--prettify)))
|
||||
|
||||
;; restart-emacs
|
||||
(use-package restart-emacs)
|
||||
|
||||
;; 安装multiple-cursors
|
||||
@@ -99,6 +61,7 @@
|
||||
(default-directory "~/"))
|
||||
(consult-fd)))
|
||||
|
||||
;; everything
|
||||
(when *is-windows*
|
||||
(setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk))
|
||||
(setq consult-ripgrep-args (encode-coding-string
|
||||
@@ -106,18 +69,9 @@
|
||||
'gbk))
|
||||
(add-to-list 'process-coding-system-alist '("es" gbk . gbk)))
|
||||
|
||||
;; mdfind
|
||||
(when *is-mac*
|
||||
(setopt consult-locate-args "mdfind -name"))
|
||||
|
||||
(delete 'consult-source-recent-file consult-buffer-sources))
|
||||
|
||||
(use-package consult-dir
|
||||
:bind (("C-x C-d" . consult-dir)
|
||||
:map minibuffer-local-completion-map
|
||||
("C-x C-d" . consult-dir)
|
||||
("C-x C-j" . consult-dir-jump-file))
|
||||
:config
|
||||
(delete 'consult-dir--source-recentf consult-dir-sources))
|
||||
(setopt consult-locate-args "mdfind -name")))
|
||||
|
||||
(use-package consult-notes
|
||||
:config
|
||||
@@ -182,11 +136,10 @@ targets."
|
||||
(advice-add #'embark-completing-read-prompter
|
||||
:around #'embark-hide-which-key-indicator))))
|
||||
|
||||
;; 安装embark-consult和wgrep
|
||||
(use-package embark-consult)
|
||||
(use-package wgrep)
|
||||
|
||||
(with-eval-after-load
|
||||
;; embark-consult
|
||||
(use-package embark-consult
|
||||
:config
|
||||
(with-eval-after-load
|
||||
'consult
|
||||
'(with-eval-after-load
|
||||
'embark
|
||||
@@ -194,7 +147,10 @@ targets."
|
||||
(require 'embark-consult)
|
||||
(add-hook
|
||||
'embark-collect-mode-hook
|
||||
#'consult-preview-at-point-mode))))
|
||||
#'consult-preview-at-point-mode)))))
|
||||
|
||||
;; wgrep
|
||||
(use-package wgrep)
|
||||
|
||||
;; 启用savehist,保存命令顺序
|
||||
(use-package savehist
|
||||
@@ -218,7 +174,7 @@ targets."
|
||||
(use-package undo-fu-session
|
||||
:init (undo-fu-session-global-mode))
|
||||
|
||||
;; vundop,撤回树
|
||||
;; vundo,撤回树
|
||||
(use-package vundo
|
||||
:init (setq undo-limit 800000
|
||||
undo-strong-limit 1200000
|
||||
@@ -231,7 +187,8 @@ targets."
|
||||
(use-package projectile
|
||||
:init (projectile-mode)
|
||||
:bind (:map projectile-mode-map
|
||||
("C-x p" . projectile-command-map))
|
||||
("C-x p" . projectile-command-map)
|
||||
("C-x p b" . consult-project-buffer))
|
||||
:config (setq projectile-enable-caching t))
|
||||
|
||||
(use-package ibuffer-projectile
|
||||
@@ -283,6 +240,9 @@ targets."
|
||||
(unless *is-windows*
|
||||
(use-package vterm))
|
||||
|
||||
;; eat
|
||||
(use-package eat)
|
||||
|
||||
;; general
|
||||
(use-package general)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user