mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-08-10 01:51:15 +10:00
Moving to Doom Emacs!
This commit is contained in:
@@ -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
|
||||
@@ -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))))
|
||||
@@ -0,0 +1,8 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; input/chinese/packages.el
|
||||
|
||||
(package! pyim)
|
||||
(package! fcitx)
|
||||
(package! ace-pinyin)
|
||||
(package! pangu-spacing)
|
||||
(package! pyim)
|
||||
@@ -0,0 +1,40 @@
|
||||
#+TITLE: input/japanese
|
||||
#+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 Japanese script.
|
||||
|
||||
#+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/emacs-jp/migemo][migemo]]
|
||||
+ [[https://github.com/momomo5717/avy-migemo][avy-migemo]]
|
||||
+ [[https://github.com/hsaito/ddskk][ddskk]]
|
||||
+ [[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
|
||||
@@ -0,0 +1,60 @@
|
||||
;;; input/japanese/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! migemo
|
||||
:after-call after-find-file pre-command-hook
|
||||
:init
|
||||
(setq search-default-regexp-mode nil
|
||||
migemo-options '("-q" "--emacs" "-i" "\a")
|
||||
migemo-user-dictionary nil
|
||||
migemo-regex-dictionary nil
|
||||
migemo-coding-system 'utf-8-unix
|
||||
migemo-directory (concat doom-etc-dir "migemo/")
|
||||
migemo-dictionary "/usr/local/share/migemo/utf-8/migemo-dict")
|
||||
:config
|
||||
(when (executable-find migemo-command)
|
||||
(migemo-init)
|
||||
|
||||
(use-package! avy-migemo
|
||||
:after avy
|
||||
:config (avy-migemo-mode 1))
|
||||
|
||||
(when (featurep! :completion helm)
|
||||
(after! helm (helm-migemo-mode +1)))))
|
||||
|
||||
|
||||
(use-package! pangu-spacing
|
||||
:hook (text-mode . pangu-spacing-mode)
|
||||
:init
|
||||
;; replacing `chinese-two-byte' by `japanese'
|
||||
(setq pangu-spacing-chinese-before-english-regexp
|
||||
"\\(?1:\\cj\\)\\(?2:[0-9A-Za-z]\\)"
|
||||
pangu-spacing-chinese-after-english-regexp
|
||||
"\\(?1:[0-9A-Za-z]\\)\\(?2:\\cj\\)"
|
||||
;; Always insert `real' space in text-mode including org-mode.
|
||||
pangu-spacing-real-insert-separtor t))
|
||||
|
||||
|
||||
(use-package! ddskk
|
||||
:general ("C-x j" #'skk-mode))
|
||||
|
||||
|
||||
;;
|
||||
;;; Hacks
|
||||
|
||||
(defadvice! +japanese--org-html-paragraph-a (args)
|
||||
"Join consecutive Japanese 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))))
|
||||
@@ -0,0 +1,5 @@
|
||||
;;; input/japanese/doctor.el -*- lexical-binding: t; -*-
|
||||
|
||||
(when (require 'migemo nil t)
|
||||
(unless (executable-find migemo-command)
|
||||
(warn! "Cannot find %S, migemo won't work" migemo-command)))
|
||||
@@ -0,0 +1,7 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; input/japanese/packages.el
|
||||
|
||||
(package! migemo)
|
||||
(package! avy-migemo)
|
||||
(package! ddskk)
|
||||
(package! pangu-spacing)
|
||||
Reference in New Issue
Block a user