LoginSignup
7
8

More than 3 years have passed since last update.

MacのSublimeText3における検索において「Enterで日本語が消える」「Tabで変換候補が選べない」ときの対応方法

Last updated at Posted at 2019-07-17
  • 環境
    • macOS Mojave バージョン10.14.5
    • Sublime Text Version 3.2.1 Build 3207

事象 : 検索で日本語を入力してEnterで文字が消える && Tabで変換候補が選べない

a.gif

こんな事象の解決方法がSublime Textの検索窓に日本語を入力する方法に丁寧に書かれていたのでやってみた。

Sublime Textの設定ファイル置き場にDefaultディレクトリを作成する

# 設定ファイル置き場に移動する
$ cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/

# Defaultディレクトリを作成する
$ mkdir Default

# できた!
$ ls -la | grep Default
drwxr-xr-x   2 mana  staff    64  7 17 21:34 Default
drwxr-xr-x   2 mana  staff    64 11  6  2016 Theme - Default

デフォルトのKey Bindingsを編集できるようにする

  1. [Preferences] > [Key Bindings]
  2. Default (OSX).sublime-keymapが表示される
  3. Command + Nで新しいファイルを開き、Default (OSX).sublime-keymapの内容をすべてコピペする
  4. 新しいファイルを作成したDefaultディレクトリにファイル名Default (OSX).sublime-keymapで保存する

デフォルトのKey Bindingsで余計なところをコメントアウトする

  1. [Preferences] > [Key Bindings]でDefault (OSX).sublime-keymapを表示する
    1. Defaultディレクトリに保存したDefault (OSX).sublime-keymapが表示される

日本語を入力してEnterで文字が消えないようにする

  1. Find panel key bindingsを検索する
  2. "keys": ["enter"]となっているところを{}ごと全部コメントアウトする(Command + /)
  3. Replace panel key bindingsIncremental 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":
// 省略
    },

    // 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":
// 省略
    },

    // 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":
// 省略

結果

a.gif

Tabで変換候補が選べるようにする

  1. "keys": ["tab"], "command": "insert_best_completion"を検索する
  2. "keys": ["tab"]となっているところを{}ごと全部コメントアウトする(Command + /)
// 省略
    // { "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 },
    //         { "key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\b[0-9]+$", "match_all": true },
    //     ]
    // },
    { "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":
// 省略

結果

a.gif

他にSublime Text でやりたいことをやる

Sublime Text でやりたいことをやるためのリンク集 - Qiita

7
8
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
8