;;; input/chinese/config.el -*- lexical-binding: t; -*- (use-package! pyim :after-call after-find-file pre-command-hook :config (setq pyim-dcache-directory (concat doom-cache-dir "pyim/") pyim-page-tooltip t default-input-method "pyim")) (use-package! pangu-spacing :hook (text-mode . pangu-spacing-mode) :config ;; Always insert `real' space in org-mode. (setq-hook! 'org-mode-hook pangu-spacing-real-insert-separtor t)) (use-package! fcitx :after evil :config (when (executable-find "fcitx-remote") (fcitx-evil-turn-on))) (use-package! ace-pinyin :after avy :init (setq ace-pinyin-use-avy t) :config (ace-pinyin-global-mode t)) ;; ;;; Hacks (defadvice! +chinese--org-html-paragraph-a (args) "Join consecutive Chinese lines into a single long line without unwanted space when exporting org-mode to html." :filter-args #'org-html-paragraph (cl-destructuring-bind (paragraph contents info) args (let* ((fix-regexp "[[:multibyte:]]") (origin-contents (replace-regexp-in-string "<[Bb][Rr] */>" "" contents)) (fixed-contents (replace-regexp-in-string (concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)") "\\1\\2" origin-contents))) (list paragraph fixed-contents info))))