chore(config): Add some config for android device

This commit is contained in:
2026-05-18 23:03:31 +08:00
parent e2a352709c
commit ff77b5cafe
7 changed files with 76 additions and 43 deletions

View File

@@ -0,0 +1,13 @@
;;; -*- 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.
'(safe-local-variable-values '((org-use-tag-inheritance))))
(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.
)

View File

@@ -24,41 +24,41 @@
completion-at-point-functions)))))) completion-at-point-functions))))))
;; corfu ;; corfu
(if (display-graphic-p) (use-package corfu
(use-package corfu :autoload
:autoload (corfu-quit consult-completion-in-region)
(corfu-quit consult-completion-in-region) :functions
:functions (persistent-scratch-save)
(persistent-scratch-save) :custom
:custom (corfu-auto t)
(corfu-auto t) (corfu-auto-prefix 2)
(corfu-auto-prefix 2) (corfu-count 12)
(corfu-count 12) (corfu-preview-current nil)
(corfu-preview-current nil) (corfu-on-exact-match nil)
(corfu-on-exact-match nil) (corfu-auto-delay 0.2)
(corfu-auto-delay 0.2) (corfu-popupinfo-delay '(0.4 . 0.2))
(corfu-popupinfo-delay '(0.4 . 0.2)) (global-corfu-modes '((not erc-mode
(global-corfu-modes '((not erc-mode circe-mode
circe-mode help-mode
help-mode gud-mode
gud-mode vterm-mode)
vterm-mode) t))
t)) :init
:init (global-corfu-mode)
(global-corfu-mode) (corfu-popupinfo-mode)
(corfu-popupinfo-mode) (corfu-history-mode)
(corfu-history-mode) :config
:config ;;Quit completion before saving
;;Quit completion before saving (add-hook 'before-save-hook #'corfu-quit)
(add-hook 'before-save-hook #'corfu-quit) (advice-add #'persistent-scratch-save :before #'corfu-quit)
(advice-add #'persistent-scratch-save :before #'corfu-quit) :bind
:bind (:map corfu-map
(:map corfu-map ("RET" . nil)))
("RET" . nil)))
(unless (display-graphic-p)
(use-package corfu-terminal (use-package corfu-terminal
:init :init
(corfu-terminal-mode))) (add-hook 'global-corfu-mode-hook 'corfu-terminal-mode)))
;; 在eshell中使用tab打开补全 ;; 在eshell中使用tab打开补全
(add-hook 'eshell-mode-hook (add-hook 'eshell-mode-hook

View File

@@ -297,6 +297,10 @@
"C-x r b" 'consult-bookmark "C-x r b" 'consult-bookmark
"C-;" 'embark-act) "C-;" 'embark-act)
(when *is-android*
(general-def
"C-M-w" 'popper-toggle-type-delete-other-window))
;; expand region ;; expand region
(setq expand-region-reset-fast-key "r") (setq expand-region-reset-fast-key "r")
(setq expand-region-contract-fast-key "c") (setq expand-region-contract-fast-key "c")

View File

@@ -76,7 +76,9 @@
:init :init
(denote-rename-buffer-mode) (denote-rename-buffer-mode)
:config :config
(setq denote-directory "~/org/my-org-note/") (if *is-android*
(setq denote-directory "~/storage/shared/my-org-note/")
(setq denote-directory "~/org/my-org-note/"))
(setq denote-prompts '(title signature keywords)) (setq denote-prompts '(title signature keywords))
(setq denote-title-history nil) (setq denote-title-history nil)
(setq denote-signature-history (setq denote-signature-history

View File

@@ -331,8 +331,10 @@ targets."
;; god-mode模态编辑 ;; god-mode模态编辑
(use-package god-mode (use-package god-mode
:init
(if *is-android* (god-mode-all))
:config :config
(which-key-enable-god-mode-support) (unless *is-android* (which-key-enable-god-mode-support))
(setq god-mode-enable-function-key-translation nil) (setq god-mode-enable-function-key-translation nil)
(defun my-sync-line-numbers-with-god-mode () (defun my-sync-line-numbers-with-god-mode ()

View File

@@ -51,9 +51,9 @@
(global-auto-revert-mode 1) (global-auto-revert-mode 1)
;; 开启recent file mode ;; 开启recent file mode
(when (display-graphic-p) (when (or (display-graphic-p) *is-android*)
(recentf-mode) (recentf-mode)
(setq recentf-max-saved-items 30)) ;; 最大保存数量 (setq recentf-max-saved-items 30))
;; 启用select delete ;; 启用select delete
(delete-selection-mode) (delete-selection-mode)

View File

@@ -59,18 +59,30 @@
'(solarized-emacs :fork (:host github :repo "Andsy10/solarized-emacs"))) '(solarized-emacs :fork (:host github :repo "Andsy10/solarized-emacs")))
;; 把主题加载延迟到frame创建之后防止daemon模式下宏不能正常展开 ;; 把主题加载延迟到frame创建之后防止daemon模式下宏不能正常展开
(if (daemonp) (if *is-android*
(add-hook 'after-make-frame-functions (if (daemonp)
(lambda (frame) (add-hook 'after-make-frame-functions
(with-selected-frame frame (lambda (frame)
(load-theme 'my-base16-dark t)))) (with-selected-frame frame
(load-theme 'my-base16-dark t)) (load-theme 'my-base16-light t))))
(load-theme 'my-base16-light t))
(if (daemonp)
(add-hook 'after-make-frame-functions
(lambda (frame)
(with-selected-frame frame
(load-theme 'my-base16-dark t))))
(load-theme 'my-base16-dark t)))
;; 很多主题 ;; 很多主题
;; (use-package doom-themes) ;; (use-package doom-themes)
;; (use-package color-theme-modern) ;; (use-package color-theme-modern)
(use-package naysayer-theme) (use-package naysayer-theme)
(if *is-android*
(use-package simple-modeline
:init
(simple-modeline-mode)))
;; eshell高亮 ;; eshell高亮
(use-package eshell-syntax-highlighting (use-package eshell-syntax-highlighting
:hook :hook