chore(config): Refactor Emacs config for cross-platform compatibility
Add Android/Termux support with `*is-android*` constant and conditional GUI/terminal initialization. Remove maximized frame defaults and custom.el. Replace corfu with corfu-terminal in TTY. Add god-mode to terminal config with line number sync. Update org agenda to use org-ql blocks with super-agenda grouping. Switch solarized-theme to fork. Clean up redundant functions and unify keyboard bindings across environments.
This commit is contained in:
33
custom.el
33
custom.el
@@ -1,33 +0,0 @@
|
|||||||
;;; -*- lexical-binding: t -*-
|
|
||||||
(custom-set-variables
|
|
||||||
;; custom-set-variables was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(custom-safe-themes
|
|
||||||
'("7fea145741b3ca719ae45e6533ad1f49b2a43bf199d9afaee5b6135fd9e6f9b8"
|
|
||||||
default))
|
|
||||||
'(package-selected-packages
|
|
||||||
'(ace-window benchmark-init cape cnfonts corfu crux drag-stuff eglot
|
|
||||||
embark-consult everything exec-path-form-shell gcmh
|
|
||||||
hungry-delete marginalia multiple-cursors orderless
|
|
||||||
restart-emacs smart-mode-line solarized-theme vertico))
|
|
||||||
'(safe-local-variable-values
|
|
||||||
'((eval read-only-mode t) (eval jinx-mode nil)
|
|
||||||
(eval visual-line-mode nil)
|
|
||||||
(eval when (fboundp 'rainbow-mode) (rainbow-mode 1))
|
|
||||||
(gptel-mode . t)
|
|
||||||
(eval progn
|
|
||||||
(setq org-hugo-base-dir
|
|
||||||
(if (eq system-type 'windows-nt)
|
|
||||||
"h:/emacs/hugo/this-is-my-blog/"
|
|
||||||
"~/org/hugo/this-is-my-blog/"))
|
|
||||||
(org-hugo-auto-export-mode))
|
|
||||||
(org-use-tag-inheritance)))
|
|
||||||
'(warning-suppress-log-types '((initialization))))
|
|
||||||
(custom-set-faces
|
|
||||||
;; custom-set-faces was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -15,11 +15,6 @@
|
|||||||
(setq display-line-numbers-grow-only t) ; 行号栏只增不减
|
(setq display-line-numbers-grow-only t) ; 行号栏只增不减
|
||||||
(setq display-line-numbers-width-start 4) ; 预设4位宽度
|
(setq display-line-numbers-width-start 4) ; 预设4位宽度
|
||||||
|
|
||||||
;; 启动时初始窗口最大化
|
|
||||||
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
|
|
||||||
;; 之后新建的窗口也默认最大化
|
|
||||||
(add-to-list 'default-frame-alist '(fullscreen . maximized))
|
|
||||||
|
|
||||||
(setq frame-background-mode 'dark)
|
(setq frame-background-mode 'dark)
|
||||||
|
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
|
|||||||
5
init.el
5
init.el
@@ -13,9 +13,10 @@
|
|||||||
(when (file-exists-p custom-file)
|
(when (file-exists-p custom-file)
|
||||||
(load-file custom-file))
|
(load-file custom-file))
|
||||||
|
|
||||||
(if (display-graphic-p)
|
(require 'init-const)
|
||||||
|
|
||||||
|
(if (or (display-graphic-p) *is-android*)
|
||||||
(progn
|
(progn
|
||||||
(require 'init-const)
|
|
||||||
(load "init-proxy" t)
|
(load "init-proxy" t)
|
||||||
(require 'init-startup)
|
(require 'init-startup)
|
||||||
(require 'init-elpa)
|
(require 'init-elpa)
|
||||||
|
|||||||
@@ -24,36 +24,41 @@
|
|||||||
completion-at-point-functions))))))
|
completion-at-point-functions))))))
|
||||||
|
|
||||||
;; corfu
|
;; corfu
|
||||||
(use-package corfu
|
(if (display-graphic-p)
|
||||||
:autoload
|
(use-package corfu
|
||||||
(corfu-quit consult-completion-in-region)
|
:autoload
|
||||||
:functions
|
(corfu-quit consult-completion-in-region)
|
||||||
(persistent-scratch-save)
|
:functions
|
||||||
:custom
|
(persistent-scratch-save)
|
||||||
(corfu-auto t)
|
:custom
|
||||||
(corfu-auto-prefix 2)
|
(corfu-auto t)
|
||||||
(corfu-count 12)
|
(corfu-auto-prefix 2)
|
||||||
(corfu-preview-current nil)
|
(corfu-count 12)
|
||||||
(corfu-on-exact-match nil)
|
(corfu-preview-current nil)
|
||||||
(corfu-auto-delay 0.2)
|
(corfu-on-exact-match nil)
|
||||||
(corfu-popupinfo-delay '(0.4 . 0.2))
|
(corfu-auto-delay 0.2)
|
||||||
(global-corfu-modes '((not erc-mode
|
(corfu-popupinfo-delay '(0.4 . 0.2))
|
||||||
circe-mode
|
(global-corfu-modes '((not erc-mode
|
||||||
help-mode
|
circe-mode
|
||||||
gud-mode
|
help-mode
|
||||||
vterm-mode)
|
gud-mode
|
||||||
t))
|
vterm-mode)
|
||||||
:init
|
t))
|
||||||
(global-corfu-mode)
|
:init
|
||||||
(corfu-popupinfo-mode)
|
(global-corfu-mode)
|
||||||
(corfu-history-mode)
|
(corfu-popupinfo-mode)
|
||||||
:config
|
(corfu-history-mode)
|
||||||
;;Quit completion before saving
|
:config
|
||||||
(add-hook 'before-save-hook #'corfu-quit)
|
;;Quit completion before saving
|
||||||
(advice-add #'persistent-scratch-save :before #'corfu-quit)
|
(add-hook 'before-save-hook #'corfu-quit)
|
||||||
:bind
|
(advice-add #'persistent-scratch-save :before #'corfu-quit)
|
||||||
(:map corfu-map
|
:bind
|
||||||
("RET" . nil)))
|
(:map corfu-map
|
||||||
|
("RET" . nil)))
|
||||||
|
|
||||||
|
(use-package corfu-terminal
|
||||||
|
:init
|
||||||
|
(corfu-terminal-mode)))
|
||||||
|
|
||||||
;; 在eshell中使用tab打开补全
|
;; 在eshell中使用tab打开补全
|
||||||
(add-hook 'eshell-mode-hook
|
(add-hook 'eshell-mode-hook
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
(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)
|
||||||
(eq system-type 'windows-nt)))
|
(eq system-type 'windows-nt)))
|
||||||
|
(defconst *is-android* (if (getenv "TERMUX_VERSION") t nil))
|
||||||
|
|
||||||
(if *is-windows*
|
(if *is-windows*
|
||||||
(progn
|
(progn
|
||||||
|
|||||||
@@ -6,6 +6,13 @@
|
|||||||
|
|
||||||
(setq dired-dwim-target t)
|
(setq dired-dwim-target t)
|
||||||
|
|
||||||
|
(use-package dired
|
||||||
|
:straight nil
|
||||||
|
:config
|
||||||
|
(when *is-mac*
|
||||||
|
(setq insert-directory-program "gls")
|
||||||
|
(setq dired-use-ls-dired t)))
|
||||||
|
|
||||||
;; dirvish
|
;; dirvish
|
||||||
(use-package dirvish
|
(use-package dirvish
|
||||||
:hook
|
:hook
|
||||||
|
|||||||
@@ -45,7 +45,8 @@
|
|||||||
(org-indent-mode nil org-indent)
|
(org-indent-mode nil org-indent)
|
||||||
(desktop-environment-mode nil desktop-environment)
|
(desktop-environment-mode nil desktop-environment)
|
||||||
(hs-minor-mode nil hideshow)
|
(hs-minor-mode nil hideshow)
|
||||||
(god-local-mode ,(propertize " THANK-GOD-MODE" 'face '(:foreground "#CE2825" :weight bold)) god-mode))))
|
(god-local-mode ,(propertize " THANK-GOD-MODE" 'face 'god-mode-lighter) god-mode)
|
||||||
|
(rainbow-delimiters-mode ,(propertize " Rdelimiters" 'face 'rainbow-delimiters-depth-1-face) rainbow-delimiters))))
|
||||||
|
|
||||||
;; 安装gcmh用于管理内存回收
|
;; 安装gcmh用于管理内存回收
|
||||||
(use-package gcmh
|
(use-package gcmh
|
||||||
@@ -60,8 +61,10 @@
|
|||||||
|
|
||||||
;; 安装benchmark-init
|
;; 安装benchmark-init
|
||||||
(use-package benchmark-init
|
(use-package benchmark-init
|
||||||
:init (benchmark-init/activate)
|
:init
|
||||||
:hook (after-init . benchmark-init/deactivate))
|
(benchmark-init/activate)
|
||||||
|
:hook
|
||||||
|
(after-init . benchmark-init/deactivate))
|
||||||
|
|
||||||
(provide 'init-elpa)
|
(provide 'init-elpa)
|
||||||
|
|
||||||
|
|||||||
@@ -38,13 +38,6 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
|||||||
(message "enable global-jinx-mode")
|
(message "enable global-jinx-mode")
|
||||||
(global-jinx-mode 1)))))))
|
(global-jinx-mode 1)))))))
|
||||||
|
|
||||||
(defun duplicate-and-move-to-next-line()
|
|
||||||
"Duplicate current line and move to next line."
|
|
||||||
(interactive)
|
|
||||||
(progn
|
|
||||||
(duplicate-line)
|
|
||||||
(next-line)))
|
|
||||||
|
|
||||||
(defun popper-toggle-type-delete-other-window()
|
(defun popper-toggle-type-delete-other-window()
|
||||||
"Toggle type of popper window and delete other window."
|
"Toggle type of popper window and delete other window."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|||||||
@@ -7,15 +7,21 @@
|
|||||||
;; 修改mac键位
|
;; 修改mac键位
|
||||||
(when *is-mac*
|
(when *is-mac*
|
||||||
(setq mac-command-modifier 'meta)
|
(setq mac-command-modifier 'meta)
|
||||||
(setq mac-option-modifier 'none))
|
(setq mac-option-modifier 'super)
|
||||||
|
(setq mac-pass-control-to-system nil)
|
||||||
|
(setq mac-pass-command-to-system nil))
|
||||||
|
|
||||||
;; god-mode
|
;; god-mode
|
||||||
(general-def god-local-mode-map
|
(general-def god-local-mode-map
|
||||||
"i" 'god-mode-all
|
"i" 'god-mode-all
|
||||||
"<escape>" 'god-mode-all
|
|
||||||
"[" 'backward-paragraph
|
"[" 'backward-paragraph
|
||||||
"]" 'forward-paragraph
|
"]" 'forward-paragraph
|
||||||
"." 'repeat)
|
"." 'repeat
|
||||||
|
"y" 'yank
|
||||||
|
"C-c C-<f12>" 'scratch-buffer
|
||||||
|
"z" 'avy-goto-char
|
||||||
|
"'" 'avy-goto-word-1
|
||||||
|
"<f2>" 'open-init-file)
|
||||||
|
|
||||||
;; g for gptel
|
;; g for gptel
|
||||||
(general-def
|
(general-def
|
||||||
@@ -34,12 +40,12 @@
|
|||||||
:prefix "C-c u"
|
:prefix "C-c u"
|
||||||
"l" 'global-tab-line-mode
|
"l" 'global-tab-line-mode
|
||||||
"d" 'disable-theme
|
"d" 'disable-theme
|
||||||
"r" 'rainbow-mode
|
"R" 'rainbow-mode
|
||||||
"b" 'indent-bars-mode
|
"b" 'indent-bars-mode
|
||||||
"t" 'consult-theme
|
"t" 'consult-theme
|
||||||
"c" 'my-color-picker
|
"c" 'my-color-picker
|
||||||
"f" 'describe-face
|
"f" 'describe-face
|
||||||
"R" 'rainbow-delimiters-mode)
|
"r" 'rainbow-delimiters-mode)
|
||||||
|
|
||||||
;; f for find and consult command
|
;; f for find and consult command
|
||||||
(general-def
|
(general-def
|
||||||
@@ -232,7 +238,6 @@
|
|||||||
(general-def
|
(general-def
|
||||||
|
|
||||||
;; god-mode
|
;; god-mode
|
||||||
"<escape>" 'god-mode-all
|
|
||||||
"M-i" 'god-mode-all
|
"M-i" 'god-mode-all
|
||||||
|
|
||||||
;; buffer, file, and window
|
;; buffer, file, and window
|
||||||
@@ -253,16 +258,16 @@
|
|||||||
"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-o" 'open-line
|
|
||||||
"C-a" 'crux-move-beginning-of-line
|
"C-a" 'crux-move-beginning-of-line
|
||||||
"M-y" 'consult-yank-from-kill-ring
|
"M-y" 'consult-yank-from-kill-ring
|
||||||
"C-c <backspace>" 'hungry-delete-backward
|
"C-c <backspace>" 'hungry-delete-backward
|
||||||
"C-c C-<backspace>" 'hungry-delete-forward
|
"C-c C-<backspace>" '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-SPC" 'er/mark-symbol
|
||||||
|
|
||||||
;; undo
|
;; undo
|
||||||
"C-/" 'undo-fu-only-undo
|
"C-/" 'undo-fu-only-undo
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
;; org-babel scheme
|
;; org-babel scheme
|
||||||
(use-package ob-scheme
|
(use-package ob-scheme
|
||||||
:straight (:type built-in)
|
:straight nil
|
||||||
:config
|
:config
|
||||||
(add-to-list 'org-babel-load-languages '(scheme . t))
|
(add-to-list 'org-babel-load-languages '(scheme . t))
|
||||||
(org-babel-do-load-languages
|
(org-babel-do-load-languages
|
||||||
@@ -137,12 +137,22 @@
|
|||||||
|
|
||||||
;; 自定义agenda视图
|
;; 自定义agenda视图
|
||||||
(setq org-agenda-custom-commands
|
(setq org-agenda-custom-commands
|
||||||
'(("pa" "Priority >= A"
|
'(("pa" "priority >= A"
|
||||||
((tags-todo "+PRIORITY=\"A\"")))
|
((org-ql-block '(and (priority "A") (todo))
|
||||||
("pb" "Priority >= B"
|
((org-ql-block-header "priority = A")))))
|
||||||
((tags-todo "+PRIORITY<=\"B\"")))
|
("pb" "priority >= B"
|
||||||
("pc" "Priority >= C"
|
((org-ql-block '(and (priority >= "B") (todo))
|
||||||
((tags-todo "+PRIORITY<=\"C\"")))
|
((org-ql-block-header "priority >= B")
|
||||||
|
(org-super-agenda-groups
|
||||||
|
'((:name "priority = A" :priority "A")
|
||||||
|
(:name "priority = B" :priority "B")))))))
|
||||||
|
("pc" "priority >= C"
|
||||||
|
((org-ql-block '(and (priority >= "C") (todo))
|
||||||
|
((org-ql-block-header "priority >= C")
|
||||||
|
(org-super-agenda-groups
|
||||||
|
'((:name "priority = A" :priority "A")
|
||||||
|
(:name "priority = B" :priority "B")
|
||||||
|
(:name "priority = C" :priority "C")))))))
|
||||||
("qd" "TODO entries sort by closed time"
|
("qd" "TODO entries sort by closed time"
|
||||||
((org-ql-block '(closed)
|
((org-ql-block '(closed)
|
||||||
((org-ql-block-header "Closed TODOs")
|
((org-ql-block-header "Closed TODOs")
|
||||||
@@ -171,8 +181,7 @@
|
|||||||
(:name "priority = A" :priority "A")
|
(:name "priority = A" :priority "A")
|
||||||
(:name "priority = B" :priority "B")
|
(:name "priority = B" :priority "B")
|
||||||
(:name "other priority" :priority< "B")
|
(:name "other priority" :priority< "B")
|
||||||
(:name "someday" :todo "SOMEDAY")
|
(:name "someday" :todo "SOMEDAY")))))))))
|
||||||
))))))))
|
|
||||||
|
|
||||||
;; capture模板
|
;; capture模板
|
||||||
(unless *is-windows*
|
(unless *is-windows*
|
||||||
|
|||||||
@@ -189,12 +189,15 @@ targets."
|
|||||||
:delight
|
:delight
|
||||||
:init
|
:init
|
||||||
(projectile-mode)
|
(projectile-mode)
|
||||||
|
(projectile-known-projects)
|
||||||
:bind
|
:bind
|
||||||
(:map projectile-mode-map
|
(:map projectile-mode-map
|
||||||
("C-x p" . projectile-command-map)
|
("C-x p" . projectile-command-map)
|
||||||
("C-x p b" . consult-project-buffer))
|
("C-x p b" . consult-project-buffer))
|
||||||
:config
|
:config
|
||||||
(setq projectile-enable-caching t))
|
(setq projectile-enable-caching 'persistent)
|
||||||
|
(setq projectile-auto-discover t)
|
||||||
|
(setq projectile-auto-cleanup-known-projects t))
|
||||||
|
|
||||||
;; ibuffer
|
;; ibuffer
|
||||||
(use-package ibuffer
|
(use-package ibuffer
|
||||||
@@ -238,7 +241,9 @@ targets."
|
|||||||
(mode . magit-log-mode)
|
(mode . magit-log-mode)
|
||||||
(mode . magit-process-mode)
|
(mode . magit-process-mode)
|
||||||
(mode . magit-status-mode)))
|
(mode . magit-status-mode)))
|
||||||
("Directories" (mode . dired-mode))
|
("Directories" (or
|
||||||
|
(mode . dired-mode)
|
||||||
|
(name . "^*dirvish")))
|
||||||
("Diff" (name . "^*Diff")))))
|
("Diff" (name . "^*Diff")))))
|
||||||
|
|
||||||
(add-hook 'ibuffer-hook
|
(add-hook 'ibuffer-hook
|
||||||
@@ -247,7 +252,8 @@ targets."
|
|||||||
(ibuffer-do-sort-by-alphabetic))))
|
(ibuffer-do-sort-by-alphabetic))))
|
||||||
|
|
||||||
(setq ibuffer-show-empty-filter-groups nil)
|
(setq ibuffer-show-empty-filter-groups nil)
|
||||||
(setq ibuffer-use-other-window t))
|
(setq ibuffer-use-other-window t)
|
||||||
|
(setq ibuffer-default-sorting-mode 'filename))
|
||||||
|
|
||||||
;; avy中文支持
|
;; avy中文支持
|
||||||
(use-package ace-pinyin
|
(use-package ace-pinyin
|
||||||
@@ -285,10 +291,6 @@ targets."
|
|||||||
(modify-syntax-entry (+ start i) "_" jinx--syntax-table)))))
|
(modify-syntax-entry (+ start i) "_" jinx--syntax-table)))))
|
||||||
(require 'init-jinx)))
|
(require 'init-jinx)))
|
||||||
|
|
||||||
;; vterm,终端
|
|
||||||
;; (unless *is-windows*
|
|
||||||
;; (use-package vterm))
|
|
||||||
|
|
||||||
;; eat,终端
|
;; eat,终端
|
||||||
(use-package eat
|
(use-package eat
|
||||||
:straight
|
:straight
|
||||||
|
|||||||
@@ -25,13 +25,6 @@
|
|||||||
(global-treesit-auto-mode)
|
(global-treesit-auto-mode)
|
||||||
(setq treesit-font-lock-level 4))
|
(setq treesit-font-lock-level 4))
|
||||||
|
|
||||||
;; lua
|
|
||||||
(use-package lua-ts-mode
|
|
||||||
:mode
|
|
||||||
("\\.lua\\'" . lua-ts-mode)
|
|
||||||
:config
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-ts-mode)))
|
|
||||||
|
|
||||||
;; scheme
|
;; scheme
|
||||||
(use-package geiser
|
(use-package geiser
|
||||||
:config
|
:config
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
;; mac自动全屏
|
;; mac自动全屏
|
||||||
(cond
|
(cond
|
||||||
(*is-mac*
|
(*is-mac*
|
||||||
|
(set-frame-parameter nil 'fullscreen 'fullscreen)
|
||||||
(toggle-frame-fullscreen)
|
(toggle-frame-fullscreen)
|
||||||
(global-unset-key (kbd "<f12>"))
|
(global-unset-key (kbd "<f12>"))
|
||||||
(global-set-key (kbd "<f12>") 'toggle-frame-fullscreen))
|
(global-set-key (kbd "<f12>") 'toggle-frame-fullscreen))
|
||||||
@@ -83,9 +84,6 @@
|
|||||||
(with-eval-after-load 'elec-pair
|
(with-eval-after-load 'elec-pair
|
||||||
(add-to-list 'electric-pair-pairs '(?\~ . ?\~)))
|
(add-to-list 'electric-pair-pairs '(?\~ . ?\~)))
|
||||||
|
|
||||||
;; ibuffer
|
|
||||||
(setq ibuffer-default-sorting-mode 'filename)
|
|
||||||
|
|
||||||
;; 关闭native compile警告
|
;; 关闭native compile警告
|
||||||
(setq native-comp-async-warnings-errors-kind 'silent)
|
(setq native-comp-async-warnings-errors-kind 'silent)
|
||||||
|
|
||||||
@@ -107,6 +105,9 @@
|
|||||||
|
|
||||||
(setq switch-to-buffer-obey-display-actions t)
|
(setq switch-to-buffer-obey-display-actions t)
|
||||||
|
|
||||||
|
;; 优化中文混排时的换行规则
|
||||||
|
(setq word-wrap-by-category t)
|
||||||
|
|
||||||
(provide 'init-startup)
|
(provide 'init-startup)
|
||||||
|
|
||||||
;;; init-startup.el ends here
|
;;; init-startup.el ends here
|
||||||
|
|||||||
@@ -21,6 +21,19 @@
|
|||||||
(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"
|
||||||
@@ -32,6 +45,10 @@
|
|||||||
;; 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
|
||||||
@@ -47,7 +64,6 @@
|
|||||||
"C-," 'duplicate-and-move-to-next-line
|
"C-," 'duplicate-and-move-to-next-line
|
||||||
"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-o" 'open-line
|
|
||||||
"C-a" 'crux-move-beginning-of-line
|
"C-a" 'crux-move-beginning-of-line
|
||||||
"M-y" 'yank-from-kill-ring
|
"M-y" 'yank-from-kill-ring
|
||||||
"C-c DEL" 'hungry-delete-backward
|
"C-c DEL" 'hungry-delete-backward
|
||||||
@@ -76,7 +92,6 @@
|
|||||||
(lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer)))
|
(lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer)))
|
||||||
"show diff between the buffer and its file"))
|
"show diff between the buffer and its file"))
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-terminal-kbd)
|
(provide 'init-terminal-kbd)
|
||||||
|
|
||||||
;;; init-terminal-kbd.el ends here
|
;;; init-terminal-kbd.el ends here
|
||||||
|
|||||||
@@ -57,6 +57,24 @@
|
|||||||
;; 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
|
||||||
|
|||||||
@@ -51,21 +51,28 @@
|
|||||||
|
|
||||||
(when (display-graphic-p)
|
(when (display-graphic-p)
|
||||||
(recentf-mode)
|
(recentf-mode)
|
||||||
(setq recentf-max-saved-items 30)) ;; 最大保存数量
|
(setq recentf-max-saved-items 30))
|
||||||
|
|
||||||
(delete-selection-mode)
|
(delete-selection-mode)
|
||||||
|
|
||||||
(setq initial-scratch-message
|
(setq initial-scratch-message
|
||||||
"")
|
"")
|
||||||
|
|
||||||
(setq ibuffer-default-sorting-mode 'filename)
|
|
||||||
|
|
||||||
(setq native-comp-async-warnings-errors-kind 'silent)
|
(setq native-comp-async-warnings-errors-kind 'silent)
|
||||||
|
|
||||||
(if (boundp 'use-short-answers)
|
(if (boundp 'use-short-answers)
|
||||||
(setq use-short-answers t)
|
(setq use-short-answers t)
|
||||||
(fset 'yes-or-no-p 'y-or-n-p))
|
(fset 'yes-or-no-p 'y-or-n-p))
|
||||||
|
|
||||||
|
(setq delete-by-moving-to-trash t)
|
||||||
|
|
||||||
|
(setq xref-search-program
|
||||||
|
(cond
|
||||||
|
((or (executable-find "ripgrep")
|
||||||
|
(executable-find "rg"))
|
||||||
|
'ripgrep)
|
||||||
|
(t 'grep)))
|
||||||
|
|
||||||
(provide 'init-terminal-startup)
|
(provide 'init-terminal-startup)
|
||||||
|
|
||||||
;;; init-terminal-statup.el ends here
|
;;; init-terminal-statup.el ends here
|
||||||
|
|||||||
@@ -54,7 +54,9 @@
|
|||||||
(setq custom-safe-themes t)
|
(setq custom-safe-themes t)
|
||||||
|
|
||||||
;; 安装solarized dark
|
;; 安装solarized dark
|
||||||
(use-package solarized-theme)
|
(use-package solarized-theme
|
||||||
|
:straight
|
||||||
|
'(solarized-emacs :fork (:host github :repo "Andsy10/solarized-emacs")))
|
||||||
|
|
||||||
;; 把主题加载延迟到frame创建之后,防止daemon模式下宏不能正常展开
|
;; 把主题加载延迟到frame创建之后,防止daemon模式下宏不能正常展开
|
||||||
(if (daemonp)
|
(if (daemonp)
|
||||||
@@ -119,8 +121,8 @@
|
|||||||
|
|
||||||
;; 安装cnfonts脚本,用于修复中英文对齐
|
;; 安装cnfonts脚本,用于修复中英文对齐
|
||||||
(use-package cnfonts
|
(use-package cnfonts
|
||||||
:hook
|
:init
|
||||||
(after-init-hook . cnfonts-mode)
|
(add-hook 'after-init-hook 'cnfonts-mode)
|
||||||
:config
|
:config
|
||||||
(cnfonts--select-profile "profile1"))
|
(cnfonts--select-profile "profile1"))
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
"^\\*elfeed-entry\\*$"
|
"^\\*elfeed-entry\\*$"
|
||||||
"^\\*macro expansion\\**"
|
"^\\*macro expansion\\**"
|
||||||
|
|
||||||
"\\*Agenda Commands\\*" "\\*Org Select\\*" "\\*Capture\\*" "^CAPTURE-.*\\.org*"
|
"\\*Agenda Commands\\*" "\\*Org Select\\*" "\\*Capture\\*" "^CAPTURE-.*\\.org*" "^CAPTURE-"
|
||||||
"\\*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
|
||||||
|
|||||||
@@ -52,11 +52,17 @@
|
|||||||
`(mode-line ((,class (:foreground ,base0 :background ,base02))))
|
`(mode-line ((,class (:foreground ,base0 :background ,base02))))
|
||||||
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))
|
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))
|
||||||
`(display-time-date-and-time ((,class (:foreground ,base1 :bold t))))
|
`(display-time-date-and-time ((,class (:foreground ,base1 :bold t))))
|
||||||
`(jinx-misspelled ((,class (:underline (:style dashes :color ,yellow)))))
|
`(jinx-misspelled ((,class (:underline (:style line :color ,yellow)))))
|
||||||
`(geiser-font-lock-repl-output ((,class (:foreground ,green))))
|
`(geiser-font-lock-repl-output ((,class (:foreground ,green))))
|
||||||
`(geiser-font-lock-doc-link ((,class (:foreground ,blue :underline t))))
|
`(geiser-font-lock-doc-link ((,class (:foreground ,blue :underline t))))
|
||||||
`(geiser-font-lock-error-link ((,class (:foreground ,orange :underline t))))
|
`(geiser-font-lock-error-link ((,class (:foreground ,orange :underline t))))
|
||||||
`(vertico-current ((,class (:background ,base02 :extend t :underline nil)))))))
|
`(vertico-current ((,class (:background ,base02 :extend t :underline nil))))
|
||||||
|
`(vundo-saved ((,class (:foreground ,green))))
|
||||||
|
`(vundo-last-saved ((,class (:foreground ,green :weight bold))))
|
||||||
|
`(vundo-highlight ((,class (:foreground ,cyan :weight bold))))
|
||||||
|
`(vundo-node ((,class (:foreground ,base01))))
|
||||||
|
`(vundo-stem ((,class (:foreground ,base01))))
|
||||||
|
`(god-mode-lighter ((,class (:foreground ,red :weight bold)))))))
|
||||||
|
|
||||||
(provide-theme 'my-base16-dark)
|
(provide-theme 'my-base16-dark)
|
||||||
|
|
||||||
|
|||||||
@@ -52,11 +52,17 @@
|
|||||||
`(mode-line ((,class (:foreground ,base0 :background ,base02))))
|
`(mode-line ((,class (:foreground ,base0 :background ,base02))))
|
||||||
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))
|
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))
|
||||||
`(display-time-date-and-time ((,class (:foreground ,base1 :bold t))))
|
`(display-time-date-and-time ((,class (:foreground ,base1 :bold t))))
|
||||||
`(jinx-misspelled ((,class (:underline (:style dashes :color ,yellow)))))
|
`(jinx-misspelled ((,class (:underline (:style line :color ,yellow)))))
|
||||||
`(geiser-font-lock-repl-output ((,class (:foreground ,green))))
|
`(geiser-font-lock-repl-output ((,class (:foreground ,green))))
|
||||||
`(geiser-font-lock-doc-link ((,class (:foreground ,blue :underline t))))
|
`(geiser-font-lock-doc-link ((,class (:foreground ,blue :underline t))))
|
||||||
`(geiser-font-lock-error-link ((,class (:foreground ,orange :underline t))))
|
`(geiser-font-lock-error-link ((,class (:foreground ,orange :underline t))))
|
||||||
`(vertico-current ((,class (:background ,base02 :extend t :underline nil)))))))
|
`(vertico-current ((,class (:background ,base02 :extend t :underline nil))))
|
||||||
|
`(vundo-saved ((,class (:foreground ,green))))
|
||||||
|
`(vundo-last-saved ((,class (:foreground ,green :weight bold))))
|
||||||
|
`(vundo-highlight ((,class (:foreground ,cyan :weight bold))))
|
||||||
|
`(vundo-node ((,class (:foreground ,base01))))
|
||||||
|
`(vundo-stem ((,class (:foreground ,base01))))
|
||||||
|
`(god-mode-lighter ((,class (:foreground ,red :weight bold)))))))
|
||||||
|
|
||||||
(provide-theme 'my-base16-light)
|
(provide-theme 'my-base16-light)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user