homebrew速度真的慢,安装完后直接换源 ```shell cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"\n git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git git pull cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git git pull ``` ## mac 11.5 安装powerlevel9k ``` brew tap homebrew/cask-fonts brew install --cask font-sauce-code-pro-nerd-font brew tap sambadevi/powerlevel9k brew install powerlevel9k brew install --cask font-menlo-for-powerline echo "source /usr/local/opt/powerlevel9k/powerlevel9k.zsh-theme" >> ~/.zshrc git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes #ZSH_THEME="robbyrussell" ZSH_THEME="powerlevel9k/powerlevel9k" # P9k 使用的模式 #POWERLEVEL9K_MODE='nerdfont-complete' # 显示在左边的提示元素(分段位于括号中并以空格隔开) POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir dir_writable vcs vi_mode) # 显示在右边的提示元素(分段) #POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status) # 左侧提示符是否显示两行(光标显示在下一行) #POWERLEVEL9K_PROMPT_ON_NEWLINE=true # Set P9KGT background color, either 'light' or 'dark' (this should match the GNOME Terminal's theme). POWERLEVEL9K_CONTEXT_TEMPLATE='%n' P9KGT_BACKGROUND='dark' if [[ $P9KGT_BACKGROUND != 'light' ]] && [[ $P9KGT_BACKGROUND != 'dark' ]] then P9KGT_ERROR=true echo "P9KGT error: variable 'P9KGT_BACKGROUND' should be either 'light' or 'dark'" fi # Set P9KGT color scheme, either 'light', 'dark' or 'bright' (choose by preference). P9KGT_COLORS='light' if [[ $P9KGT_COLORS != 'light' ]] && [[ $P9KGT_COLORS != 'dark' ]] && [[ $P9KGT_COLORS != 'bright' ]] then P9KGT_ERROR=true echo "P9KGT error: variable 'P9KGT_COLORS' should be either 'light', 'dark' or 'bright'" fi # Set P9KGT fonts mode, either 'default', 'awesome-fontconfig', 'awesome-mapped-fontconfig', 'awesome-patched', 'nerdfont-complete' or 'nerdfont-fontconfig'. # https://github.com/bhilburn/powerlevel9k/wiki/About-Fonts if [[ $P9KGT_ERROR != true ]] then # Set P9KGT background color if [[ $P9KGT_BACKGROUND == 'light' ]] then # https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt#light-color-theme POWERLEVEL9K_COLOR_SCHEME='light' P9KGT_TERMINAL_BACKGROUND=231 elif [[ $P9KGT_BACKGROUND == 'dark' ]] then POWERLEVEL9K_COLOR_SCHEME='dark' P9KGT_TERMINAL_BACKGROUND=236 fi # Set P9KGT foreground colors if [[ $P9KGT_COLORS == 'light' ]] then P9KGT_RED=009 P9KGT_GREEN=010 P9KGT_YELLOW=011 P9KGT_BLUE=012 elif [[ $P9KGT_COLORS == 'dark' ]] then P9KGT_RED=001 P9KGT_GREEN=002 P9KGT_YELLOW=003 P9KGT_BLUE=004 elif [[ $P9KGT_COLORS == 'bright' ]] then P9KGT_RED=196 #P9KGT_GREEN=148 P9KGT_GREEN=154 P9KGT_YELLOW=220 P9KGT_BLUE=075 fi # Customize prompt # https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt#adding-newline-before-each-prompt POWERLEVEL9K_PROMPT_ADD_NEWLINE=true # https://github.com/bhilburn/powerlevel9k/tree/next#customizing-prompt-segments POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir_writable dir vcs) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs) # Set 'context' segment colors # https://github.com/bhilburn/powerlevel9k/blob/next/segments/context/README.md POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND=$P9KGT_YELLOW POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=$P9KGT_YELLOW POWERLEVEL9K_CONTEXT_SUDO_FOREGROUND=$P9KGT_YELLOW POWERLEVEL9K_CONTEXT_REMOTE_FOREGROUND=$P9KGT_YELLOW POWERLEVEL9K_CONTEXT_REMOTE_SUDO_FOREGROUND=$P9KGT_YELLOW POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_CONTEXT_SUDO_BACKGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_CONTEXT_REMOTE_BACKGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_CONTEXT_REMOTE_SUDO_BACKGROUND=$P9KGT_TERMINAL_BACKGROUND # Set 'dir_writable' segment colors # https://github.com/bhilburn/powerlevel9k/blob/next/segments/dir_writable/README.md POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND=$P9KGT_YELLOW POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_BACKGROUND=$P9KGT_RED # Set 'dir' segment colors # https://github.com/bhilburn/powerlevel9k/blob/next/segments/dir/README.md POWERLEVEL9K_DIR_DEFAULT_FOREGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_DIR_HOME_FOREGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_DIR_ETC_FOREGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_DIR_DEFAULT_BACKGROUND=$P9KGT_BLUE POWERLEVEL9K_DIR_HOME_BACKGROUND=$P9KGT_BLUE POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND=$P9KGT_BLUE POWERLEVEL9K_DIR_ETC_BACKGROUND=$P9KGT_BLUE # Set 'vcs' segment colors # https://github.com/bhilburn/powerlevel9k/blob/next/segments/vcs/README.md POWERLEVEL9K_VCS_CLEAN_FOREGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_VCS_CLOBBERED_FOREGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_VCS_CLEAN_BACKGROUND=$P9KGT_GREEN POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=$P9KGT_YELLOW POWERLEVEL9K_VCS_CLOBBERED_BACKGROUND=$P9KGT_RED POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=$P9KGT_GREEN # Set 'status' segment colors # https://github.com/bhilburn/powerlevel9k/blob/next/segments/status/README.md POWERLEVEL9K_STATUS_CROSS=true POWERLEVEL9K_STATUS_OK_FOREGROUND=$P9KGT_GREEN POWERLEVEL9K_STATUS_ERROR_FOREGROUND=$P9KGT_RED POWERLEVEL9K_STATUS_OK_BACKGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_STATUS_ERROR_BACKGROUND=$P9KGT_TERMINAL_BACKGROUND # Set 'root_indicator' segment colors # https://github.com/bhilburn/powerlevel9k/blob/next/segments/root_indicator/README.md POWERLEVEL9K_ROOT_INDICATOR_FOREGROUND=$P9KGT_YELLOW POWERLEVEL9K_ROOT_INDICATOR_BACKGROUND=$P9KGT_TERMINAL_BACKGROUND # Set 'background_jobs' segment colors # https://github.com/bhilburn/powerlevel9k/blob/next/segments/background_jobs/README.md POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=$P9KGT_TERMINAL_BACKGROUND POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=$P9KGT_YELLOW fi # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load # a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ # If set to an empty array, this variable will have no effect. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" # Uncomment the following line to use hyphen-insensitive completion. # Case-sensitive completion must be off. _ and - will be interchangeable. # HYPHEN_INSENSITIVE="true" # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" # Uncomment the following line to automatically update without prompting. # DISABLE_UPDATE_PROMPT="true" # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 # Uncomment the following line if pasting URLs and other text is messed up. # DISABLE_MAGIC_FUNCTIONS=true # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" # Uncomment the following line to disable auto-setting terminal title. # DISABLE_AUTO_TITLE="true" # Uncomment the following line to enable command auto-correction. # ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. # COMPLETION_WAITING_DOTS="true" # Uncomment the following line if you want to disable marking untracked files # under VCS as dirty. This makes repository status check for large repositories # much, much faster. # DISABLE_UNTRACKED_FILES_DIRTY="true" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. # You can set one of the optional three formats: # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" # or set a custom format using the strftime function format specifications, # see 'man strftime' for details. # HIST_STAMPS="mm/dd/yyyy" # Would you like to use another custom folder than $ZSH/custom? # ZSH_CUSTOM=/path/to/new-custom-folder # Which plugins would you like to load? # Standard plugins can be found in ~/.oh-my-zsh/plugins/* # Custom plugins may be added to ~/.oh-my-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) source $ZSH/oh-my-zsh.sh # User configuration # export MANPATH="/usr/local/man:$MANPATH" # You may need to manually set your language environment # export LANG=en_US.UTF-8 # Preferred editor for local and remote sessions # if [[ -n $SSH_CONNECTION ]]; then # export EDITOR='vim' # else # export EDITOR='mvim' # fi # Compilation flags # export ARCHFLAGS="-arch x86_64" # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. # For a full list of active aliases, run `alias`. # # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" #source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # nerd-font active POWERLEVEL9K_MODE='nerdfont-complete' ZSH_THEME="powerlevel9k/powerlevel9k" POWERLEVEL9K_COLOR_SCHEME='dark' POWERLEVEL9K_PROMPT_ON_NEWLINE=true POWERLEVEL9K_RPROMPT_ON_NEWLINE=true POWERLEVEL9K_MODE='awesome-fontconfig' POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon dir vcs) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status) POWERLEVEL9K_OS_ICON_BACKGROUND=$P9KGT_GREEN POWERLEVEL9K_OS_ICON_FOREGROUND="black" POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="black" #POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 #POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle" POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND=$P9KGT_BLUE POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="black" POWERLEVEL9K_DIR_HOME_BACKGROUND=$P9KGT_GREEN POWERLEVEL9K_DIR_HOME_FOREGROUND="black" POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND=$P9KGT_BLUE POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="black" POWERLEVEL9K_NODE_VERSION_BACKGROUND="black" POWERLEVEL9K_NODE_VERSION_FOREGROUND="007" POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_COLOR="002" POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND="black" POWERLEVEL9K_LOAD_WARNING_BACKGROUND="black" POWERLEVEL9K_LOAD_NORMAL_BACKGROUND="black" POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND="007" POWERLEVEL9K_LOAD_WARNING_FOREGROUND="007" POWERLEVEL9K_LOAD_NORMAL_FOREGROUND="007" POWERLEVEL9K_LOAD_CRITICAL_VISUAL_IDENTIFIER_COLOR="red" POWERLEVEL9K_LOAD_WARNING_VISUAL_IDENTIFIER_COLOR="yellow" POWERLEVEL9K_LOAD_NORMAL_VISUAL_IDENTIFIER_COLOR="green" POWERLEVEL9K_RAM_BACKGROUND="black" POWERLEVEL9K_RAM_FOREGROUND="007" POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_COLOR="001" POWERLEVEL9K_RAM_ELEMENTS=(ram_free) POWERLEVEL9K_TIME_BACKGROUND="black" POWERLEVEL9K_TIME_FOREGROUND="007" POWERLEVEL9K_TIME_FORMAT="%D{%H:%M} %F{003}\uF017" #POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=('context' 'dir' 'vcs') POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=('load' 'ram_joined' 'time') POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=$'\uE0B0' POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=$'\uE0B2' POWERLEVEL9K_VCS_CLEAN_FOREGROUND='005' POWERLEVEL9K_VCS_CLEAN_BACKGROUND=$P9KGT_GREEN POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND='015' POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=$P9KGT_RED POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='015' POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=$P9KGT_BLUE POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="%f" local user_symbol="$" if [[ $(print -P "%#") =~ "#" ]]; then user_symbol = "#" fi POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%{%B%F{black}%K{$P9KGT_GREEN}%} $user_symbol%{%b%f%k%F{$P9KGT_GREEN}%} %{%f%}" setopt PROMPT_SUBST export PROMPT='%F{grey}%n%f %F{cyan}%~%f %F{green}$(parse_git_branch)%f %F{normal}$%f ' alias cdebug="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files --allow-file-access-frome-files --disable-web-security --auto-open-devtools-for-tabs --user-data-dir=~/.chromedata" source /Users/ankye/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh alias my.http='export all_proxy=socks5://127.0.0.1:1086;http_proxy=http://127.0.0.1:1087;https_proxy=http://127.0.0.1:1087' alias my.un='unset all_proxy' alias myvps='curl -l -s https://stock.bwg.net |grep -E "<td "|grep -v "<a"|sed "s/<[^>]*>//g"|sed "s/^[ \t]*//g"|sed "s/[ \t]$//g" |head -n 20|sed "2,9d"|sed "4,11d"' alias gc='git clone' alias gp='git pull' alias my.ip="sh $HOME/.ip.sh" alias gs='git reset --hard;git pull' ### 设置go环境变量 export GOPATH=$HOME/go export GOROOT=/usr/local/opt/go/libexec export PATH=$PATH:$GOPATH/bin:$GOROOT/bin export PATH=$PATH:/usr/local/Cellar/curl-openssl/7.73.0/bin export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home ### 可选go proxy export GOPROXY="https://goproxy.io" #export GOPROXY="https://mirrors.aliyun.com/goproxy/" ### 设置vscode终端命令,使用vscode status查看检测 alias vscode="/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code" test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" #source ~/.bash_profile export ANDROID_NDK=~/Library/Android/sdk/ndk/r14b export NDK_ROOT=$ANDROID_NDK export ANDROID_SDK=~/Library/Android/sdk/ #export PATH=$PATH:$ANDROID_NDK export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$PATH:/Users/ankye/Library/Android/sdk/platform-tools/ export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools export PATH=$PATH:$ANDROID_HOME/platform-tools alias dg='open -a "/Applications/Google Chrome.app" --args --disable-web-security --allow-file-access-frome-files --allow-file-access-from-files --allow-file-access-from-files --auto-open-devtools-for-tabs --user-data-dir="/Users/ankye/.chromedata"' export PATH="/usr/local/opt/apr-util/bin:$PATH" export PATH="/usr/local/opt/apr/bin:$PATH" export PATH="/Users/ankye/work/flutter/bin:$PATH" export PATH="$PATH:$HOME/.composer/vendor/bin" export PATH=$PATH:$ALIENSBOOT_HOME/bin export PATH="/usr/local/sbin:$PATH" source ~/.bash_profile source /usr/local/opt/powerlevel9k/powerlevel9k.zsh-theme ``` MYSQL数据处理sql Leanote 支持的markdown语法
No Leanote account? Sign up now.