个人 Mac shell 配置

.zshrc 文件内容如下

# Path to your oh-my-zsh installation.
export ZSH="/Users/mechen/.oh-my-zsh"

# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
# ZSH_THEME="robbyrussell"
ZSH_THEME="agnoster"

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
    git
    zsh-autosuggestions      # 自动补全
    zsh-syntax-highlighting  # 支持高亮
    )

# Java ################################################################################################################
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME


# Android #############################################################################################################
ANDROID_HOME=/Users/mechen/Library/Android/sdk
PATH=$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH


# Flutter #############################################################################################################
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
PATH=/Users/mechen/devlib/flutter/bin:$PATH


# Python ##############################################################################################################
# 这里先将 Python3 加入到环境变量中,然后为 Python3 起一个别名
PATH=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/bin:$PATH
alias py3=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/bin/python3.7
# 为 Python2 起一个别名,方便调用
alias py2=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
# 查看 Python 安装路径的方法
# 1. 进入到 Python;
# 2. 运行下面代码;
#
# import sys
# sys.path
#

# go ##################################################################################################################
GOROOT=/usr/local/Cellar/go/1.14.5/libexec
export GOROOT
export GOPATH=/Users/mechen/Documents/cme/gowork
export GOBIN=$GOPATH/bin
PATH=$GOBIN:$GOROOT/bin:$PATH

# 显示(/隐藏)隐藏文件夹 ##################################################################################################
# 利用别名简化 显示(/隐藏)隐藏文件夹 的命令
# 彩蛋:快捷键 `Shift + Command + .`
alias showdir='defaults write com.apple.finder AppleShowAllFiles true & killall Finder'  # show all dir
alias hidedir='defaults write com.apple.finder AppleShowAllFiles false & killall Finder' # hide all dir


# 调节 dock 显示时的响应时间 ##############################################################################################
alias dock='defaults write com.apple.Dock autohide-delay -float 0 && killall Dock'    # 0 延迟
alias dock3='defaults write com.apple.Dock autohide-delay -float 0.3 && killall Dock' # 延迟 0.3 秒


# 关机/重启 #############################################################################################################
alias shutdown='sudo shutdown -h now' # 立刻关机
# sudo shutdown -h +10 # 十分钟后关机
# sudo shutdown -h 20:00 # 晚上八点关机
alias restart='sudo shutdown -r now' # 立刻重启

export PATH

source $ZSH/oh-my-zsh.sh

source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

# Created by mirror-config-china
export IOJS_ORG_MIRROR=https://npm.taobao.org/mirrors/iojs
export NODIST_IOJS_MIRROR=https://npm.taobao.org/mirrors/iojs
export NVM_IOJS_ORG_MIRROR=https://npm.taobao.org/mirrors/iojs
export NVMW_IOJS_ORG_MIRROR=https://npm.taobao.org/mirrors/iojs
export NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
export NODIST_NODE_MIRROR=https://npm.taobao.org/mirrors/node
export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
export NVMW_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
export NVMW_NPM_MIRROR=https://npm.taobao.org/mirrors/npm
# End of mirror-config-china

你可能感兴趣的:(个人 Mac shell 配置)