Zsh shell-for-humans

1,918 views

Published on

ZSH, a shell for human lecture during Developers Conference 2013

Published in: Technology
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,918
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

Zsh shell-for-humans

  1. 1. zsh- a shell for humans @juandebravo
  2. 2. First goal: this prompt
  3. 3. • Is it a new shell? No… it’s been there since 1990! • It’s newer than bash? Well… less than a year (bash was born in 1989)! • why has it become popular? Due to ohmy-zsh
  4. 4. How to install # Debian/Ubuntu! > sudo apt-get install zsh! # Mac OS X! > brew info zsh! > brew install --disable-etcdir zsh
  5. 5. Set as default shell > chsh -s $(which zsh)
  6. 6. Nice autocompletion: cd
  7. 7. Nice autocompletion: git
  8. 8. Nice autocompletion: ssh
  9. 9. Globbing > mkdir connect{“-api”,"-backend","-commons"}! > ls -l **/foo.java! > ls **/*.py(.x)! > ls -l */**(Lk+100)! > vi **/README.md!
  10. 10. path expansion
  11. 11. path replacement
  12. 12. Spelling correction
  13. 13. Aliases # Normal alias! > alias ..=“cd ..”!
  14. 14. Aliases # Global alias! > alias -g gp=“| grep -i | grep -v grep”! > ps -ef gp redis! => ps -ef | grep -i redis | grep -v grep!
  15. 15. Aliases # Suffix alias! > alias -s md=“subl”! > README.md! => subl README.md!
  16. 16. Prompt PROMPT='$(machine_name) [%~]$(rvm_prompt_info)$(nvm_prompt_info)$ (python_prompt_info)$(hg_prompt_info)$(git_prompt_info)%{$reset_color%}! %{$fg[red]%}$(prompt_char) %{$reset_color%}' python_prompt_info() {! [ $VIRTUAL_ENV ] && echo " %{$fg[yellow]%}~`basename $VIRTUAL_ENV`% {$reset_color%}”! }
  17. 17. Prompt python_prompt_info() {! [ $VIRTUAL_ENV ] && echo " %{$fg[yellow]%}~`basename $VIRTUAL_ENV`% {$reset_color%}”! }
  18. 18. Right Prompt RPROMPT='$(battery_charge) $(current_time)'
  19. 19. Libraries on top of zsh > oh-my-zsh: https://github.com/robbyrussell/ oh-my-zsh! > Prezto: https://github.com/sorin-ionescu/ prezto!
  20. 20. More cool stuff http://fishshell.com/
  21. 21. Thanks! Juan de Bravo! @juandebravo! DEVCON 2013

×