Skip to content

Instantly share code, notes, and snippets.

@biscuitvile
Last active August 29, 2015 14:23
Show Gist options
  • Save biscuitvile/f13e03d779353ab65bb0 to your computer and use it in GitHub Desktop.
Save biscuitvile/f13e03d779353ab65bb0 to your computer and use it in GitHub Desktop.
Tips for zsh

Tips for zsh

  • Cycle backwards through your command history with Ctrl+p
  • Cycle forwards through your command history with Ctrl+n
  • Search backwards through your command history with Ctrl+r, search a term and hit Enter to run that command
  • Clear a whole line you've typed on the Ctrl+u, you can also use this to get out of searching your history
  • Jump to the beginning of a line of text with Ctrl+a
  • Jump to the end of a line of text with Ctrl+e
  • Cut text from the cursor position to the end of the line with Ctrl+k
  • Jump back a word with Escape+b
  • Jump forward a word with Escape+f
  • Note that if Escape is awkward to use for you Ctrl+[ will act as escape anywhere in your terminal, vim included
  • On a related note but entirley in the wrong guide, in vim Ctrl+c takes you back to normal mode. For some people this is more desirable than using the Escape key or using Ctrl+[ as escape just to get back to normal mode.
  • You can refer to the argument of the last command with !$, you can remember this easily as getting more 'bang for your buck', for example touch ~/Desktop/tmp.txt and then vim !$
  • You can rerun the last command with !!

Make it a point to really embrace searching your history for commands. Getting comfortable with this will speed you up tremendously, as usually the command you intend to type you have already typed before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment