Config: start customize theme with autotheme, update init-kbd.el

This commit is contained in:
trogloxene
2026-03-31 12:35:55 +08:00
parent 59b98b00fa
commit f4a77ab8b9
3 changed files with 62 additions and 0 deletions

View File

@@ -143,6 +143,9 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
;; 关闭主题
(global-set-key (kbd "C-c u d") 'disable-theme)
(global-set-key (kbd "C-c u f") 'describe-face)
(global-set-key (kbd "C-c u c") 'my-color-picker)
(global-set-key (kbd "C-c u r") 'rainbow-mode)
;; 打开ibuffer
(global-set-key (kbd "C-x C-b") 'ibuffer-other-window)
@@ -278,6 +281,12 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(global-set-key (kbd "C-c f d") 'my-open-current-directory)
;; save-some-buffer时diff更改
(add-to-list 'save-some-buffers-action-alist
(list "d"
(lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer)))
"show diff between the buffer and its file"))
;; org-mode相关
;; cycle当前subtree
(defun org-cycle-current-subtree()

View File

@@ -16,6 +16,29 @@
(set-language-environment "UTF-8")
(prefer-coding-system 'utf-8)))
;; 安装autothemer
(use-package autothemer)
;; 预览所有可用emacs颜色
(defun my-color-picker ()
"Pick a color with preview."
(interactive)
(let* ((colors (defined-colors))
(choice (completing-read
"Color: "
(mapcar (lambda (c)
(propertize
(format "%-20s %s" c "████")
'face `(:foreground ,c)))
colors))))
(string-trim (car (split-string choice)))))
;; rainbow mode
(use-package rainbow-mode)
;; 自定义主题路径
(add-to-list 'custom-theme-load-path "c:/Users/gaozh/AppData/Roaming/.emacs.d/lisp/")
;; 安装solarized dark
(use-package solarized-theme)
(load-theme 'solarized-dark t)
@@ -23,6 +46,7 @@
;; 很多主题
(use-package doom-themes)
(use-package color-theme-modern)
(use-package naysayer-theme)
;; 信任所有主题
(setq custom-safe-themes t)

29
lisp/my-theme.el Normal file
View File

@@ -0,0 +1,29 @@
(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)