Skip to content

@stefanpenner /gist:1507777 forked from wisq/gist:1507733

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Why I love zsh (and hate being forced to use bash)

Why I love zsh (and hate being forced to use bash)

  • Smarter completion:
    • cd tab completion -- directories only
    • bash can do this, but needs the bash-completion package, usually comes separately
    • zsh always comes with completions, why doesn't bash?
  • Completion correction / directory smarts
    • if dir1/x exists and dir2 exists, then "dir/x<TAB>" completes to dir1/x
    • if name1 is a file and name2 is a directory with files in it, "name/<TAB>" completes to "name2/"
  • Better ctrl-R behaviour
    • alerts you if your ctrl-R is failing
    • completes it right on the prompt line while showing you what you're searching for below
  • ctrl-R, enter a search term, ctrl-R repeatedly to see earlier matches, then hit backspace
    • bash deletes characters in your search term
    • zsh backtracks through the matches you rejected with ctrl-R, i.e. "backspaces" your ctrl-R's
  • autopushd option -- every "cd" is implicitly a silent "pushd" so you can "popd" to go back any time
  • better popd behaviour if a directory no longer exists
    • zsh will still pop the stack, so subsequent popd's work
    • bash refuses to popd
  • incremental history saving option
    • saves after every command
    • my .zsh_history is chronological and always up-to-date, even with multiple shells running
    • in any shell, I can "fc -R ~/.zsh_history" to reload in order to reuse the latest commands
  • optional coloured completion (like "ls")
  • autocd option -- "executing" a directory will "cd" to it instead
    • e.g. if I start typing /some/dir/file and decide I want to switch to /some/dir instead, I just enter "/some/dir"
  • `some-command`<TAB> -- expand output of some-command right in your shell line
  • can automatically show exit status of last command
    • always know when something failed, even if the output doesn't make it obvious
  • can automatically show "time" output if a command takes more than <n> seconds
  • usually has the latest UI improvements first
    • most of bash's features originally came from zsh
  • probably a lot more that I've forgotten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.