From 8053724f6f881902c7fa5ed5779594a0eb343620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E5=AE=87?= Date: Sat, 21 Sep 2013 11:36:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/Ten Great Zsh Tips.md | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/Ten Great Zsh Tips.md diff --git a/sources/Ten Great Zsh Tips.md b/sources/Ten Great Zsh Tips.md new file mode 100644 index 0000000000..70f1afee70 --- /dev/null +++ b/sources/Ten Great Zsh Tips.md @@ -0,0 +1,52 @@ +Ten Great Zsh Tips +================== + +1: Use ** as a wildcard to descend into directories: + + $ ls **/*.pyc + foo.pyc bar.pyc lib/wibble.pyc + $ rm **/*.pyc + $ ls **/*.pyc + +2: Use patterns in file globs: + + $ ls *.(py|sh) + +3: Use glob modifiers, e.g. (@) restricts glob to matching symlinks + + $ ls -l *(@) + +4: Use tab completion everywhere! e.g. using man… + + $ man zsh[TAB] + +5: …for completing command options… + + $ python -[TAB] + +6: …for kill + + $ kill Dock[TAB] + +7: Navigate the tab completion options with your cursor keys + + $ man zsh[TAB][DOWN][RIGHT][LEFT][UP] + +8: Auto-correct your typos + + $ pythn -V + zsh: correct 'pythn' to 'python' [nyae]? y + Python 2.7.1 + +9: Use r to repeat the last command – with substitutions! + + $ touch foo.htm bar.htm + $ mv foo.htm foo.html + $ r foo=bar + mv bar.htm bar.html + +10: Highly customisable prompt, including RPROMPT to set a prompt on the right hand side + + $ RPROMPT="%t" + +via: http://blog.goosoftware.co.uk/2012/05/22/ten-great-zsh-tips/