cover.png

Japanese Input in Sublime Text

I really like Sublime Text. Today, I like it even more. Thanks to a blog post by Uesugi Shu, this long-open bug regarding Japanese character input has a viable workaround!

The link is in Japanese; I’ve (roughly) translated the steps required to achieve the same result below:

  1. Open the Sublime Text keymap file. This is at ~/Library/Application Support/Sublime Text 3/Packages/Default/Default (OSX).sublime-keymap -- Sublime Text 3 didn’t let me edit the file in-place, so I had to use a different text editor.

  2. Find the following code blocks, and comment them out:

    // Find panel key bindings
    { "keys": ["enter"], "command": "find_next", "context":
        [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
    },
    
    // Replace panel key bindings
    { "keys": ["enter"], "command": "find_next", "context":
        [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
    },
    
    // Incremental find panel key bindings
    { "keys": ["enter"], "command": "hide_panel", "context":
        [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
    },
    
  3. (Optional) Comment out the following to fix kana-kanji conversion while typing regularly, as well:

    { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
    { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
        "context":
            [
                { "key": "setting.tab_completion", "operator": "equal", "operand": true }
            ]
    },
    
  4. Re-open Sublime Text!