← XeFM crftwr/xefm on GitHub · craftware

Migemo Search Feature

Overview

Migemo lets incremental search find Japanese names by typing romaji — no IME needed. Typing kensaku also matches 検索, けんさく, ケンサク, ケンサク, and kensaku; typing mudai finds 無題.png, and daunro-do finds ダウンロード (typed hiragana finds katakana too). It is on by default and needs no mode or switch: plain matching always still applies, Migemo only ever adds matches.

Where it works

Migemo applies to every incremental-search surface:

How patterns behave

AZIK

If you type Japanese with AZIK — the extended romaji scheme where a second stroke below the vowel spells the kana plus “n” — set:

MIGEMO_ROMAJI_TABLE = 'azik'

Search then also understands the spellings AZIK trained your fingers on:

You type You get Rule
kz kk kj kd kl かん きん くん けん こん 撥音拡張 (sn さん on the あ段)
kq kh kw kp かい くう けい こう 二重母音拡張
xa ca しゃ ちゃ シャ行・チャ行互換キー
kga kgp きゃ きょう 拗音のY互換キー
; : q っ ー ん  
kf nf き ぬ 同指打鍵互換キー
kt mn ds こと もの です 特殊拡張

So kdsaku finds 検索, kzxa finds 感謝, and se;kw finds 設計.

AZIK is added alongside plain romaji, never in place of it: the handful of keys the two spell differently (ca is か in plain romaji and ちゃ in AZIK) match either reading, so turning this on cannot make a search you already use stop working.

Configuration

# In ~/.xefm/config.py
MIGEMO_SEARCH = True   # Add Migemo (romaji -> Japanese) matches to incremental search
MIGEMO_MIN_LENGTH = 3  # Shortest pattern handed to Migemo
MIGEMO_ROMAJI_TABLE = 'default'  # 'default' or 'azik'

Set MIGEMO_SEARCH = False to turn the feature off — searches then behave exactly as before. Raise or lower MIGEMO_MIN_LENGTH to move the point where Migemo kicks in (1 sends even single characters through Migemo; expect a noticeable pause on the first keystroke).

The gate also decides how soon incremental search refuses a character that matches nothing. A romaji reading finds Japanese only once it reaches MIGEMO_MIN_LENGTH, so a shorter pattern is never treated as a dead end — unless the directory holds no Japanese name at all, where there is nothing for Migemo to find and the search stops on the first miss like any other.

Requirements

Migemo uses the pymigemo package, installed automatically with XeFM (its dictionary is bundled — about 1.4 MB, loaded lazily on first use). If the package is missing, searches quietly fall back to plain matching; nothing breaks.