From 408b5bb4ef58a79b89b1eef44a7f77d352676b73 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:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=EF=BC=9ATen=20Great=20Zsh=20?= =?UTF-8?q?Tips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- published/Ten Great Zsh Tips.md | 64 +++++++++++++++++++++++++++++++++ sources/Ten Great Zsh Tips.md | 52 --------------------------- 2 files changed, 64 insertions(+), 52 deletions(-) create mode 100644 published/Ten Great Zsh Tips.md delete mode 100644 sources/Ten Great Zsh Tips.md diff --git a/published/Ten Great Zsh Tips.md b/published/Ten Great Zsh Tips.md new file mode 100644 index 0000000000..ce7479df08 --- /dev/null +++ b/published/Ten Great Zsh Tips.md @@ -0,0 +1,64 @@ +十个最好的ZSH技巧 +================== + +1: 使用 ** 作为下级目录的通配符: + + $ ls **/*.pyc + foo.pyc bar.pyc lib/wibble.pyc + $ rm **/*.pyc + $ ls **/*.pyc + +2: 在文件筛选中使用匹配模式: + + $ ls *.(py|sh) + +3: 在文件筛选中使用修饰符,如:(@) 限制只匹配符号链接: + + $ ls -l *(@) + +4: 使用制表符TAB来自动完成,如man的时候: + + $ man zsh[TAB] + +5: 也可以用制表符来自动补全命令选项: + + $ python -[TAB] + +6: 或者在kill的时候自动完成: + + $ kill Dock[TAB] + +7: 在制表符自动补全时,可以使用光标键(上下左右等): + + $ man zsh[TAB][DOWN][RIGHT][LEFT][UP] + +8: 自动修改错误的输入: + + $ pythn -V + zsh: correct 'pythn' to 'python' [nyae]? y + Python 2.7.1 + +9: 使用**r**来重复上一条命令,可以带替换方式! + + $ touch foo.htm bar.htm + $ mv foo.htm foo.html + $ r foo=bar + mv bar.htm bar.html + +10: 高可定制性的提示符,使用RPROMPT居然可以设置提示符在右边! + + $ RPROMPT="%t" + +via: http://blog.goosoftware.co.uk/2012/05/22/ten-great-zsh-tips/ + + +本文由 [LCTT][] 原创翻译,[Linux中国][] 荣誉推出 + +译者:冰雨玉洁 校对:[wxy][] + +[LCTT]:https://github.com/LCTT/TranslateProject +[Linux中国]:http://linux.cn/portal.php +[译者ID]:http://linux.cn/space/译者ID +[wxy]:http://linux.cn/space/wxy + + diff --git a/sources/Ten Great Zsh Tips.md b/sources/Ten Great Zsh Tips.md deleted file mode 100644 index 70f1afee70..0000000000 --- a/sources/Ten Great Zsh Tips.md +++ /dev/null @@ -1,52 +0,0 @@ -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/