Skip to content

chenyanming/kana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kana

https://melpa.org/packages/kana-badge.svg

Table of Contents

Description

Learn Japanese kana (仮名,五十音) in Emacs.

img/kana.gif

Install kana

Choose one of the following installation methods based on your needs:

melpa

It’s available on Melpa :

M-x package-install kana

ues-package

(use-package kana
  :quelpa
  (kana :repo "chenyanming/kana" :fetcher github))

Spacemacs

Add kana into dotspacemacs-additional-packages in init.el

dotspacemacs-additional-packages '(kana)

Restart Spacemacs.

Doom Emacs

Add the following line to package.el

(package! kana)

Run ./.emacs.d/bin/doom sync

Quick Start

M-x kana

or

M-x kana-jump

Notes: If you found the font is very small, it is because your default fontset is not configured correctly for charsets. You have two options:

  1. Setup the default fontset. I use the following configurations to setup charsets, and the font is Sarasa Mono SC font. Note that this will set all related charsets in Emacs.
    (set-fontset-font (frame-parameter nil 'font) 'cjk-misc (font-spec :family "Sarasa Mono SC"))
    (set-fontset-font (frame-parameter nil 'font) 'bopomofo (font-spec :family "Sarasa Mono SC"))
    (set-fontset-font (frame-parameter nil 'font) 'han (font-spec :family "Sarasa Mono SC"))
    (set-fontset-font (frame-parameter nil 'font) 'kana (font-spec :family "Sarasa Mono SC"))
        
  2. Add a new fontset, configure it with set-fontset-font and setq kana-fontset to it.

Keybindings

(defvar kana-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map "v" #'kana-validate)
    (define-key map "s" #'kana-say-question)
    (define-key map "p" #'kana-previous)
    (define-key map "n" #'kana-next)
    (define-key map "t" #'kana-toggle-kana)
    (define-key map "r" #'kana-toggle-random)
    (define-key map "l" #'kana-loop-toggle)
    (define-key map "]" #'kana-loop-inc)
    (define-key map "[" #'kana-loop-dec)
    (define-key map "a" #'kana-first)
    (define-key map "j" #'kana-jump)
    (define-key map "q" #'kana-quit)
    (define-key map "d" #'kana-details)
    map)
  "Keymap for `kana-mode'.")

Features

Show the corresponding romaji and hiragana (平仮名) or katakana (片仮名)

M-x kana-validate

Say the kana

M-x kana-say-question

Currently, only mac is supported.

Toggle between hiragana (平仮名) and katakana (片仮名)

M-x kana-toggle-kana

Toggle between in random or in sequence

M-x kana-toggle-random

Toggle between loop mode or normal mode

M-x kana-loop-toggle

Increase or decrease the repeat timer in loop mode

M-x kana-loop-inc
M-x kana-loop-dec

First, Next or Previous kana

M-x kana-first
M-x kana-next
M-x kana-previous

Jump to the kana from list

M-x kana-jump

Show kana details

M-x kana-details
  1. Show stroke order using svg files provided by kanji-mode (if available). You can install kanji-mode via melpa.
  2. Show the help links (Wikipedia, Jisho, and Weblio) whose keybindings inherits from shr-map.
  3. *kana-details* will be automatically updated when *kana* updates.

img/kana-details.gif

Quit kana

M-x kana-quit

Mouse click on the kana

Jump to the corresponding Wikipedia page.

About

Learn Japanese kana (仮名,五十音) in emacs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published