zsh 独门秘笈 3

保存/查询/快速切换目录 (>= 4.1) 编辑~/.zshrc文件,添加以下内容: # 保存30个目录 DIRSTACKSIZE=30 # 只支持4.1版本以上的zsh if [[ -f ~/.zdirs ]] && [[ ${#dirstack[*]} -eq 0 ]]; then dirstack=( ${(uf)"$(< ~/.zdirs)"} ) #echo "Loaded the dirstack from disk" fi chpwd() { dirs -pl >! ~/.zdirs } # 定义ds函数 ds() { dirs -v | head -30 | sort -nr } 保存后退出,重新加载配置文件 $ . ~/.zshrc $ cd /some/dir1/aaa $ cd /some/dir2/bbb $ cd /some/dir3/ccc $ ds ds会列出以...

2007-08-15 · wuan