1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【iTerm2】単語単位の移動や削除をする方法

Posted at

単語単位の移動

単語単位の移動はEsc + bEsc + yで可能ですが、連続で移動しようとするとbyが入力されます。
任意のキーかつ連続で移動できる設定方法を以下に記載します。

設定画面を開く

iTerm2を開いてcmd + ,Preferencesを開きます。
そしてPreferencesKeysを開きます。
image220427_003532.png

設定する

Keysの中のKey Bindingsを開き、右下の+をクリックします。
image220427_003907.png

Keyboard Shortcutに任意のキー、ActionSend Escape Sequenceを選択、Esc +bを入力し、OKをクリックします。
image220427_004414.png

すると、任意のキー(上記の例ではcmd + ←)で単語単位の移動ができるようになります。
Esc + fは上記のEsc +の箇所にyを入力することで設定可能です。

コマンドの先頭、末尾に移動する

コマンドの先頭、末尾に移動するにはデフォルトではctl + actl + eです。
これも単語移動と同様に設定することで任意のキーで実行できます。

Keyboard Shortcutに任意のキー、ActionSend Hex Codeを選択、入力欄に0x01を入力し、OKをクリックします。
image220427_010727.png

これで任意のキーでコマンドの先頭に移動できます。
ctl + eは上記の入力欄に0x05を入力することで設定可能です。

単語単位の削除

デフォルトではCtr + wで単語削除ができますが、以下のように設定することで任意のキーで単語単位の削除ができます。

設定方法

「設定画面を開く」までは移動と同様です。
Keyboard Shortcutに任意のキー、ActionSend Hex Codeを選択、入力欄に0x1b 0x08を入力し、OKをクリックします。
image220427_012849.png

上記の設定をすると任意のキーで単語単位の削除ができます。

1
1
0

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?