LoginSignup
94
78

More than 5 years have passed since last update.

zshのctrl+なショートカット

Posted at

viモードがどうしてもダメなので調べた
ctrl+アルファベットのみ
以下を参照のこと

$ zsh --version
zsh 5.0.0 (x86_64-unknown-linux-gnu)
$ bindkey -L | less

todo

Macだとどうなのか。

移動系

  • ctrl+a 先頭に移動
  • ctrl+b 一文字戻る
  • ctrl+e 末尾に移動
  • ctrl+f 一文字進む

削除/編集系

  • clrl+g 現在のコマンド入力を破棄して一行進む(send-break)
  • ctrl+h カーソル直前の一文字を削除
  • ctrl+k カーソル以下を削除
  • ctrl+t カーソル下の文字を一つ左の文字と入れ替え(transpose-chars)
  • ctrl+u コマンド入力の全削除(kill-whole-line)
  • ctrl+w カーソルより手前を削除

履歴系

  • ctrl+n コマンド履歴を一つ進む
  • ctrl+o 現在のコマンドを実行し、コマンド履歴を一つ進む(accept-line-and-down-history)
  • ctrl+p コマンド履歴を一つ戻る
  • ctrl+r コマンド履歴の後方検索(history-incremental-search-backward)
  • ctrl+s コマンド履歴の前方検索(history-incremental-search-forward)

その他

  • ctrl+i (アスタリスクの?)拡張/キーワード補完の実施(expand-or-complete)
  • ctrl+j 実行(accept-line)
  • ctrl+l 画面のclear(clear-screen)
  • ctrl+m 実行(accept-line)
  • ctrl+q 現在のコマンドをスタックへpushしコマンドラインをクリア(push-line)
$ git commit -m "HOGE: hogehogehoge hogehoge hoge." # ←git add忘れた! [ctrl+q]でcommitコマンドをスタックへ!
$ git add fugafuga # [ctrl+j] or [ctrl+m] or [enter]して実行!
$ git commit -m "HOGE: hogehogehoge hogehoge hoge." # ←スタックからコマンドが自動で復帰!

よくわからないもの

  • ctrl+d ターミナルを閉じる、でいいのか?(delete-char-or-list)
  • ctrl+v 貼り付け的な? 貼り付け出来ないけど(quoted-insert)
94
78
2

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
94
78