Mac のターミナルに Shift-Right (Left) など認識させるメモ。
vim のショートカットキーに割り当てる目的。

ターミナルの設定する

ターミナルの環境設定 → 設定 → キーボード → +を押す

キー に右矢印, 修飾キーに shift, 文字列を下記のシェルへ送信を選択。

送信文字列

\033[1;2C

\033 は ESC キーを押すと出る。それ以外は直接入力する。

mac_term_s_right

ついでに Crtl-右矢印, Ctrl-左矢印についても値を変更。

control 右矢印 \033[1;5C
control 左矢印 \033[1;5D

いやーしかしこれはハマったなー。

参考文献

(b) Defaultで解釈するEsc文字列。

関連エントリー:

Teraterm + User Keys

localStorage でオプション設定の管理

ターミナル + Mac

Vim Tips & Plugins

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <img localsrc="" alt=""> <pre lang="" line="" escaped="" highlight="">