|
|
|
@ -22,6 +22,8 @@
|
|
|
|
|
(setq-default cursor-type '(bar . 4)) ; 设置光标样式
|
|
|
|
|
(setq make-backup-files nil) ; 不要设置~备份文件
|
|
|
|
|
(delete-selection-mode 1) ; 被选中的文字重新编辑允许直接覆盖
|
|
|
|
|
(global-auto-revert-mode 1) ; 外部如果更新了当前编辑的文本, em里面同步刷新
|
|
|
|
|
(fset 'yes-or-no-p 'y-or-n-p) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;(setq tab-always-indent 'complete) ; tab补全(界面有点乱, 不用了)
|
|
|
|
@ -31,9 +33,6 @@
|
|
|
|
|
;(setq recentf-max-menu-item 10) ; 保留历史位置的文件数目
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; 启动包管理器
|
|
|
|
|
(require 'package)
|
|
|
|
|
(setq package-archives '(("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
|
|
|
|
@ -43,40 +42,83 @@
|
|
|
|
|
(when (not package-archive-contents)
|
|
|
|
|
(package-refresh-contents))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(package-install 'company) ; 会在当前页显示一个buf进代码行提示
|
|
|
|
|
(global-company-mode 1)
|
|
|
|
|
(setq company-minimum-prefix-length 1)
|
|
|
|
|
(setq company-idle-delay 0)
|
|
|
|
|
|
|
|
|
|
(package-install 'keycast) ; 提示按下的按键和对应的函数
|
|
|
|
|
(keycast-mode-line-mode t)
|
|
|
|
|
|
|
|
|
|
(package-install 'vertico) ; 对C M 相关的命令搜索提示
|
|
|
|
|
(vertico-mode t)
|
|
|
|
|
|
|
|
|
|
(package-install 'orderless) ; 模糊搜搜提示
|
|
|
|
|
(setq completion-styles '(orderless))
|
|
|
|
|
|
|
|
|
|
(package-install 'marginalia) ; 直接显示粗略的帮助文档 用来配合vertico orderless
|
|
|
|
|
(marginalia-mode t)
|
|
|
|
|
|
|
|
|
|
(package-install 'embark-consult ) ; 增强帮助和搜索
|
|
|
|
|
(setq consult-async-min-input 2) ; 必须要输入两个中文/英文 字符才开始搜索
|
|
|
|
|
(global-set-key (kbd "C-;") 'embark-act)
|
|
|
|
|
(setq prefix-help-command 'embark-prefix-help-command)
|
|
|
|
|
|
|
|
|
|
(global-set-key (kbd "C-s") 'consult-line) ; 文本搜索
|
|
|
|
|
(global-set-key (kbd "M-s i") 'consult-imenu) ; 函数列表快速跳转
|
|
|
|
|
(global-set-key (kbd "C-x b") 'consult-buffer) ; 打开带有历史文件记录的buffer列表
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; 设置主题
|
|
|
|
|
(package-install 'catppuccin-theme)
|
|
|
|
|
(load-theme 'catppuccin :no-confirm)
|
|
|
|
|
(setq catppuccin-flavor 'latte)
|
|
|
|
|
(catppuccin-reload)
|
|
|
|
|
;; 启动use package
|
|
|
|
|
(unless (package-installed-p 'use-package)
|
|
|
|
|
(package-refresh-contents)
|
|
|
|
|
(package-install 'use-package))
|
|
|
|
|
|
|
|
|
|
;; 会在当前页显示一个buf进代码行提示
|
|
|
|
|
(use-package company
|
|
|
|
|
:ensure t
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(global-company-mode 1)
|
|
|
|
|
:config
|
|
|
|
|
(setq company-minimum-prefix-length 2)
|
|
|
|
|
(setq company-idle-delay 0.2)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; 提示按下的按键和对应的函数
|
|
|
|
|
(use-package keycast
|
|
|
|
|
:ensure t
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(keycast-mode-line-mode 1)
|
|
|
|
|
:config
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
;; 对C M 相关的命令搜索提示
|
|
|
|
|
(use-package vertico
|
|
|
|
|
:ensure t
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(vertico-mode t)
|
|
|
|
|
:config
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
;; 模糊搜搜提示
|
|
|
|
|
(use-package orderless
|
|
|
|
|
:ensure t
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(setq completion-styles '(orderless))
|
|
|
|
|
:config
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
;; 直接显示粗略的帮助文档 用来配合vertico/orderless
|
|
|
|
|
(use-package marginalia
|
|
|
|
|
:ensure t
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(marginalia-mode t)
|
|
|
|
|
:config
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
;; 增强帮助和搜索
|
|
|
|
|
(use-package embark-consult
|
|
|
|
|
:ensure t
|
|
|
|
|
:defer t
|
|
|
|
|
:bind((("C-;" . embark-act) ;; 绑定 C-; 到 embark-act
|
|
|
|
|
("C-s" . consult-line) ;; 将 C-s 绑定到 consult-line,用于文本搜索
|
|
|
|
|
("M-s i" . consult-imenu) ;; M-s i 跳转到 consult-imenu,快速访问函数列表
|
|
|
|
|
("C-x b" . consult-buffer) ;; C-x b 打开 consult-buffer,带历史记录的缓冲区列表
|
|
|
|
|
))
|
|
|
|
|
:init
|
|
|
|
|
(setq consult-async-min-input 2)
|
|
|
|
|
:config
|
|
|
|
|
(setq prefix-help-command 'embark-prefix-help-command)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
;; 设置主题
|
|
|
|
|
(use-package catppuccin-theme
|
|
|
|
|
:ensure t
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(setq catppuccin-flavor 'latte)
|
|
|
|
|
(load-theme 'catppuccin :no-confirm)
|
|
|
|
|
:config
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(setq a "~/.emacs.d/")
|
|
|
|
|