95 lines
2.2 KiB
EmacsLisp
95 lines
2.2 KiB
EmacsLisp
;;; init-package.el
|
||
;;; -*- lexical-binding: t -*-
|
||
|
||
;; 安装gcmh用于管理内存回收
|
||
(use-package gcmh
|
||
:init
|
||
(setq gcmh-idle-delay 5 ; 空闲 5 秒后 GC
|
||
gcmh-high-cons-threshold (* 16 1024 1024)) ; 高阈值 16MB
|
||
:config
|
||
(gcmh-mode 1))
|
||
|
||
(use-package restart-emacs)
|
||
|
||
;; 安装multiple-cursors
|
||
(use-package multiple-cursors)
|
||
|
||
;; 安装crux,增强快捷键,快捷键配置在init-kbd.el中
|
||
(use-package crux)
|
||
|
||
;; 安装hungry-delete
|
||
(use-package hungry-delete)
|
||
|
||
;; 安装drag-stuff,拖动字符
|
||
(use-package drag-stuff)
|
||
|
||
;; 安装which-key,快捷键提示
|
||
(use-package which-key
|
||
:defer 0
|
||
:config
|
||
(which-key-mode))
|
||
|
||
;; 安装ace-windows,快速切换窗口
|
||
(use-package ace-window)
|
||
|
||
;; 安装vertico
|
||
(use-package vertico
|
||
:init (vertico-mode t))
|
||
|
||
;; 安装orderless,用于模糊搜索
|
||
(use-package orderless
|
||
:custom (completion-styles '(orderless basic)))
|
||
|
||
;; 安装marginalia,用于命令注释
|
||
(use-package marginalia
|
||
:init (marginalia-mode))
|
||
|
||
;; 安装consult,增强搜索和其他菜单
|
||
(use-package consult)
|
||
|
||
;; 安装embark,一个菜单,用用就明白了
|
||
(use-package embark
|
||
:config (setq prefix-help-command 'embark-prefix-help-command))
|
||
|
||
;; 安装embark-consult和wgrep
|
||
(use-package embark-consult)
|
||
(use-package wgrep)
|
||
|
||
(with-eval-after-load
|
||
'consult
|
||
'(with-eval-after-load
|
||
'embark
|
||
'(progn
|
||
(require 'embark-consult)
|
||
(add-hook
|
||
'embark-collect-mode-hook
|
||
#'consult-preview-at-point-mode))))
|
||
|
||
(define-key minibuffer-local-map (kbd "C-c C-e") 'embark-export)
|
||
|
||
(progn
|
||
(setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk))
|
||
(add-to-list 'process-coding-system-alist '("es" gbk . gbk)))
|
||
|
||
;; 启用savehist,保存命令顺序
|
||
(use-package savehist
|
||
:hook (after-init . savehist-mode)
|
||
:init (setq enable-recursive-minibuffers t
|
||
history-length 50
|
||
savehist-additional-variables '(mark-ring
|
||
global-mark-ring
|
||
search-ring
|
||
regexp-search-ring
|
||
extended-command-history)
|
||
savehist-autosave-interval 300)
|
||
)
|
||
|
||
;; saveplace,保存光标位置
|
||
(use-package saveplace
|
||
:hook (after-init . save-place-mode))
|
||
|
||
;; 安装ox-hugo
|
||
(use-package ox-hugo)
|
||
|
||
(provide 'init-package)
|