このBlogは移転しました。今後は aish.dev を御覧ください。

OS Xの Vim で IME 制御

Vimで挿入モードから抜ける時に英数入力に切り替える を参考に、KeyRemap4MacBook を使って、ESCを押したらIMEを抜けるように設定。元のままだと、Ctrl+[ で抜けた時に効果が無いようだったので、private.xml ファイルに設定を追加した。

<?xml version="1.0"?>
<root>
  <list>
    <item>
      <name>LeaveInsMode with EISUU(Terminal)</name>
      <identifier>private.app_terminal_esc_with_eisuu</identifier>
      <only>TERMINAL</only>
      <autogen>--KeyToKey-- KeyCode::ESCAPE, KeyCode::ESCAPE, KeyCode::JIS_EISUU</autogen>
      <autogen>--KeyToKey-- KeyCode::C, VK_CONTROL, KeyCode::C, VK_CONTROL, KeyCode::JIS_EISUU</autogen>
      <autogen>--KeyToKey-- KeyCode::BRACKET_LEFT, VK_CONTROL, KeyCode::JIS_EISUU, KeyCode::ESCAPE</autogen>
     </item>
  </list>
</root>