关于 zsh 自动补全系统

习惯了 VIM 的 neocomplcache 插件,寻思着这么霸气的功能,要是 ZSH 也有就好了,结果还真有。精简版和升级版。 ZSH 的牛逼不是吹的,不信你看: [ -f ~/.ssh/config ] && : ${(A)ssh_config_hosts:=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}} 这 A,这圈M,这小 f,特别是这傻逼冒号加井号再他么空格还带个星号,还不结束,他妈的还有大括号,还有那么多星星,搞毛啊搞,有完没完啊,神马鸟玩意啊啊啊...

2012-12-16 · wuan

超酷的 zsh-prompt

RT @http://www.miek.nl/blog/archives/2008/02/20/my_zsh_prompt_setup/index.html 不仅美观而且实用的 shell 提示符,除了常见的主机名、用户名、路径名等标识符,它还能 jobs 提醒 非0的 exit code 提示 路径名右对齐

2009-05-04 · wuan

zsh 独门秘笈 5

[Alt + .] 将依次扩展为已执行过的命令的某一个参数,例如 1$ find /usr/lib/perl/ -name "debconf" 2$ grep -r [Alt+.] [Alt+.][Alt+.] 第2条命令将自动扩展为: 2$ grep -r "debconf" /usr/lib/perl

2008-01-20 · wuan

zsh 独门秘笈 4

Alt-Q (Alt-q) Push the current buffer onto the buffer stack and clear the buffer. Next time the editor starts up, the buffer will be popped off the top of the buffer stack and loaded into the editing buffer. Alt-G (Alt-g) Pop the top line off the buffer stack and insert it at the cursor position. 例如在拷贝之前,意识到目标目录 foo 尚未创建, 1$ cp somefile /tmp/foo/ [光标] 我可以用 Alt-Q 缓存当前已输入的命令行,然后 2$ mkdir /tmp/foo 此命令执行之后,刚才保存的拷贝命令行自动出现 3$ cp somefile /tmp/foo/ [光标] Ctrl-X Ctrl-V Enter command...

2008-01-18 · wuan

zsh 独门秘笈 2

假设 /some/dir/slink/ 是 /other/dir 的软链接 当你在/some/dir/slink中想要快速切换到/other/dir中时(有这种情况) 只需要执行 $ cd -P .

2007-08-15 · wuan