Mac OS X Terminal shortcut

(转自stackoverflow,略改)

On Mac OS X 10.7 – the following keyboard shortcuts work by default.

  • Meta-Right to jump forward by a word
  • Meta-Left to jump backward by a word

I have observed that default emacs key-bindings for simple text navigation seem to work on bash shells. You can use

  • Meta-d to delete a word starting from the current cursor position
  • Ctrl-a to jump to start of the line
  • Ctrl-e to jump to end of the line
  • Ctrl-k to kill the line starting from the cursor position
  • Ctrl-y to paste text from the kill buffer
  • Ctrl-r to reverse search for commands you typed in the past from your history
  • Ctrl-s to forward search (works in zsh for me but not bash)
  • Ctrl-f to move forward by a char
  • Ctrl-b to move backward by a char

By Lu Jun

80后男,就职于软件行业。习于F*** GFW。人生48%时间陪同电子设备和互联网,美剧迷,高清视频狂热者,游戏菜鸟,长期谷粉,临时果粉,略知摄影。

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.