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