You are viewing the documentation for the develop branch. The documentation for the release version is here .

Table of Contents

Japanese layer

Table of ContentsClose


1. Description

This Layer adds Japanese related packages.

1.1. Features:

  • evil-tutor-ja: Japanese Vimtutor adapted to Emacs+Evil and wrapped in a major mode
  • migemo: Japanese incremental search through dynamic pattern expansion
  • helm-migemo-mode: helm with migemo
  • avy-migemo: avy with migemo
  • ddskk: Simple Kana to Kanji conversion program (SKK)
  • japanese-holidays: calendar functions for the Japanese calendar
  • pangu-spacing: emacs minor-mode to add space between Japanese and English characters.
  • Join consecutive Japanese lines into a single long line without unwanted space when exporting org-mode to html.

2. Install

2.1. Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add japanese to the existing dotspacemacs-configuration-layers list in this file.

2.2. Configuration

For a basic configuration, add this to your ~/.spacemacs inside dotspacemacs/user-config:

2.2.1. evil-tutor-ja

By default, the variable evil-tutor-working-ja-directory is assigned ~/.emacs.d/.tutor-ja.

2.2.2. migemo

By default, the variable migemo-dictionary is assigned /usr/local/share/migemo/utf-8/migemo-dict in macOS, or /usr/local/cmigemo/utf-8/migemo-dict in Linux. If you want it to be another directory, you must re-set the variable. For example, if you install C/Migemo for Windows 64bit in the directory c:\app\cmigemo-default-win64, you should add:

(with-eval-after-load "migemo"
  (setq migemo-dictionary "c:/app/cmigemo-default-win64/dict/utf-8/migemo-dict"))

inside dotspacemacs/user-config, or

(japanese :variables
          migemo-dictionary "c:/app/cmigemo-default-win64/dict/utf-8/migemo-dict")

inside dotspacemacs-configuration-layers.

2.2.3. helm-with-migemo

If you want to use helm with migemo, you should add:

(with-eval-after-load "migemo"
  (helm-migemo-mode 1))

inside dotspacemacs/user-config, or

(japanese :variables
           helm-migemo-mode 1)

inside dotspacemacs-configuration-layers. Note that you may find in a package called helm-migemo.el in MELPA. However, this package is deprecated and not supported by helm.

2.2.4. avy-migemo

Note that avy-migemo in MELPA does not work currently, so you had better use a forked version instead.

By default, you can use avy-migemo for helm-mode. For ivy-mode, you should add:

(with-eval-after-load "migemo"
  (require 'avy-migemo-e.g.ivy)
  (require 'avy-migemo-e.g.swiper)
  (require 'avy-migemo-e.g.counsel))

inside dotspacemacs/user-config.

2.2.5. ddskk

You can write a configuration file =​~/.skk=. For detailed configuration, see some documents.

2.2.6. pangu-spacing

By default, pangu-spacing-mode is applied to text-mode. If you prefer the mode globally, add:

(global-pangu-spacing-mode 1)

inside dotspacemacs/user-config.

3. Key bindings

By default, C-x j toggles skk-mode.

Author: root

Created: 2021-09-29 Wed 20:45