refactor(config): Clean up and reorganize Emacs configuration
Remove unused packages (EMMS, jinx, god-mode), simplify terminal setup with ido instead of vertico/orderless, and reorganize keybindings. Add new packages (debase, discomfort, git-timemachine, edit-indirect) and improve EXWM, dired, and theme configurations. Move restart-fcitx5 to kbd-func and update Linux PATH for Guix.
This commit is contained in:
@@ -17,6 +17,4 @@
|
|||||||
|
|
||||||
(setq frame-background-mode 'dark)
|
(setq frame-background-mode 'dark)
|
||||||
|
|
||||||
(setq package-enable-at-startup nil)
|
|
||||||
|
|
||||||
;;; early-init.el ends here
|
;;; early-init.el ends here
|
||||||
|
|||||||
1
init.el
1
init.el
@@ -19,7 +19,6 @@
|
|||||||
(require 'init-startup)
|
(require 'init-startup)
|
||||||
(require 'init-elpa)
|
(require 'init-elpa)
|
||||||
(require 'init-package)
|
(require 'init-package)
|
||||||
(require 'init-emms)
|
|
||||||
(require 'init-org)
|
(require 'init-org)
|
||||||
(require 'init-prog)
|
(require 'init-prog)
|
||||||
(require 'init-completion)
|
(require 'init-completion)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
;;; init-jinx.el --- Jinx configuration with consult-jinx -*- lexical-binding: t -*-
|
;;; consult-jinx.el --- Jinx configuration with consult-jinx -*- lexical-binding: t -*-
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;; Jinx spell-checker configuration with consult-jinx menu
|
;; Jinx spell-checker configuration with consult-jinx menu
|
||||||
@@ -76,6 +76,6 @@
|
|||||||
:lookup #'consult--lookup-candidate
|
:lookup #'consult--lookup-candidate
|
||||||
:state (consult--jump-state)))
|
:state (consult--jump-state)))
|
||||||
|
|
||||||
(provide 'init-jinx)
|
(provide 'consult-jinx)
|
||||||
|
|
||||||
;;; init-jinx.el ends here
|
;;; consult-jinx.el ends here
|
||||||
@@ -17,7 +17,8 @@
|
|||||||
dired-recursive-deletes 'always
|
dired-recursive-deletes 'always
|
||||||
dired-recursive-copies 'always
|
dired-recursive-copies 'always
|
||||||
dired-mouse-drag-files t
|
dired-mouse-drag-files t
|
||||||
mouse-drag-and-drop-region-cross-program t)
|
mouse-drag-and-drop-region-cross-program t
|
||||||
|
dired-compress-file-default-suffix ".zip")
|
||||||
(put 'dired-find-alternate-file 'disabled nil))
|
(put 'dired-find-alternate-file 'disabled nil))
|
||||||
|
|
||||||
;; dirvish
|
;; dirvish
|
||||||
|
|||||||
@@ -1,104 +0,0 @@
|
|||||||
;;; init-emms.el --- emms -*- lexical-binding: t -*-
|
|
||||||
|
|
||||||
;;; Commentary:
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(use-package emms
|
|
||||||
:init
|
|
||||||
;; 设置音乐文件默认目录
|
|
||||||
(when *is-windows*
|
|
||||||
(setq emms-source-file-default-directory "F:/luping26-1-11/"))
|
|
||||||
|
|
||||||
:config
|
|
||||||
;; --- 基础设置 ---
|
|
||||||
(require 'emms-setup)
|
|
||||||
(emms-all) ; 加载所有稳定功能
|
|
||||||
|
|
||||||
;; 使用简单模式的 mpv 播放器
|
|
||||||
;; 移除默认的 emms-player-mpv
|
|
||||||
(require 'emms-player-simple)
|
|
||||||
|
|
||||||
;; 定义简单的 mpv 播放器
|
|
||||||
(define-emms-simple-player mpv-simple '(file url streamlist playlist)
|
|
||||||
(concat "\\.\\("
|
|
||||||
(mapconcat 'identity
|
|
||||||
'("mp3" "mp4" "avi" "mkv" "flv" "mov" "wmv" "webm"
|
|
||||||
"ogg" "ogv" "oga" "ogx"
|
|
||||||
"flac" "wav" "aac" "m4a" "wma"
|
|
||||||
"mpg" "mpeg" "mpe" "mpv"
|
|
||||||
"3gp" "3g2"
|
|
||||||
"m3u" "pls")
|
|
||||||
"\\|")
|
|
||||||
"\\)\\'\\|http[s]?://")
|
|
||||||
"mpv"
|
|
||||||
"--force-window=immediate"
|
|
||||||
"--keep-open=yes"
|
|
||||||
"--fs=no"
|
|
||||||
"--quiet")
|
|
||||||
|
|
||||||
;; 设置播放器列表
|
|
||||||
(setq emms-player-list '(emms-player-mpv-simple
|
|
||||||
emms-player-vlc
|
|
||||||
emms-player-mplayer))
|
|
||||||
|
|
||||||
(setq emms-playlist-default-playlist-name "*EMMS Playlist*")
|
|
||||||
(setq emms-playlist-buffer-name "*EMMS Playlist*")
|
|
||||||
|
|
||||||
;; 使用更快的文件查找方法(windows上需要使用internal)
|
|
||||||
;; (setq emms-source-file-directory-tree-function 'emms-source-file-directory-tree-find)
|
|
||||||
(setq emms-source-file-directory-tree-function 'emms-source-file-directory-tree-internal)
|
|
||||||
|
|
||||||
;; 使用原生 Elisp 元数据读取器
|
|
||||||
(setq emms-info-functions '(emms-info-native))
|
|
||||||
|
|
||||||
;; 异步读取元数据
|
|
||||||
(setq emms-info-asynchronously t)
|
|
||||||
|
|
||||||
;; 使用更详细的曲目描述
|
|
||||||
(setq emms-track-description-function #'emms-info-track-description)
|
|
||||||
|
|
||||||
;; 模式行设置
|
|
||||||
(require 'emms-mode-line)
|
|
||||||
(emms-mode-line-mode 1)
|
|
||||||
(emms-mode-line-blank) ; 初始为空
|
|
||||||
|
|
||||||
;; 自定义模式行格式
|
|
||||||
(setq emms-mode-line-format " [%s] ")
|
|
||||||
(setq emms-mode-line-length-limit 60)
|
|
||||||
|
|
||||||
;; 播放时间显示
|
|
||||||
(require 'emms-playing-time)
|
|
||||||
(emms-playing-time-mode 1)
|
|
||||||
|
|
||||||
;; 添加(playlist中的)快捷键
|
|
||||||
(define-key emms-playlist-mode-map (kbd "SPC") 'emms-pause)
|
|
||||||
(define-key emms-playlist-mode-map (kbd "N") 'emms-next)
|
|
||||||
(define-key emms-playlist-mode-map (kbd "P") 'emms-previous)
|
|
||||||
(define-key emms-playlist-mode-map (kbd "R") 'emms-random)
|
|
||||||
(define-key emms-playlist-mode-map (kbd "/") 'emms-playlist-limit)
|
|
||||||
|
|
||||||
;; 启用播放列表排序
|
|
||||||
(require 'emms-playlist-sort)
|
|
||||||
(define-key emms-playlist-mode-map (kbd "S s") 'emms-playlist-sort-map)
|
|
||||||
|
|
||||||
;; 启动后自动恢复播放列表
|
|
||||||
;; (add-hook 'after-init-hook 'emms-history-load)
|
|
||||||
|
|
||||||
;; 显示加载完成消息
|
|
||||||
(message "EMMS loaded")
|
|
||||||
|
|
||||||
;; 关闭自动连播
|
|
||||||
(add-hook 'emms-playlist-mode-hook
|
|
||||||
(lambda ()
|
|
||||||
(setq emms-single-track t))))
|
|
||||||
|
|
||||||
(defun my-emms-play-directory (dir)
|
|
||||||
"Play all files in directory.."
|
|
||||||
(interactive "Dchoose a directory: ")
|
|
||||||
(emms-play-directory-tree dir)
|
|
||||||
(message "playing: %s" dir))
|
|
||||||
|
|
||||||
(provide 'init-emms)
|
|
||||||
|
|
||||||
;;; init-emms.el ends here
|
|
||||||
@@ -15,15 +15,6 @@
|
|||||||
(let ((display-buffer-alist
|
(let ((display-buffer-alist
|
||||||
'((".*" . (display-buffer-no-window . nil)))))
|
'((".*" . (display-buffer-no-window . nil)))))
|
||||||
(async-shell-command command))))
|
(async-shell-command command))))
|
||||||
|
|
||||||
(defun restart-fcitx5 ()
|
|
||||||
"Kill and restart fcitx5, to fix random issues in exwm."
|
|
||||||
(interactive)
|
|
||||||
(if (zerop (shell-command "pgrep fcitx5"))
|
|
||||||
(progn
|
|
||||||
(eshell-command "pkill fcitx5")
|
|
||||||
(eshell-command "fcitx5 -d"))
|
|
||||||
(eshell-command "fcitx5 -d")))
|
|
||||||
|
|
||||||
(defun my--exwm-switch-to-workspace (delta)
|
(defun my--exwm-switch-to-workspace (delta)
|
||||||
(let ((target
|
(let ((target
|
||||||
@@ -113,7 +104,6 @@
|
|||||||
|
|
||||||
(defun my/exwm-update-class ()
|
(defun my/exwm-update-class ()
|
||||||
(exwm-workspace-rename-buffer exwm-class-name))
|
(exwm-workspace-rename-buffer exwm-class-name))
|
||||||
|
|
||||||
(add-hook 'exwm-update-class-hook #'my/exwm-update-class)
|
(add-hook 'exwm-update-class-hook #'my/exwm-update-class)
|
||||||
|
|
||||||
(require 'exwm-xim)
|
(require 'exwm-xim)
|
||||||
@@ -121,15 +111,14 @@
|
|||||||
(exwm-wm-mode))
|
(exwm-wm-mode))
|
||||||
|
|
||||||
(use-package desktop-environment
|
(use-package desktop-environment
|
||||||
|
:after exwm
|
||||||
:init
|
:init
|
||||||
(desktop-environment-mode)
|
(desktop-environment-mode)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(advice-add 'desktop-environment-screenshot :after
|
(advice-add 'desktop-environment-screenshot :after
|
||||||
(lambda (&rest _) (message "Saved fullscreen screenshot.")))
|
(lambda (&rest _) (message "Saved fullscreen screenshot.")))
|
||||||
(advice-add 'desktop-environment-screenshot-part :after
|
(advice-add 'desktop-environment-screenshot-part :after
|
||||||
(lambda (&rest _) (message "Saved partial screenshot.")))
|
(lambda (&rest _) (message "Saved partial screenshot.")))
|
||||||
|
|
||||||
:custom
|
:custom
|
||||||
(desktop-environment-screenshot-command
|
(desktop-environment-screenshot-command
|
||||||
"import -window root ~/Pictures/screenshot-$(date +%Y%m%d-%H%M%S).png")
|
"import -window root ~/Pictures/screenshot-$(date +%Y%m%d-%H%M%S).png")
|
||||||
@@ -152,7 +141,20 @@
|
|||||||
(with-eval-after-load 'consult
|
(with-eval-after-load 'consult
|
||||||
(unless (memq 'xdg-launcher-consult-source consult-buffer-sources)
|
(unless (memq 'xdg-launcher-consult-source consult-buffer-sources)
|
||||||
(setq consult-buffer-sources
|
(setq consult-buffer-sources
|
||||||
(append consult-buffer-sources '(xdg-launcher-consult-source)))))))
|
(append consult-buffer-sources '(xdg-launcher-consult-source))))))
|
||||||
|
|
||||||
|
(use-package debase
|
||||||
|
:straight
|
||||||
|
(debase :type git
|
||||||
|
:host codeberg
|
||||||
|
:repo "emacs-weirdware/debase"))
|
||||||
|
|
||||||
|
(use-package discomfort
|
||||||
|
:commands discomfort
|
||||||
|
:straight
|
||||||
|
(discomfort :type git
|
||||||
|
:host codeberg
|
||||||
|
:repo "emacs-weirdware/discomfort")))
|
||||||
|
|
||||||
(provide 'init-exwm)
|
(provide 'init-exwm)
|
||||||
|
|
||||||
|
|||||||
@@ -108,11 +108,6 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
|||||||
(interactive)
|
(interactive)
|
||||||
(align-regexp (region-beginning) (region-end) "\\(\\s-*\\)::" 1 1 nil))
|
(align-regexp (region-beginning) (region-end) "\\(\\s-*\\)::" 1 1 nil))
|
||||||
|
|
||||||
(defun switch-to-emms-playlist()
|
|
||||||
"Switch to emms playlist."
|
|
||||||
(interactive)
|
|
||||||
(switch-to-buffer "*EMMS Playlist*"))
|
|
||||||
|
|
||||||
(defun my/dired-next-line()
|
(defun my/dired-next-line()
|
||||||
"Move to forward line in dired buffer"
|
"Move to forward line in dired buffer"
|
||||||
(interactive)
|
(interactive)
|
||||||
@@ -188,7 +183,16 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
|||||||
(unless (zerop (shell-command "pgrep -x mihomo"))
|
(unless (zerop (shell-command "pgrep -x mihomo"))
|
||||||
(start-process-shell-command "mihomo" nil "mihomo -d ~/.config/mihomo/"))
|
(start-process-shell-command "mihomo" nil "mihomo -d ~/.config/mihomo/"))
|
||||||
(start-process-shell-command "xrandr-refresh" nil "xrandr --output DP-4 --mode 2560x1440 --rate 165.00")
|
(start-process-shell-command "xrandr-refresh" nil "xrandr --output DP-4 --mode 2560x1440 --rate 165.00")
|
||||||
(start-process-shell-command "xinput" nil "xinput set-prop 12 'libinput Accel Speed' -0.45")))
|
(start-process-shell-command "xinput" nil "xinput set-prop 12 'libinput Accel Speed' -0.45"))
|
||||||
|
|
||||||
|
(defun restart-fcitx5 ()
|
||||||
|
"Kill and restart fcitx5, to fix random issues in exwm."
|
||||||
|
(interactive)
|
||||||
|
(if (zerop (shell-command "pgrep fcitx5"))
|
||||||
|
(progn
|
||||||
|
(eshell-command "pkill fcitx5")
|
||||||
|
(eshell-command "fcitx5 -d"))
|
||||||
|
(eshell-command "fcitx5 -d"))))
|
||||||
|
|
||||||
(provide 'init-kbd-func)
|
(provide 'init-kbd-func)
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
:prefix "C-c f"
|
:prefix "C-c f"
|
||||||
"r" 'consult-recent-file
|
"r" 'consult-recent-file
|
||||||
"f" 'consult-fd
|
"f" 'consult-fd
|
||||||
"g" 'consult-ripgrep-project
|
"g" 'consult-ripgrep
|
||||||
"e" 'consult-flycheck
|
"e" 'consult-flycheck
|
||||||
"l" 'consult-locate
|
"l" 'consult-locate
|
||||||
"h" 'consult-fd-home
|
"h" 'consult-fd-home
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
;; t for modes toggle
|
;; t for modes toggle
|
||||||
(general-def
|
(general-def
|
||||||
:prefix "C-c t"
|
:prefix "C-c t"
|
||||||
"f" 'global-flycheck-mode
|
"f" 'flycheck-mode
|
||||||
"j" 'my/jinx-smart-toggle
|
"j" 'my/jinx-smart-toggle
|
||||||
"g" 'gptel-mode)
|
"g" 'gptel-mode)
|
||||||
|
|
||||||
@@ -102,17 +102,22 @@
|
|||||||
"n" 'emms-next
|
"n" 'emms-next
|
||||||
"p" 'emms-previous
|
"p" 'emms-previous
|
||||||
"b" 'emms-browser
|
"b" 'emms-browser
|
||||||
|
"s" 'emms-start
|
||||||
"q" 'emms-stop
|
"q" 'emms-stop
|
||||||
|
"P" 'emms-pause
|
||||||
"S" 'emms-toggle-single-track
|
"S" 'emms-toggle-single-track
|
||||||
"l" 'switch-to-emms-playlist
|
"l" 'emms-playlist-mode-switch-buffer
|
||||||
"d" 'my-emms-play-directory)
|
"d" 'emms-play-directory)
|
||||||
|
|
||||||
;; d for dired
|
;; d for dired
|
||||||
(general-def
|
(general-def
|
||||||
:prefix "C-c d"
|
:prefix "C-c d"
|
||||||
"a" 'dirvish-quick-access
|
"a" 'dirvish-quick-access
|
||||||
"s" 'dirvish-side
|
"s" 'dirvish-side
|
||||||
"h" 'dirvish-history-menu)
|
"h" 'dirvish-history-menu
|
||||||
|
"f" 'dirvish-fd
|
||||||
|
"F" 'dirvish-fd-switches-menu
|
||||||
|
"t" 'trashed)
|
||||||
|
|
||||||
;; scratch buffer
|
;; scratch buffer
|
||||||
(if *is-mac*
|
(if *is-mac*
|
||||||
@@ -186,6 +191,11 @@
|
|||||||
(general-def minibuffer-local-map
|
(general-def minibuffer-local-map
|
||||||
"C-c C-e" 'embark-export)
|
"C-c C-e" 'embark-export)
|
||||||
|
|
||||||
|
;; completion
|
||||||
|
(general-def completion-list-mode-map
|
||||||
|
"M-n" 'minibuffer-next-completion
|
||||||
|
"M-p" 'minibuffer-previous-completion)
|
||||||
|
|
||||||
;; markdown
|
;; markdown
|
||||||
(general-def markdown-mode-map
|
(general-def markdown-mode-map
|
||||||
"M-p" nil
|
"M-p" nil
|
||||||
@@ -198,7 +208,7 @@
|
|||||||
"C-c t l" 'org-toggle-link-display
|
"C-c t l" 'org-toggle-link-display
|
||||||
"M-{" 'org-previous-visible-heading
|
"M-{" 'org-previous-visible-heading
|
||||||
"M-}" 'org-next-visible-heading
|
"M-}" 'org-next-visible-heading
|
||||||
"C-," 'duplicate-and-move-to-next-line
|
"C-," 'crux-duplicate-current-line-or-region
|
||||||
"C-c o l" 'denote-link
|
"C-c o l" 'denote-link
|
||||||
"C-c o L" 'denote-org-link-to-heading
|
"C-c o L" 'denote-org-link-to-heading
|
||||||
"C-c o b" 'denote-backlinks
|
"C-c o b" 'denote-backlinks
|
||||||
@@ -227,7 +237,8 @@
|
|||||||
;; emms
|
;; emms
|
||||||
(general-def emms-playlist-mode-map
|
(general-def emms-playlist-mode-map
|
||||||
"<prior>" 'emms-previous
|
"<prior>" 'emms-previous
|
||||||
"<next>" 'emms-next)
|
"<next>" 'emms-next
|
||||||
|
"C-c C-s" 'emms-history-save)
|
||||||
|
|
||||||
;; perspective
|
;; perspective
|
||||||
(general-def persp-mode-map
|
(general-def persp-mode-map
|
||||||
@@ -235,9 +246,14 @@
|
|||||||
"C-c p d" 'persp-kill
|
"C-c p d" 'persp-kill
|
||||||
"C-x M-b" 'persp-ibuffer)
|
"C-x M-b" 'persp-ibuffer)
|
||||||
|
|
||||||
;; visual-line
|
;; info
|
||||||
(general-def visual-line-mode-map
|
(general-def Info-mode-map
|
||||||
"C-k" 'kill-visual-line)
|
"M-n" 'forward-paragraph)
|
||||||
|
|
||||||
|
;; discomfort
|
||||||
|
(general-def discomfort-mode-map
|
||||||
|
"p" 'previous-line
|
||||||
|
"P" 'discomfort-poweroff)
|
||||||
|
|
||||||
;; global map with C-c prefix
|
;; global map with C-c prefix
|
||||||
(general-def
|
(general-def
|
||||||
@@ -253,7 +269,6 @@
|
|||||||
"k" 'comment-line
|
"k" 'comment-line
|
||||||
"K" 'comment-kill
|
"K" 'comment-kill
|
||||||
"E" 'eshell
|
"E" 'eshell
|
||||||
"C-t" 'trashed
|
|
||||||
"C-s" 'consult-focus-lines)
|
"C-s" 'consult-focus-lines)
|
||||||
|
|
||||||
;; global map
|
;; global map
|
||||||
@@ -323,6 +338,8 @@
|
|||||||
"C-x r b" 'consult-bookmark
|
"C-x r b" 'consult-bookmark
|
||||||
"C-x p b" 'consult-project-buffer
|
"C-x p b" 'consult-project-buffer
|
||||||
"C-x p E" 'eat-project
|
"C-x p E" 'eat-project
|
||||||
|
"C-x p r" 'consult-ripgrep-project
|
||||||
|
"C-x p R" 'project-query-replace-regexp
|
||||||
"C-;" 'embark-act)
|
"C-;" 'embark-act)
|
||||||
|
|
||||||
(when *is-android*
|
(when *is-android*
|
||||||
|
|||||||
@@ -53,6 +53,8 @@
|
|||||||
|
|
||||||
;; org-babel scheme
|
;; org-babel scheme
|
||||||
(use-package ob-scheme
|
(use-package ob-scheme
|
||||||
|
:demand t
|
||||||
|
:after org
|
||||||
:straight nil
|
:straight nil
|
||||||
:config
|
:config
|
||||||
(add-to-list 'org-babel-load-languages '(scheme . t))
|
(add-to-list 'org-babel-load-languages '(scheme . t))
|
||||||
|
|||||||
@@ -224,20 +224,32 @@ targets."
|
|||||||
(mode . sh-mode)
|
(mode . sh-mode)
|
||||||
(mode . lua-mode)
|
(mode . lua-mode)
|
||||||
(mode . bat-mode)))
|
(mode . bat-mode)))
|
||||||
|
("Config" (or
|
||||||
|
(mode . conf-mode)
|
||||||
|
(mode . conf-desktop-mode)
|
||||||
|
(mode . conf-toml-mode)))
|
||||||
("Elisp" (mode . emacs-lisp-mode))
|
("Elisp" (mode . emacs-lisp-mode))
|
||||||
("Scheme" (or
|
("Scheme" (or
|
||||||
(mode . scheme-mode)
|
(mode . scheme-mode)))
|
||||||
(name . "^*Geiser")))
|
("Geiser" (or
|
||||||
|
(name . "^Geiser")
|
||||||
|
(mode . geiser-repl-mode)
|
||||||
|
(mode . geiser-debug-mode)
|
||||||
|
(mode . geiser-messages-mode)
|
||||||
|
(mode . geiser-debug-mode)
|
||||||
|
(mode . geiser-doc-mode)
|
||||||
|
(mode . geiser-autodoc-mode)))
|
||||||
("gptel" (or
|
("gptel" (or
|
||||||
(name . "^\\*gptel")))
|
(name . "^\\*gptel")))
|
||||||
("Common-lisp" (or
|
("Common-lisp" (or
|
||||||
(mode . common-lisp-mode)
|
(mode . common-lisp-mode)
|
||||||
(mode . lisp-mode)
|
(mode . lisp-mode)))
|
||||||
(mode . sly-mrepl-mode)))
|
|
||||||
("Sly" (or
|
("Sly" (or
|
||||||
(mode . lisp-data-mode)
|
(mode . lisp-data-mode)
|
||||||
(mode . sly-db-mode)
|
(mode . sly-db-mode)
|
||||||
(name . "\\*sly-compilation\\*")))
|
(mode . sly-mrepl-mode)
|
||||||
|
(name . "\\*sly-compilation\\*")
|
||||||
|
(name . "^\\*img-cache\\*")))
|
||||||
("Text" (or
|
("Text" (or
|
||||||
(mode . org-mode)
|
(mode . org-mode)
|
||||||
(mode . markdown-mode)
|
(mode . markdown-mode)
|
||||||
@@ -245,10 +257,13 @@ targets."
|
|||||||
("Emacs" (or
|
("Emacs" (or
|
||||||
(name . "^\\*Help\\*$")
|
(name . "^\\*Help\\*$")
|
||||||
(name . "^\\*Custom.*")
|
(name . "^\\*Custom.*")
|
||||||
(name . "^\\*info\\*$")
|
(name . "^\\*EMMS Playlist\\*")
|
||||||
(name . "^\\*Messages\\*$")
|
(name . "^\\*Messages\\*$")
|
||||||
(name . "*Chinese-word-segmentation*")
|
(name . "*Chinese-word-segmentation*")
|
||||||
(name . "^*Buffer List*")))
|
(name . "^*Buffer List*")
|
||||||
|
(name . "\\*discomfort\\*")))
|
||||||
|
("Info" (or
|
||||||
|
(name . "^\\*info")))
|
||||||
("Magit" (or
|
("Magit" (or
|
||||||
(mode . magit-blame-mode)
|
(mode . magit-blame-mode)
|
||||||
(mode . magit-cherry-mode)
|
(mode . magit-cherry-mode)
|
||||||
@@ -304,8 +319,12 @@ targets."
|
|||||||
(let ((start (car range))
|
(let ((start (car range))
|
||||||
(end (cdr range)))
|
(end (cdr range)))
|
||||||
(dotimes (i (- end start))
|
(dotimes (i (- end start))
|
||||||
(modify-syntax-entry (+ start i) "_" jinx--syntax-table)))))
|
(modify-syntax-entry (+ start i) "_" jinx--syntax-table))))))
|
||||||
(require 'init-jinx)))
|
|
||||||
|
(use-package consult-jinx
|
||||||
|
:after jinx
|
||||||
|
:demand t
|
||||||
|
:straight nil))
|
||||||
|
|
||||||
;; eat,终端
|
;; eat,终端
|
||||||
(use-package eat
|
(use-package eat
|
||||||
@@ -398,12 +417,25 @@ targets."
|
|||||||
:config
|
:config
|
||||||
(setq magit-bind-magit-project-status nil))
|
(setq magit-bind-magit-project-status nil))
|
||||||
|
|
||||||
|
;; git-timemachine
|
||||||
|
(use-package git-timemachine)
|
||||||
|
|
||||||
;; ediff
|
;; ediff
|
||||||
(use-package ediff
|
(use-package ediff
|
||||||
:config
|
:config
|
||||||
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
|
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
|
||||||
(setq ediff-split-window-function 'split-window-horizontally))
|
(setq ediff-split-window-function 'split-window-horizontally))
|
||||||
|
|
||||||
|
;; emms
|
||||||
|
(use-package emms
|
||||||
|
:commands
|
||||||
|
(emms-playlist-mode-switch-buffer)
|
||||||
|
:config
|
||||||
|
(emms-all)
|
||||||
|
(setq emms-player-list '(emms-player-mpv)
|
||||||
|
emms-info-functions '(emms-info-native))
|
||||||
|
(emms-history-load))
|
||||||
|
|
||||||
(provide 'init-package)
|
(provide 'init-package)
|
||||||
|
|
||||||
;;; init-package.el ends here
|
;;; init-package.el ends here
|
||||||
|
|||||||
@@ -49,6 +49,8 @@
|
|||||||
(setq markdown-command "multimarkdown"
|
(setq markdown-command "multimarkdown"
|
||||||
markdown-fontify-code-blocks-natively t))
|
markdown-fontify-code-blocks-natively t))
|
||||||
|
|
||||||
|
(use-package edit-indirect)
|
||||||
|
|
||||||
;; html
|
;; html
|
||||||
(use-package htmlize)
|
(use-package htmlize)
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,10 @@
|
|||||||
(setenv "PATH" (concat (expand-file-name "H/appppppppppp/scoop/apps/") ";" (getenv "PATH"))))
|
(setenv "PATH" (concat (expand-file-name "H/appppppppppp/scoop/apps/") ";" (getenv "PATH"))))
|
||||||
(*is-mac*
|
(*is-mac*
|
||||||
(add-to-list 'exec-path (expand-file-name "/opt/homebrew/bin/"))
|
(add-to-list 'exec-path (expand-file-name "/opt/homebrew/bin/"))
|
||||||
(setenv "PATH" (concat (expand-file-name "/opt/homebrew/bin/") ":" (getenv "PATH")))))
|
(setenv "PATH" (concat (expand-file-name "/opt/homebrew/bin/") ":" (getenv "PATH"))))
|
||||||
|
(*is-linux*
|
||||||
|
(add-to-list 'exec-path (expand-file-name "~/.guix-home/profile/bin/"))
|
||||||
|
(setenv "PATH" (concat (expand-file-name "~/.guix-home/profile/bin/") ":" (getenv "PATH")))))
|
||||||
|
|
||||||
;; 当文件被外部修改时自动刷新
|
;; 当文件被外部修改时自动刷新
|
||||||
(global-auto-revert-mode 1)
|
(global-auto-revert-mode 1)
|
||||||
|
|||||||
@@ -9,31 +9,11 @@
|
|||||||
(interactive)
|
(interactive)
|
||||||
(find-file "~/.emacs.d/init.el"))
|
(find-file "~/.emacs.d/init.el"))
|
||||||
|
|
||||||
(defun duplicate-and-move-to-next-line()
|
|
||||||
"Duplicate current line and move to next line."
|
|
||||||
(interactive)
|
|
||||||
(progn
|
|
||||||
(duplicate-line)
|
|
||||||
(next-line)))
|
|
||||||
|
|
||||||
;; scratch buffer
|
;; scratch buffer
|
||||||
(if *is-mac*
|
(if *is-mac*
|
||||||
(general-def "C-c <f12>" 'scratch-buffer)
|
(general-def "C-c <f12>" 'scratch-buffer)
|
||||||
(general-def "C-c <delete>" 'scratch-buffer))
|
(general-def "C-c <delete>" 'scratch-buffer))
|
||||||
|
|
||||||
;; god-mode
|
|
||||||
(general-def god-local-mode-map
|
|
||||||
"i" 'god-mode-all
|
|
||||||
"<escape>" 'god-mode-all
|
|
||||||
"[" 'backward-paragraph
|
|
||||||
"]" 'forward-paragraph
|
|
||||||
"." 'repeat
|
|
||||||
"y" 'yank
|
|
||||||
"C-c C-<f12>" 'scratch-buffer
|
|
||||||
"z" 'avy-goto-char
|
|
||||||
"'" 'avy-goto-word-1
|
|
||||||
"<f2>" 'open-init-file)
|
|
||||||
|
|
||||||
;; global map with C-c prefix
|
;; global map with C-c prefix
|
||||||
(general-def
|
(general-def
|
||||||
:prefix "C-c"
|
:prefix "C-c"
|
||||||
@@ -45,23 +25,18 @@
|
|||||||
;; global map
|
;; global map
|
||||||
(general-def
|
(general-def
|
||||||
|
|
||||||
;; god-mode
|
|
||||||
"<escape>" 'god-mode-all
|
|
||||||
"M-i" 'god-mode-all
|
|
||||||
|
|
||||||
;; buffer, file, and window
|
;; buffer, file, and window
|
||||||
"<f2>" 'open-init-file
|
"<f2>" 'open-init-file
|
||||||
"M-[" 'previous-buffer
|
"M-[" 'previous-buffer
|
||||||
"M-]" 'next-buffer
|
"M-]" 'next-buffer
|
||||||
"C-x C-b" 'ibuffer-other-window
|
"C-x C-b" 'ibuffer-other-window
|
||||||
"C-x K" 'crux-kill-other-buffers
|
"C-x K" 'crux-kill-other-buffers
|
||||||
"C-x C-b" 'ibuffer-other-window
|
|
||||||
|
|
||||||
;; edit
|
;; edit
|
||||||
"M-c" 'capitalize-dwim
|
"M-c" 'capitalize-dwim
|
||||||
"M-u" 'upcase-dwim
|
"M-u" 'upcase-dwim
|
||||||
"M-l" 'downcase-dwim
|
"M-l" 'downcase-dwim
|
||||||
"C-," 'duplicate-and-move-to-next-line
|
"C-," 'crux-duplicate-current-line-or-region
|
||||||
"C-k" 'crux-smart-kill-line
|
"C-k" 'crux-smart-kill-line
|
||||||
"C-<backspace>" 'crux-kill-line-backwards
|
"C-<backspace>" 'crux-kill-line-backwards
|
||||||
"C-a" 'crux-move-beginning-of-line
|
"C-a" 'crux-move-beginning-of-line
|
||||||
@@ -70,10 +45,12 @@
|
|||||||
"C-c C-DEL" 'hungry-delete-forward
|
"C-c C-DEL" 'hungry-delete-forward
|
||||||
"M-P" 'drag-stuff-up
|
"M-P" 'drag-stuff-up
|
||||||
"M-N" 'drag-stuff-down
|
"M-N" 'drag-stuff-down
|
||||||
|
"C-M-@" 'er/mark-symbol
|
||||||
|
"M-@" 'er/mark-word
|
||||||
|
|
||||||
;; undo
|
;; undo
|
||||||
"C-/" 'undo-fu-only-undo
|
"C-/" 'undo
|
||||||
"C-?" 'undo-fu-only-redo
|
"C-M-_" 'undo-redo
|
||||||
|
|
||||||
;; navigate
|
;; navigate
|
||||||
"M-p" 'backward-paragraph
|
"M-p" 'backward-paragraph
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
;; 安装crux,增强快捷键,快捷键配置在init-kbd.el中
|
;; 安装crux
|
||||||
(use-package crux)
|
(use-package crux)
|
||||||
|
|
||||||
;; 安装hungry-delete
|
;; 安装hungry-delete
|
||||||
@@ -13,8 +13,12 @@
|
|||||||
;; 安装drag-stuff,拖动字符
|
;; 安装drag-stuff,拖动字符
|
||||||
(use-package drag-stuff)
|
(use-package drag-stuff)
|
||||||
|
|
||||||
;; expand region
|
;; expand-region,快速展开选中
|
||||||
(use-package expand-region)
|
(use-package expand-region
|
||||||
|
:commands
|
||||||
|
(er/mark-symbol er/mark-word)
|
||||||
|
:config
|
||||||
|
(setq expand-region-smart-cursor t))
|
||||||
|
|
||||||
;; 启用savehist,保存命令顺序
|
;; 启用savehist,保存命令顺序
|
||||||
(use-package savehist
|
(use-package savehist
|
||||||
@@ -32,49 +36,17 @@
|
|||||||
(use-package saveplace
|
(use-package saveplace
|
||||||
:init (save-place-mode))
|
:init (save-place-mode))
|
||||||
|
|
||||||
;; undo增强
|
;; ido,补全
|
||||||
(use-package undo-fu)
|
(use-package ido
|
||||||
|
:init
|
||||||
;; vertico
|
(ido-mode)
|
||||||
(use-package vertico
|
(ido-everywhere)
|
||||||
:init (vertico-mode t))
|
|
||||||
|
|
||||||
;; 安装orderless,用于模糊搜索
|
|
||||||
(use-package orderless
|
|
||||||
:custom (completion-styles '(orderless basic)))
|
|
||||||
|
|
||||||
;; (use-package corfu-terminal
|
|
||||||
;; :init (corfu-terminal-mode))
|
|
||||||
|
|
||||||
;; scheme
|
|
||||||
(use-package geiser
|
|
||||||
:config
|
:config
|
||||||
(with-eval-after-load 'geiser
|
(define-key ido-common-completion-map (kbd "SPC") 'ido-restrict-to-matches))
|
||||||
(setq geiser-default-implementation 'guile)))
|
|
||||||
|
|
||||||
(use-package geiser-guile)
|
|
||||||
|
|
||||||
;; general
|
;; general
|
||||||
(use-package general)
|
(use-package general)
|
||||||
|
|
||||||
;; god-mode,模态编辑
|
|
||||||
(use-package god-mode
|
|
||||||
:config
|
|
||||||
(setq god-mode-enable-function-key-translation nil)
|
|
||||||
(custom-set-faces
|
|
||||||
'(god-mode-lighter ((t (:inherit straight-process-error)))))
|
|
||||||
|
|
||||||
(defun my-sync-line-numbers-with-god-mode ()
|
|
||||||
(let ((desired (if (bound-and-true-p god-local-mode)
|
|
||||||
'relative
|
|
||||||
t)))
|
|
||||||
(unless (or (eq display-line-numbers desired) (bound-and-true-p olivetti-mode))
|
|
||||||
(setq display-line-numbers desired))))
|
|
||||||
(add-hook 'post-command-hook #'my-sync-line-numbers-with-god-mode)
|
|
||||||
|
|
||||||
(setq god-exempt-major-modes
|
|
||||||
(delete-dups (append '(diff-mode exwm-mode) god-exempt-major-modes))))
|
|
||||||
|
|
||||||
(provide 'init-terminal-package)
|
(provide 'init-terminal-package)
|
||||||
|
|
||||||
;;; init-terminal-package.el ends here
|
;;; init-terminal-package.el ends here
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(global-display-line-numbers-mode 1)
|
||||||
|
|
||||||
(defconst *is-mac* (eq system-type 'darwin))
|
(defconst *is-mac* (eq system-type 'darwin))
|
||||||
(defconst *is-linux* (eq system-type 'gnu/linux))
|
(defconst *is-linux* (eq system-type 'gnu/linux))
|
||||||
(defconst *is-windows* (or (eq system-type 'ms-dos)
|
(defconst *is-windows* (or (eq system-type 'ms-dos)
|
||||||
@@ -73,6 +75,10 @@
|
|||||||
'ripgrep)
|
'ripgrep)
|
||||||
(t 'grep)))
|
(t 'grep)))
|
||||||
|
|
||||||
|
(setq word-wrap-by-category t)
|
||||||
|
|
||||||
|
(setq kill-whole-line t)
|
||||||
|
|
||||||
(provide 'init-terminal-startup)
|
(provide 'init-terminal-startup)
|
||||||
|
|
||||||
;;; init-terminal-statup.el ends here
|
;;; init-terminal-statup.el ends here
|
||||||
|
|||||||
@@ -34,11 +34,12 @@
|
|||||||
"\\*Flutter\\*"
|
"\\*Flutter\\*"
|
||||||
"\\*Ibuffer\\*"
|
"\\*Ibuffer\\*"
|
||||||
"Buffers\\*$"
|
"Buffers\\*$"
|
||||||
"\\*Geiser Debug\\*"
|
"^\\*Geiser"
|
||||||
"\\*gptel-Kimi-Code\\*"
|
"\\*gptel-Kimi-Code\\*"
|
||||||
"^\\*sly"
|
"^\\*sly"
|
||||||
"\\*gptel-agent:.*\\*"
|
"\\*gptel-agent:.*\\*"
|
||||||
"^magit"
|
"^magit"
|
||||||
|
"\\*discomfort\\*"
|
||||||
bookmark-bmenu-mode
|
bookmark-bmenu-mode
|
||||||
lsp-bridge-ref-mode
|
lsp-bridge-ref-mode
|
||||||
comint-mode
|
comint-mode
|
||||||
@@ -77,7 +78,7 @@
|
|||||||
"^\\*elfeed-entry\\*$"
|
"^\\*elfeed-entry\\*$"
|
||||||
"^\\*macro expansion\\**"
|
"^\\*macro expansion\\**"
|
||||||
|
|
||||||
"\\*Agenda Commands\\*" "\\*Org Select\\*" "\\*Capture\\*" "^CAPTURE-.*\\.org*" "^CAPTURE-"
|
"\\*Agenda Commands\\*" "\\*Org Select\\*" "\\*Capture\\*" "^CAPTURE-.*\\.org*" "^CAPTURE-" "\\*Org Note\\*"
|
||||||
"\\*Gofmt Errors\\*$" "\\*Go Test\\*$" godoc-mode
|
"\\*Gofmt Errors\\*$" "\\*Go Test\\*$" godoc-mode
|
||||||
"\\*docker-containers\\*" "\\*docker-images\\*" "\\*docker-networks\\*" "\\*docker-volumes\\*"
|
"\\*docker-containers\\*" "\\*docker-images\\*" "\\*docker-networks\\*" "\\*docker-volumes\\*"
|
||||||
"\\*prolog\\*" inferior-python-mode inf-ruby-mode swift-repl-mode
|
"\\*prolog\\*" inferior-python-mode inf-ruby-mode swift-repl-mode
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
my-base16-dark-core-palette
|
my-base16-dark-core-palette
|
||||||
'((custom-theme-set-faces
|
'((custom-theme-set-faces
|
||||||
theme-name
|
theme-name
|
||||||
|
`(italic ((,class (:slant italic))))
|
||||||
`(org-level-1 ((,class (:foreground ,orange :height 1.0 :weight normal))))
|
`(org-level-1 ((,class (:foreground ,orange :height 1.0 :weight normal))))
|
||||||
`(org-level-2 ((,class (:foreground ,blue :height 1.0 :weight normal))))
|
`(org-level-2 ((,class (:foreground ,blue :height 1.0 :weight normal))))
|
||||||
`(org-level-3 ((,class (:foreground ,green :height 1.0 :weight normal))))
|
`(org-level-3 ((,class (:foreground ,green :height 1.0 :weight normal))))
|
||||||
@@ -81,7 +82,9 @@
|
|||||||
`(transient-key-stack ((,class (:foreground ,magenta :inherit transient-key))))
|
`(transient-key-stack ((,class (:foreground ,magenta :inherit transient-key))))
|
||||||
`(transient-key-recurse ((,class (:foreground ,blue :inherit transient-key))))
|
`(transient-key-recurse ((,class (:foreground ,blue :inherit transient-key))))
|
||||||
`(transient-key-noop ((,class (:foreground ,base01 :inherit transient-key))))
|
`(transient-key-noop ((,class (:foreground ,base01 :inherit transient-key))))
|
||||||
`(keycast-key ((,class (:foreground ,green :weight bold)))))))
|
`(keycast-key ((,class (:foreground ,green :weight bold))))
|
||||||
|
`(emms-playlist-track-face ((,class (:foreground ,cyan))))
|
||||||
|
`(emms-playlist-selected-face ((,class (:foreground ,blue :weight bold)))))))
|
||||||
|
|
||||||
(provide-theme 'my-base16-dark)
|
(provide-theme 'my-base16-dark)
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,9 @@
|
|||||||
`(transient-key-stack ((,class (:foreground ,magenta :inherit transient-key))))
|
`(transient-key-stack ((,class (:foreground ,magenta :inherit transient-key))))
|
||||||
`(transient-key-recurse ((,class (:foreground ,blue :inherit transient-key))))
|
`(transient-key-recurse ((,class (:foreground ,blue :inherit transient-key))))
|
||||||
`(transient-key-noop ((,class (:foreground ,base01 :inherit transient-key))))
|
`(transient-key-noop ((,class (:foreground ,base01 :inherit transient-key))))
|
||||||
`(keycast-key ((,class (:foreground ,green :weight bold)))))))
|
`(keycast-key ((,class (:foreground ,green :weight bold))))
|
||||||
|
`(emms-playlist-track-face ((,class (:foreground ,cyan))))
|
||||||
|
`(emms-playlist-selected-face ((,class (:foreground ,blue :weight bold)))))))
|
||||||
|
|
||||||
(provide-theme 'my-base16-light)
|
(provide-theme 'my-base16-light)
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
"#3A9C36")) ; green: 绿色
|
"#3A9C36")) ; green: 绿色
|
||||||
|
|
||||||
(defvar my-base16-light-core-palette
|
(defvar my-base16-light-core-palette
|
||||||
'("#062624" ; darkest-base: 最深背景
|
'("#051E23" ; darkest-base: 最深背景
|
||||||
"#E3FFE6" ; brightest-base: 最亮前景
|
"#FCFFDE" ; brightest-base: 最亮前景
|
||||||
"#A87C04" ; yellow: 黄色
|
"#A87C04" ; yellow: 黄色
|
||||||
"#C24713" ; orange: 橙色
|
"#C24713" ; orange: 橙色
|
||||||
"#CE2825" ; red: 红色
|
"#CE2825" ; red: 红色
|
||||||
|
|||||||
Reference in New Issue
Block a user