1. brew
安装brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. oh-my-zsh
先安装zsh,再安装oh-my-zsh,主题推荐使用ys
brew install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
配置zsh高亮和自动补全
brew install zsh-completions zsh-syntax-highlighting
echo 'source "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"' >> ~/.zshrc
echo 'fpath=(/usr/local/share/zsh-completions $fpath)' >> ~/.zshrc
rm ~/.zcompdump-*
source ~/.zshrc
3. 设置代理
下载代理工具,不会使用这个工具的自行查看文档。
命令行下设置代理,将一下命令拷贝到~/.zshrc
,并source ~/.zshrc
alias proxy='export http_proxy=http://127.0.0.1:1087;export https_proxy=http://127.0.0.1:1087;' # 设置代理
alias noproxy='unset https_proxy;unset http_proxy;' # 取消代理
git clone
之前先执行proxy
命令,相信你会有一种疏通了多年的老便秘的感觉。
小技巧
- 命令行下移动到回收站
function trash() {
if [ $# = 0 ]; then
echo -n '\nUsage:\n\ttrash <item> <item> ...\n\n'
else
for ITEM in $*; do
mv $ITEM ~/.Trash
done
fi
}
- 快捷进入上层目录
alias .='pwd'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
未完待续...
网友评论