kana
kana copied to clipboard
Learn Japanese kana (仮名,五十音) in emacs.
#+TITLE: kana
#+DATE: May 23, 2020
#+SINCE:
- Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#install-kana][Install kana]]
- [[#melpa][melpa]]
- [[#ues-package][ues-package]]
- [[#spacemacs][Spacemacs]]
- [[#doom-emacs][Doom Emacs]]
- [[#install-kana][Install kana]]
- [[#quick-start][Quick Start]]
- [[#keybindings][Keybindings]]
- [[#features][Features]]
- [[#show-the-corresponding-romaji-and-hiragana-平仮名-or-katakana-片仮名][Show the corresponding romaji and hiragana (平仮名) or katakana (片仮名)]]
- [[#say-the-kana][Say the kana]]
- [[#toggle-between-hiragana-平仮名-and-katakana-片仮名][Toggle between hiragana (平仮名) and katakana (片仮名)]]
- [[#toggle-between-in-random-or-in-sequence][Toggle between in random or in sequence]]
- [[#toggle-between-loop-mode-or-normal-mode][Toggle between loop mode or normal mode]]
- [[#increase-or-decrease-the-repeat-timer-in-loop-mode][Increase or decrease the repeat timer in loop mode]]
- [[#first-next-or-previous-kana][First, Next or Previous kana]]
- [[#jump-to-the-kana-from-list][Jump to the kana from list]]
- [[#show-kana-details][Show kana details]]
- [[#quit-kana][Quit kana]]
- [[#mouse-click-on-the-kana][Mouse click on the kana]]
- Description Learn Japanese kana (仮名,五十音) in Emacs.
[[file:img/kana.gif]]
** Install kana Choose one of the following installation methods based on your needs:
*** melpa It's available on [[https://melpa.org/][Melpa]] : #+BEGIN_SRC emacs-lisp M-x package-install kana #+END_SRC
*** ues-package #+BEGIN_SRC emacs-lisp (use-package kana :quelpa (kana :repo "chenyanming/kana" :fetcher github)) #+END_SRC
*** Spacemacs Add ~kana~ into ~dotspacemacs-additional-packages~ in ~init.el~ #+BEGIN_SRC emacs-lisp dotspacemacs-additional-packages '(kana) #+END_SRC
Restart Spacemacs.
*** Doom Emacs Add the following line to =package.el= #+BEGIN_SRC emacs-lisp (package! kana) #+END_SRC
Run =./.emacs.d/bin/doom sync=
- Quick Start
#+BEGIN_SRC emacs-lisp M-x kana #+END_SRC
or #+BEGIN_SRC emacs-lisp M-x kana-jump #+END_SRC
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:
- 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. #+BEGIN_SRC emacs-lisp (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")) #+END_SRC
- Add a new fontset, configure it with ~set-fontset-font~ and setq ~kana-fontset~ to it.
-
Keybindings #+BEGIN_SRC emacs-lisp (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'.") #+END_SRC
-
Features
** Show the corresponding romaji and hiragana (平仮名) or katakana (片仮名) #+BEGIN_SRC emacs-lisp M-x kana-validate #+END_SRC
** Say the kana #+BEGIN_SRC emacs-lisp M-x kana-say-question #+END_SRC
Currently, only mac is supported.
** Toggle between hiragana (平仮名) and katakana (片仮名) #+BEGIN_SRC emacs-lisp M-x kana-toggle-kana #+END_SRC
** Toggle between in random or in sequence #+BEGIN_SRC emacs-lisp M-x kana-toggle-random #+END_SRC
** Toggle between loop mode or normal mode #+BEGIN_SRC emacs-lisp M-x kana-loop-toggle #+END_SRC
** Increase or decrease the repeat timer in loop mode #+BEGIN_SRC emacs-lisp M-x kana-loop-inc M-x kana-loop-dec #+END_SRC
** First, Next or Previous kana #+BEGIN_SRC emacs-lisp M-x kana-first M-x kana-next M-x kana-previous #+END_SRC
** Jump to the kana from list #+BEGIN_SRC emacs-lisp M-x kana-jump #+END_SRC
** Show kana details #+BEGIN_SRC emacs-lisp M-x kana-details #+END_SRC
- Show stroke order using svg files provided by =kanji-mode= (if available). You can install =kanji-mode= via melpa.
- Show the help links (Wikipedia, Jisho, and Weblio) whose keybindings inherits from =shr-map=.
- =kana-details= will be automatically updated when =kana= updates.
[[file:img/kana-details.gif]]
** Quit kana #+BEGIN_SRC emacs-lisp M-x kana-quit #+END_SRC
** Mouse click on the kana Jump to the corresponding Wikipedia page.