LoginSignup
7
5

More than 5 years have passed since last update.

Mac OS X のターミナルアプリで単語ごとにカーソルを移動する

Last updated at Posted at 2015-05-04

Macではターミナルアプリとして主にiTerm2を使ってます。

標準では1単語カーソルを移動する操作が、bashのデフォルト設定で、
ESC + b : 戻る
ESC + f : 進む
でできるようになってますが、この操作は使いづらいので、
option + → : 戻る
option + ← : 進む
で操作できるように変更。

iTerm2の場合

1. iTerms > Preference > Keys > + でショートカットの追加

2. ショートカットキーの設定

スクリーンショット 2015-04-29 午前0.51.36.png

上の画面で以下のように設定。

  • option + → : 戻る
    • Keyboard Shortcut: option + →(右カーソル)を打鍵
    • Action: Send Escape Sequence
    • Esc+: f
  • option + ← : 進む
    • Keyboard Shortcut: option + ←(左カーソル)を打鍵
    • Action: Send Escape Sequence
    • Esc+: f

3. Profileに定義されている重複するショートカットを削除

Profileに定義されているショートカットと重複するので、iTerms > Preference > Profile > Profile Shortcut Keys から削除

Tereminal.app(Mac標準)の場合

標準の状態で、option + →、option + ← 単語ごとに移動できるっぽいです。

リンク

7
5
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
5