Sublime Text 3 日本語で検索すると文字が消える不具合を解決する

  • 公開日:2015/12/26
この記事は最終更新日から7年以上が経過しています。

Mac OS XのSublime Text 3で日本語を検索したいとき、入力してEnterキーを押すと入力した文字が消えてうまく検索できない。という不具合にずっと困っていました。(Windowsは問題ないらしい)

調べてみたら、解決方法が見つかったのでメモ。

Default (OSX).sublime-keymapを編集可能にする

これが必要なのはSublime Text 3で、Sublime Text 2では不要らしい。

Sublime Text 3ではDefault (OSX).sublime-keymapを編集可能にする必要があります。

  1. [基本設定] > [キーバインド-標準] でDefault (OSX).sublime-keymapを開きます。
  2. 内容を全てコピーして、新規ファイルに貼り付けます。
  3. 2の新規ファイルをDefault (OSX).sublime-keymapとして以下の場所に保存します。
     ~/Library/Application Support/Sublime Text 3/Packages/Default
     ※Defaultフォルダがない場合は作成します。

次からはこのDefault (OSX).sublime-keymapを編集していきます。

該当箇所をコメントアウト

3箇所をコメントアウトします。以下のコメントがある行を探し、その下3行をコメントアウトします。

  • Find panel key bindings
  • Replace panel key bindings
  • Incremental find panel key bindings
    // Find panel key bindings
/*
     { "keys": ["enter"], "command": "find_next", "context":
        [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
    },
*/
    { "keys": ["shift+enter"], "command": "find_prev", "context":
        [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
    },
    { "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
         "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"}]
    },
*/
    { "keys": ["shift+enter"], "command": "find_prev", "context":
        [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
    },
    { "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
        "context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
    },
    { "keys": ["ctrl+alt+enter"], "command": "replace_all", "args": {"close_panel": true},
         "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"}]
    },
*/
    { "keys": ["shift+enter"], "command": "find_prev", "context":
        [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
    },
    { "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
        "context": [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
    },

参考サイト

Sublime Textの検索窓に日本語を入力する方法.md