Config: switch consult-notes to fork version, add delight to clean mode-line, tidy package configs
This commit is contained in:
@@ -28,8 +28,8 @@
|
|||||||
;; 从develop分支而不是main分支获取straight.el
|
;; 从develop分支而不是main分支获取straight.el
|
||||||
(setq straight-repository-branch t)
|
(setq straight-repository-branch t)
|
||||||
|
|
||||||
;; 安装use-package
|
;; 安装use-package,emacs29以上别装
|
||||||
(straight-use-package 'use-package)
|
;; (straight-use-package 'use-package)
|
||||||
|
|
||||||
;; 配置 use-package
|
;; 配置 use-package
|
||||||
(setq use-package-always-defer t
|
(setq use-package-always-defer t
|
||||||
@@ -38,8 +38,15 @@
|
|||||||
straight-use-package-version t
|
straight-use-package-version t
|
||||||
straight-use-package-by-default t)
|
straight-use-package-by-default t)
|
||||||
|
|
||||||
|
;; delight
|
||||||
|
(use-package delight
|
||||||
|
:config
|
||||||
|
(delight '((eldoc-mode nil eldoc)
|
||||||
|
(org-indent-mode nil org))))
|
||||||
|
|
||||||
;; 安装gcmh用于管理内存回收
|
;; 安装gcmh用于管理内存回收
|
||||||
(use-package gcmh
|
(use-package gcmh
|
||||||
|
:delight
|
||||||
:demand t
|
:demand t
|
||||||
:init
|
:init
|
||||||
(setq gcmh-idle-delay 'auto
|
(setq gcmh-idle-delay 'auto
|
||||||
|
|||||||
@@ -151,7 +151,6 @@
|
|||||||
"C-<tab>" 'org-cycle-parent-subtree
|
"C-<tab>" 'org-cycle-parent-subtree
|
||||||
"C-c i" 'consult-outline
|
"C-c i" 'consult-outline
|
||||||
"C-c t l" 'org-toggle-link-display
|
"C-c t l" 'org-toggle-link-display
|
||||||
"C-c C-k" 'kmacro-call-macroe
|
|
||||||
"M-{" 'org-previous-visible-heading
|
"M-{" 'org-previous-visible-heading
|
||||||
"M-}" 'org-next-visible-heading)
|
"M-}" 'org-next-visible-heading)
|
||||||
|
|
||||||
@@ -173,7 +172,7 @@
|
|||||||
"c" 'hydra-multiple-cursors/body
|
"c" 'hydra-multiple-cursors/body
|
||||||
"r" 'restart-emacs
|
"r" 'restart-emacs
|
||||||
"e" 'er/expand-region
|
"e" 'er/expand-region
|
||||||
"s" 'consult-focus-lines
|
"s" 'consult-line
|
||||||
"i" 'consult-imenu
|
"i" 'consult-imenu
|
||||||
"I" 'consult-imenu-multi
|
"I" 'consult-imenu-multi
|
||||||
"a" 'org-agenda
|
"a" 'org-agenda
|
||||||
@@ -181,8 +180,8 @@
|
|||||||
"k" 'comment-line
|
"k" 'comment-line
|
||||||
;; "v" 'vterm
|
;; "v" 'vterm
|
||||||
"E" 'eshell
|
"E" 'eshell
|
||||||
"C-k" 'kmacro-call-macro
|
"C-t" 'trashed
|
||||||
"C-t" 'trashed)
|
"C-s" 'consult-focus-lines)
|
||||||
|
|
||||||
;; global map
|
;; global map
|
||||||
(general-def
|
(general-def
|
||||||
@@ -221,10 +220,10 @@
|
|||||||
"M-p" 'backward-paragraph
|
"M-p" 'backward-paragraph
|
||||||
"M-n" 'forward-paragraph
|
"M-n" 'forward-paragraph
|
||||||
"<mouse-2>" 'xref-find-definitions-at-mouse
|
"<mouse-2>" 'xref-find-definitions-at-mouse
|
||||||
"C-s" 'consult-line
|
|
||||||
"C-M-;" 'avy-goto-char
|
"C-M-;" 'avy-goto-char
|
||||||
"C-M-'" 'avy-goto-word-1
|
"C-M-'" 'avy-goto-word-1
|
||||||
"M-g g" 'avy-goto-line
|
"M-g g" 'avy-goto-line
|
||||||
|
"M-g M-g" 'consult-goto-line
|
||||||
|
|
||||||
;; window
|
;; window
|
||||||
"M-<left>" 'shrink-window-horizontally
|
"M-<left>" 'shrink-window-horizontally
|
||||||
@@ -238,8 +237,7 @@
|
|||||||
|
|
||||||
;; other
|
;; other
|
||||||
"C-x r b" 'consult-bookmark
|
"C-x r b" 'consult-bookmark
|
||||||
"C-;" 'embark-act
|
"C-;" 'embark-act)
|
||||||
"<mouse-3>" 'global-tab-line-mode)
|
|
||||||
|
|
||||||
;; expand region
|
;; expand region
|
||||||
(setq expand-region-reset-fast-key "r")
|
(setq expand-region-reset-fast-key "r")
|
||||||
|
|||||||
@@ -51,14 +51,11 @@
|
|||||||
(cond
|
(cond
|
||||||
(*is-windows*
|
(*is-windows*
|
||||||
(setq org-agenda-files '("h:/emacs/hugo/this-is-my-blog/all-blog.org"
|
(setq org-agenda-files '("h:/emacs/hugo/this-is-my-blog/all-blog.org"
|
||||||
"h:/emacs/my-org-daily/"
|
"h:/emacs/my-org-daily/")))
|
||||||
"h:/emacs/my-org-note/")))
|
|
||||||
(*is-mac*
|
(*is-mac*
|
||||||
(setq org-agenda-files '("~/org/my-org-daily"
|
(setq org-agenda-files '("~/org/my-org-daily")))
|
||||||
"~/org/my-org-note/")))
|
|
||||||
(*is-linux*
|
(*is-linux*
|
||||||
(setq org-agenda-files '("~/org/my-org-daily/"
|
(setq org-agenda-files '("~/org/my-org-daily/"))))
|
||||||
"~/org/my-org-note/"))))
|
|
||||||
|
|
||||||
(setq org-agenda-span 'day)
|
(setq org-agenda-span 'day)
|
||||||
(setq org-default-priority ?C)
|
(setq org-default-priority ?C)
|
||||||
@@ -91,11 +88,16 @@
|
|||||||
|
|
||||||
;; consult-notes
|
;; consult-notes
|
||||||
(use-package consult-notes
|
(use-package consult-notes
|
||||||
|
:straight
|
||||||
|
'(consult-notes :fork (:host github :repo "Andsy10/consult-notes"))
|
||||||
:init
|
:init
|
||||||
(consult-notes-denote-mode)
|
(consult-notes-denote-mode)
|
||||||
:config
|
:config
|
||||||
(setq consult-notes-file-dir-sources '(("Org Notes" ?n "~/org/my-org-note/" :hidden t)
|
(setq consult-notes-file-dir-sources '(("Org Notes" ?n "~/org/my-org-note/" :hidden t)
|
||||||
("Org Journal" ?j "~/org/my-org-daily/" :hidden t))))
|
("Org Journal" ?j "~/org/my-org-daily/" :hidden t)))
|
||||||
|
(setq consult-notes-denote-display-keywords-indicator "_")
|
||||||
|
(setq consult-notes-denote-display-id-format 'date)
|
||||||
|
(setq consult-notes-denote-display-signature t))
|
||||||
|
|
||||||
;; org-download
|
;; org-download
|
||||||
(use-package org-download
|
(use-package org-download
|
||||||
|
|||||||
@@ -6,22 +6,20 @@
|
|||||||
|
|
||||||
(setopt use-package-enable-imenu-support t)
|
(setopt use-package-enable-imenu-support t)
|
||||||
|
|
||||||
;; 安装gcmh用于管理内存回收
|
|
||||||
(use-package gcmh
|
|
||||||
:demand t
|
|
||||||
:init
|
|
||||||
(setq gcmh-idle-delay 'auto
|
|
||||||
gcmh-auto-idle-delay-factor 10
|
|
||||||
gcmh-high-cons-threshold #x4000000)
|
|
||||||
:config
|
|
||||||
(gcmh-mode 1))
|
|
||||||
|
|
||||||
;; restart-emacs
|
;; restart-emacs
|
||||||
(use-package restart-emacs)
|
(use-package restart-emacs)
|
||||||
|
|
||||||
|
;; async
|
||||||
|
(use-package async
|
||||||
|
:init
|
||||||
|
(dired-async-mode)
|
||||||
|
(async-bytecomp-package-mode 1)
|
||||||
|
(setq async-bytecomp-allowed-packages '(all)))
|
||||||
|
|
||||||
;; 安装multiple-cursors
|
;; 安装multiple-cursors
|
||||||
(use-package multiple-cursors
|
(use-package multiple-cursors
|
||||||
:config (setq mc/insert-numbers-default 1))
|
:config
|
||||||
|
(setq mc/insert-numbers-default 1))
|
||||||
|
|
||||||
;; 安装crux,增强快捷键,快捷键配置在init-kbd.el中
|
;; 安装crux,增强快捷键,快捷键配置在init-kbd.el中
|
||||||
(use-package crux)
|
(use-package crux)
|
||||||
@@ -34,6 +32,7 @@
|
|||||||
|
|
||||||
;; 安装which-key,快捷键提示
|
;; 安装which-key,快捷键提示
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
|
:delight
|
||||||
:defer 0
|
:defer 0
|
||||||
:config
|
:config
|
||||||
(which-key-mode))
|
(which-key-mode))
|
||||||
@@ -43,20 +42,22 @@
|
|||||||
|
|
||||||
;; 安装vertico
|
;; 安装vertico
|
||||||
(use-package vertico
|
(use-package vertico
|
||||||
:init (vertico-mode))
|
:init
|
||||||
|
(vertico-mode))
|
||||||
|
|
||||||
;; 安装orderless,用于模糊搜索
|
;; 安装orderless,用于模糊搜索
|
||||||
(use-package orderless
|
(use-package orderless
|
||||||
:custom (completion-styles '(orderless basic)))
|
:custom
|
||||||
|
(completion-styles '(orderless basic)))
|
||||||
|
|
||||||
;; 安装marginalia,用于命令注释
|
;; 安装marginalia,用于命令注释
|
||||||
(use-package marginalia
|
(use-package marginalia
|
||||||
:init (marginalia-mode))
|
:init
|
||||||
|
(marginalia-mode))
|
||||||
|
|
||||||
;; 安装consult,增强搜索和其他菜单
|
;; 安装consult,增强搜索和其他菜单
|
||||||
(use-package consult
|
(use-package consult
|
||||||
:config
|
:config
|
||||||
|
|
||||||
;; everything
|
;; everything
|
||||||
(when *is-windows*
|
(when *is-windows*
|
||||||
(setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk))
|
(setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk))
|
||||||
@@ -75,7 +76,8 @@
|
|||||||
|
|
||||||
;; embark
|
;; embark
|
||||||
(use-package embark
|
(use-package embark
|
||||||
:config (setq prefix-help-command 'embark-prefix-help-command)
|
:config
|
||||||
|
(setq prefix-help-command 'embark-prefix-help-command)
|
||||||
:init
|
:init
|
||||||
(defun my/embark-preview ()
|
(defun my/embark-preview ()
|
||||||
"Previews candidate in vertico buffer, unless it's a consult command."
|
"Previews candidate in vertico buffer, unless it's a consult command."
|
||||||
@@ -141,9 +143,16 @@ targets."
|
|||||||
;; wgrep
|
;; wgrep
|
||||||
(use-package wgrep)
|
(use-package wgrep)
|
||||||
|
|
||||||
|
;; anzu
|
||||||
|
(use-package anzu
|
||||||
|
:delight
|
||||||
|
:init
|
||||||
|
(global-anzu-mode))
|
||||||
|
|
||||||
;; 启用savehist,保存命令顺序
|
;; 启用savehist,保存命令顺序
|
||||||
(use-package savehist
|
(use-package savehist
|
||||||
:init (setq enable-recursive-minibuffers t
|
:init
|
||||||
|
(setq enable-recursive-minibuffers t
|
||||||
history-length 50
|
history-length 50
|
||||||
savehist-additional-variables '(mark-ring
|
savehist-additional-variables '(mark-ring
|
||||||
global-mark-ring
|
global-mark-ring
|
||||||
@@ -155,17 +164,20 @@ targets."
|
|||||||
|
|
||||||
;; saveplace,保存光标位置
|
;; saveplace,保存光标位置
|
||||||
(use-package saveplace
|
(use-package saveplace
|
||||||
:init (save-place-mode))
|
:init
|
||||||
|
(save-place-mode))
|
||||||
|
|
||||||
;; undo增强
|
;; undo增强
|
||||||
(use-package undo-fu)
|
(use-package undo-fu)
|
||||||
|
|
||||||
(use-package undo-fu-session
|
(use-package undo-fu-session
|
||||||
:init (undo-fu-session-global-mode))
|
:init
|
||||||
|
(undo-fu-session-global-mode))
|
||||||
|
|
||||||
;; vundo,撤回树
|
;; vundo,撤回树
|
||||||
(use-package vundo
|
(use-package vundo
|
||||||
:init (setq undo-limit 800000
|
:init
|
||||||
|
(setq undo-limit 800000
|
||||||
undo-strong-limit 1200000
|
undo-strong-limit 1200000
|
||||||
undo-outer-limit 12000000))
|
undo-outer-limit 12000000))
|
||||||
|
|
||||||
@@ -174,11 +186,15 @@ targets."
|
|||||||
|
|
||||||
;; projectile
|
;; projectile
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:init (projectile-mode)
|
:delight
|
||||||
:bind (:map projectile-mode-map
|
: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))
|
("C-x p b" . consult-project-buffer))
|
||||||
:config (setq projectile-enable-caching t))
|
:config
|
||||||
|
(setq projectile-enable-caching t))
|
||||||
|
|
||||||
(use-package ibuffer-projectile
|
(use-package ibuffer-projectile
|
||||||
:init (add-hook 'ibuffer-hook
|
:init (add-hook 'ibuffer-hook
|
||||||
@@ -189,19 +205,27 @@ targets."
|
|||||||
|
|
||||||
;; avy中文支持
|
;; avy中文支持
|
||||||
(use-package ace-pinyin
|
(use-package ace-pinyin
|
||||||
:init (ace-pinyin-global-mode +1))
|
:delight
|
||||||
|
:init
|
||||||
|
(ace-pinyin-global-mode +1))
|
||||||
|
|
||||||
;; avy-zap
|
;; avy-zap
|
||||||
(use-package avy-zap
|
(use-package avy-zap
|
||||||
:bind (("M-z" . avy-zap-to-char-dwim)
|
:bind
|
||||||
|
(("M-z" . avy-zap-to-char-dwim)
|
||||||
("M-Z" . avy-zap-up-to-char-dwim)))
|
("M-Z" . avy-zap-up-to-char-dwim)))
|
||||||
|
|
||||||
;; jinx,拼写检查
|
;; jinx,拼写检查
|
||||||
(unless *is-windows*
|
(unless *is-windows*
|
||||||
(use-package jinx
|
(use-package jinx
|
||||||
:hook (org-mode-hook . jinx-mode)
|
:delight
|
||||||
:bind ([remap ispell-word] . jinx-correct)
|
(jinx-mode " Jinx" jinx)
|
||||||
:config (setq jinx-languages "en_US")
|
:hook
|
||||||
|
(org-mode-hook . jinx-mode)
|
||||||
|
:bind
|
||||||
|
([remap ispell-word] . jinx-correct)
|
||||||
|
:config
|
||||||
|
(setq jinx-languages "en_US")
|
||||||
(add-to-list 'jinx-exclude-regexps '(t "\\cc"))
|
(add-to-list 'jinx-exclude-regexps '(t "\\cc"))
|
||||||
(with-eval-after-load 'jinx
|
(with-eval-after-load 'jinx
|
||||||
(dolist (range '((#x4E00 . #x9FFF)
|
(dolist (range '((#x4E00 . #x9FFF)
|
||||||
@@ -219,7 +243,8 @@ targets."
|
|||||||
(use-package flycheck)
|
(use-package flycheck)
|
||||||
|
|
||||||
(use-package flycheck-guile
|
(use-package flycheck-guile
|
||||||
:hook (scheme-mode . (lambda ()
|
:hook
|
||||||
|
(scheme-mode . (lambda ()
|
||||||
(require 'flycheck-guile))))
|
(require 'flycheck-guile))))
|
||||||
|
|
||||||
;; consult-flycheck
|
;; consult-flycheck
|
||||||
@@ -231,7 +256,8 @@ targets."
|
|||||||
|
|
||||||
;; eat
|
;; eat
|
||||||
(use-package eat
|
(use-package eat
|
||||||
:straight (eat :type git
|
:straight
|
||||||
|
(eat :type git
|
||||||
:host codeberg
|
:host codeberg
|
||||||
:repo "akib/emacs-eat"
|
:repo "akib/emacs-eat"
|
||||||
:files ("*.el"
|
:files ("*.el"
|
||||||
@@ -242,16 +268,19 @@ targets."
|
|||||||
("terminfo/65" "terminfo/65/*")
|
("terminfo/65" "terminfo/65/*")
|
||||||
("integration" "integration/*")
|
("integration" "integration/*")
|
||||||
(:exclude ".dir-locals.el" "*-tests.el")))
|
(:exclude ".dir-locals.el" "*-tests.el")))
|
||||||
:hook ((eshell-load . eat-eshell-mode)
|
:hook
|
||||||
|
((eshell-load . eat-eshell-mode)
|
||||||
(eshell-load . eat-eshell-visual-command-mode))
|
(eshell-load . eat-eshell-visual-command-mode))
|
||||||
:config (setq eat-term-terminfo-directory eat--terminfo-path))
|
:config
|
||||||
|
(setq eat-term-terminfo-directory eat--terminfo-path))
|
||||||
|
|
||||||
;; general
|
;; general
|
||||||
(use-package general)
|
(use-package general)
|
||||||
|
|
||||||
;; hydra
|
;; hydra
|
||||||
(use-package hydra
|
(use-package hydra
|
||||||
:defines (consult-imenu-config)
|
:defines
|
||||||
|
(consult-imenu-config)
|
||||||
:init
|
:init
|
||||||
(with-eval-after-load 'consult-imenu
|
(with-eval-after-load 'consult-imenu
|
||||||
(setq consult-imenu-config
|
(setq consult-imenu-config
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
;; tree-sitter
|
;; tree-sitter
|
||||||
(use-package treesit-auto
|
(use-package treesit-auto
|
||||||
:demand t
|
|
||||||
:config
|
:config
|
||||||
(setq treesit-auto-install 'prompt)
|
(setq treesit-auto-install 'prompt)
|
||||||
(global-treesit-auto-mode)
|
(global-treesit-auto-mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user