Moving to Doom Emacs!

This commit is contained in:
Derek Taylor
2019-12-16 20:21:19 -06:00
parent d9f2f456f1
commit d4b4c33550
683 changed files with 51877 additions and 100 deletions

View File

@@ -0,0 +1,42 @@
#+TITLE: input/chinese
#+DATE: May 13, 2019
#+SINCE: 2.1
#+STARTUP: inlineimages
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#hacks][Hacks]]
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]
* Description
This module adds support for traditional Chinese script by introducing two input
methods: Pinyin and Wubi.
#+begin_quote
Because I am unable to personally test this module, help to improve this module
would be greatly appreciated! Especially where performance is concerned.
#+end_quote
** Module Flags
This module provides no flags.
** Plugins
+ [[https://github.com/tumashu/pyim][pyim]] (unless =+wubi=)
+ [[https://github.com/zilongshanren/chinese-wbim][chinese-wbim]] (if =+wubi=)
+ [[https://github.com/cute-jumper/fcitx.el][fcitx]]
+ [[https://github.com/cute-jumper/ace-pinyin][ace-pinyin]]
+ [[https://github.com/coldnew/pangu-spacing][pangu-spacing]]
** Hacks
+ ~org-html-paragraph~ has been modified to join consecutive Chinese lines into
a single long line without wanted spaced (when exporting org-mode to html).
* TODO Prerequisites
* TODO Features
* TODO Configuration
* TODO Troubleshooting

View File

@@ -0,0 +1,50 @@
;;; 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))))

View File

@@ -0,0 +1,8 @@
;; -*- no-byte-compile: t; -*-
;;; input/chinese/packages.el
(package! pyim)
(package! fcitx)
(package! ace-pinyin)
(package! pangu-spacing)
(package! pyim)