From be6c0eb5e1899ef3fad808f31ecdf73b79373ac7 Mon Sep 17 00:00:00 2001 From: User Date: Tue, 31 Mar 2026 17:09:59 +0800 Subject: [PATCH] Config: add custom base16 dark theme with solarized framework, replace my-theme, update keybindings --- lisp/init-kbd.el | 2 +- lisp/init-ui.el | 11 ++++++----- lisp/my-base16-dark-theme.el | 31 +++++++++++++++++++++++++++++++ lisp/my-base16-palette.el | 22 ++++++++++++++++++++++ lisp/my-theme.el | 29 ----------------------------- 5 files changed, 60 insertions(+), 35 deletions(-) create mode 100644 lisp/my-base16-dark-theme.el create mode 100644 lisp/my-base16-palette.el delete mode 100644 lisp/my-theme.el diff --git a/lisp/init-kbd.el b/lisp/init-kbd.el index 78ff6ac..6d38fa8 100644 --- a/lisp/init-kbd.el +++ b/lisp/init-kbd.el @@ -204,7 +204,7 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog (global-set-key (kbd "C-c f r") 'consult-recent-file) ;; 最近打开 (global-set-key (kbd "C-c f f") 'consult-fd) ;; 调用fd进行目录内搜索 (global-set-key (kbd "C-c f g") 'consult-ripgrep) ;; consult-ripgrep -(global-set-key (kbd "C-c y") 'consult-yank-from-kill-ring) ;; 从kill ring中粘贴 +(global-set-key (kbd "M-y") 'consult-yank-from-kill-ring) ;; 从kill ring中粘贴 (global-set-key (kbd "C-x r b") 'consult-bookmark) ;; 书签菜单,embark中有更多操作 (define-key minibuffer-local-map (kbd "C-c C-e") 'embark-export) ;; 把minibuffer结果在一个菜单中显示 (global-set-key (kbd "C-c f e") 'consult-flycheck) ;; flycheck菜单 diff --git a/lisp/init-ui.el b/lisp/init-ui.el index 74ccf95..423087c 100644 --- a/lisp/init-ui.el +++ b/lisp/init-ui.el @@ -37,19 +37,20 @@ (use-package rainbow-mode) ;; 自定义主题路径 -(add-to-list 'custom-theme-load-path "c:/Users/gaozh/AppData/Roaming/.emacs.d/lisp/") +(add-to-list 'custom-theme-load-path "~/.emacs.d/lisp/") + +;; 信任所有主题 +(setq custom-safe-themes t) ;; 安装solarized dark (use-package solarized-theme) -(load-theme 'solarized-dark t) +(load-theme 'my-base16-dark) ;; 很多主题 (use-package doom-themes) (use-package color-theme-modern) (use-package naysayer-theme) - -;; 信任所有主题 -(setq custom-safe-themes t) +(use-package base16-theme) ;; 安装smart-mode-line (use-package smart-mode-line diff --git a/lisp/my-base16-dark-theme.el b/lisp/my-base16-dark-theme.el new file mode 100644 index 0000000..e22d909 --- /dev/null +++ b/lisp/my-base16-dark-theme.el @@ -0,0 +1,31 @@ +;;; my-base16-dark-theme.el --- Base16 Dark Theme -*- lexical-binding: t -*- + +;;; Commentary: +;; A green base16 dark theme base on solarized-theme + +;;; Code: + +(require 'solarized) +(require 'my-base16-palette) +(eval-when-compile + (require 'solarized-palettes)) + +(deftheme my-base16-dark "A Base16 dark theme using Solarized framework.") + +(solarized-with-color-variables-with-palette + 'dark + 'my-base16-dark + my-base16-dark-core-palette + '((custom-theme-set-faces + theme-name + `(org-level-2 ((,class (:foreground ,blue :height 1.05)))) + `(org-level-3 ((,class (:foreground ,green)))) + `(org-level-6 ((,class (:foreground ,blue)))) + `(org-level-8 ((,class (:foreground ,green)))) + `(org-priority ((,class (:foreground ,blue :weight bold)))) + `(org-done ((,class (:foreground ,blue :weight bold)))) + `(org-headline-done ((,class (:foreground ,blue))))))) + +(provide-theme 'my-base16-dark) + +;;; my-base16-dark-theme.el ends here diff --git a/lisp/my-base16-palette.el b/lisp/my-base16-palette.el new file mode 100644 index 0000000..d9820eb --- /dev/null +++ b/lisp/my-base16-palette.el @@ -0,0 +1,22 @@ +;;; my-base16-palette.el --- Base16 color palette for solarized -*- lexical-binding: t -*- + +;;; Commentary: +;; Palette of my-base16-theme . + +;;; Code: + +(defvar my-base16-dark-core-palette + '("#062624" ; darkest-base: 最深背景 + "#E3FCFB" ; brightest-base: 最亮前景 + "#A87C04" ; yellow: 黄色 + "#C24713" ; orange: 橙色 + "#BF2926" ; red: 红色 + "#d33682" ; magenta: 品红 + "#6c71c4" ; violet: 紫罗兰 + "#2570CD" ; blue: 蓝色 + "#3A9C36" ; cyan: 青色 + "#01928D")) ; green: 绿色 + +(provide 'my-base16-palette) + +;;; my-base16-palette.el ends here diff --git a/lisp/my-theme.el b/lisp/my-theme.el deleted file mode 100644 index bd5a8ca..0000000 --- a/lisp/my-theme.el +++ /dev/null @@ -1,29 +0,0 @@ -(require 'autothemer) - -(autothemer-deftheme - hallo "A theme to set the mood for Halloween" - - ((((class color) (min-colors #xFFFFFF))) ;; We're only concerned with graphical Emacs - - ;; Define our color palette - (basic "#06261F") - ( "#93A3B1") - (hallo-orange "orange1") - (hallo-dk-orange "#eb6123") - (hallo-purple "MediumPurple2") - (hallo-dk-purple "MediumPurple4") - (hallo-green "LightGreen")) - - ;; Customize faces - ((default (:foreground hallo-white :background hallo-black)) - (cursor (:background hallo-dk-orange)) - (region (:background hallo-dk-purple)) - (mode-line (:background hallo-dk-purple)) - (font-lock-keyword-face (:foreground hallo-purple)) - (font-lock-constant-face (:foreground hallo-green)) - (font-lock-string-face (:foreground hallo-orange)) - (font-lock-builtin-face (:foreground hallo-green)) - - (org-level-1 (:foreground hallo-orange)))) - -(provide-theme 'hallo)