From 8ec57ae890cb2907b28cd1ae9f204c5d217175e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=B3=E5=85=89=E5=B0=91=E5=B9=B4?= <849317537@qq.com> Date: Fri, 14 Jun 2024 09:32:24 +0800 Subject: [PATCH] day_8 --- .#init 2.el | 1 + .#init 3.el | 1 + .#init 4.el | 1 + .#init 5.el | 1 + .#init 6.el | 1 + .#init 7.el | 1 + init.el | 116 +++++++++++++++++++++++++++++++++++----------------- 7 files changed, 85 insertions(+), 37 deletions(-) create mode 120000 .#init 2.el create mode 120000 .#init 3.el create mode 120000 .#init 4.el create mode 120000 .#init 5.el create mode 120000 .#init 6.el create mode 120000 .#init 7.el diff --git a/.#init 2.el b/.#init 2.el new file mode 120000 index 0000000..0cb98cd --- /dev/null +++ b/.#init 2.el @@ -0,0 +1 @@ +yanguangshaonian@yangguangshaoniandeMacBook-Pro.local.85028 \ No newline at end of file diff --git a/.#init 3.el b/.#init 3.el new file mode 120000 index 0000000..0cb98cd --- /dev/null +++ b/.#init 3.el @@ -0,0 +1 @@ +yanguangshaonian@yangguangshaoniandeMacBook-Pro.local.85028 \ No newline at end of file diff --git a/.#init 4.el b/.#init 4.el new file mode 120000 index 0000000..0cb98cd --- /dev/null +++ b/.#init 4.el @@ -0,0 +1 @@ +yanguangshaonian@yangguangshaoniandeMacBook-Pro.local.85028 \ No newline at end of file diff --git a/.#init 5.el b/.#init 5.el new file mode 120000 index 0000000..0cb98cd --- /dev/null +++ b/.#init 5.el @@ -0,0 +1 @@ +yanguangshaonian@yangguangshaoniandeMacBook-Pro.local.85028 \ No newline at end of file diff --git a/.#init 6.el b/.#init 6.el new file mode 120000 index 0000000..e4b7110 --- /dev/null +++ b/.#init 6.el @@ -0,0 +1 @@ +yanguangshaonian@yangguangshaoniandeMacBook-Pro.local.86583 \ No newline at end of file diff --git a/.#init 7.el b/.#init 7.el new file mode 120000 index 0000000..18fecfd --- /dev/null +++ b/.#init 7.el @@ -0,0 +1 @@ +yanguangshaonian@yangguangshaoniandeMacBook-Pro.local.614 \ No newline at end of file diff --git a/init.el b/init.el index 192ef8f..5491e70 100644 --- a/init.el +++ b/init.el @@ -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补全(界面有点乱, 不用了) @@ -30,10 +32,7 @@ ;(recentf-mode 1) ;(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/")