介绍
Mac下的 finder 不太好用,比起Windows下的 TotalCmd,相差十万八千里。有人推荐 Oh My Zsh,称Mac和Unix的优势在于 terminal,一试,果然。
安装
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
插件
插件很多,挑了几个用到的,其它以后慢慢用
plugins=(git sublime ruby osx autojump sudo web-search brew zsh-autosuggestions)
Alfred 集成
美化
具体看下面这两个链接:
iTerm2 + oh my zsh + solarized + Meslo powerline font
运行 GUI 应用
open -a Microsoft\ Word my.docx
修改 ~\.zshrc
添加 alias
alias -s docx='open -a Microsoft\ Word'
这样直接打文件名就可以打开了。
dmg 挂载
修改 ~\.zshrc
添加
alias -s dmg='hdiutil mount'
弹出
hdiutil unmount aaa
文件 tag
brew install tag
使用方法:
tag --list *
tag --set 蓝色 aaa.ext
tag --match 蓝色 *
tag --find 蓝色 *
tag --find 蓝色 Pictures/* | xargs -I{} cp {} Downloads
删除文件到回收站
brew install trash
使用
trash -l # list files in the trash
trash -e # empty the trash
修改 ~\.zshrc
添加
alias rm='trash'
搜索文件
mdfind -name homebrew
搜索引擎和网页
搜索用 Oh-My-Zsh 的 web-search 插件
google zsh
网页
Open http://fanzhen.org
剪贴板
ls | pbcopy
pbpaste > /tmp/somefile.txt
dotfiles
直接配置Mac工作环境,最好的办法,是直接clone dotfiles