Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/khaphanspace/gonhanh.org/llms.txt

Use this file to discover all available pages before exploring further.

What is Auto-Restore?

When typing English words with Telex, some letters are interpreted as Vietnamese diacritics (s → sắc, w → ư, etc.). Auto-Restore automatically detects English patterns and restores the original text when you press Space.

How It Works

Comparison: macOS Telex vs Gõ Nhanh

InputmacOS TelexGõ Nhanh
text têt ❌text ✅
expect ễpct ❌expect ✅
perfect pềct ❌perfect ✅
with ưith ❌with ✅
tesla téla ❌tesla ✅
luxury lủuy ❌luxury ✅
case cáe ❌case ✅
wow ươ ❌wow ✅
No need to switch off Vietnamese mode! Just type normally and press Space.

Detection Patterns

Gõ Nhanh uses 8 intelligent patterns to detect English words:

Pattern 1: Modifier + Consonant

// English: Modifier (s,f,r,x,j) followed by consonant
textx + tEnglish
expectx + pEnglish
perfectf + cEnglish

// Vietnamese: Modifier + sonorant (m,n,ng,nh)
làm → f + mVietnamese
hồng → f + ngVietnamese

Pattern 2: W at Start + Consonant

// English: W initial before consonant
water, window, worldW + consonantEnglish

// Vietnamese: W before sonorant
ưng, ưn → W + sonorantVietnamese

Pattern 3: EI Vowel Pair

// English: "ei" combination
their, weirdei + modifierEnglish

// Vietnamese: No "ei" diphthong exists

Pattern 4: P Initial + AI

// English: P at word start (rare in Vietnamese)
pairP + ai + rEnglish
painP + ai + nEnglish

Pattern 5: W as Final

// English: W at word end
raw, law, sawvowel + WEnglish

// Vietnamese: W never appears at end

Pattern 6: F Initial

// English: F at word start
fix, file, focusF + ...English

// Vietnamese: Uses PH for /f/ sound
phở, phòng → PH (not F) → Vietnamese

Pattern 7: Modifier + K Ending

// English: K at word end with modifier
risk, disk, taskmodifier + KEnglish

// Vietnamese: K final only in ethnic minority words
Đắk Lắk → Đ + K (ethnic minority) → Vietnamese

Pattern 8: Double Vowel + Tone at End

// English: Doubled vowels like "oo"
looks, tookoo + kEnglish

// Vietnamese: Different pattern (aa → â)

Manual Restore with ESC

For words that Auto-Restore can’t detect, press ESC after typing:
Type: user
Result: úẻ
Press: ESC
Restored: user ✓
ESC restore only works immediately after typing. Once you move the cursor or type more text, it won’t work.

Limitations

Some English words create valid Vietnamese patterns and can’t be auto-detected:
WordTelex ResultReason
mixM + ĩ is valid
boxB + õ is valid
sixS + ĩ is valid
Solution: Press ESC to restore, or temporarily disable Vietnamese mode (⌘+Space).

Technical Implementation

Auto-Restore is implemented in the core engine:
/// English detection patterns
fn is_likely_english(buffer: &Buffer) -> bool {
    // Pattern 1: Modifier + consonant (not sonorant)
    if has_modifier_before_consonant(buffer) {
        return true;
    }
    
    // Pattern 2: W initial + consonant
    if starts_with_w_consonant(buffer) {
        return true;
    }
    
    // ... 6 more patterns
    
    false
}

Examples

Input          Intermediate    After Space
───────────────────────────────────────────
text           têt             text ✓
expect         ễpct            expect ✓
perfect        pềct            perfect ✓
with           ưith            with ✓
push           púh             push ✓
sort           ót              sort ✓
case           cáe             case ✓
wow            ươ              wow ✓
tesla          téla            tesla ✓
luxury         lủuy            luxury ✓
Input    Result    Reason              Solution
──────────────────────────────────────────────────
mix      mĩ        Valid Vietnamese    Press ESC
box      bõ        Valid Vietnamese    Press ESC
six      sĩ        Valid Vietnamese    Press ESC
fix      fĩ        Valid Vietnamese    Press ESC

Configuration

Auto-Restore is always enabled and cannot be disabled. This is by design to provide a seamless bilingual typing experience.
If you prefer to disable Vietnamese input entirely for certain apps, use Per-App Mode instead. See Smart Switching.

Comparison with Other IMEs

FeatureGõ NhanhmacOS TelexUniKeyOpenKey
Auto-Restore English
ESC to Restore
Pattern Detection8 typesN/ABasicBasic
Dictionary Lookup

FAQ

Because “mĩ” (M + ĩ) is a valid Vietnamese syllable. Gõ Nhanh cannot distinguish intent without context. Press ESC to restore manually.
No, the English dictionary is built into the engine. However, the 8 pattern-based rules catch most common words automatically.
Yes, Auto-Restore works with both Telex and VNI input methods.
Proper nouns follow the same rules. If they match an English pattern, they’ll be restored. Use ESC for ambiguous cases.

Input Methods

Learn about Telex and VNI

Smart Switching

Per-app Vietnamese mode