From 828a2586f155697040196b697cd6dc8011dd6c1b Mon Sep 17 00:00:00 2001 From: major Date: Sun, 4 Jun 2023 14:50:48 +0800 Subject: [PATCH] The initial version of the custom --- templates/zshrc.zsh-template | 22 ++++++++++++++++++++-- tools/install.sh | 5 +++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 7e1c7997c..5f7955cd8 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -8,7 +8,7 @@ export ZSH=$HOME/.oh-my-zsh # 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/ohmyzsh/ohmyzsh/wiki/Themes -ZSH_THEME="robbyrussell" +ZSH_THEME="powerlevel10k/powerlevel10k" # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load @@ -70,7 +70,12 @@ ZSH_THEME="robbyrussell" # 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) +plugins=( + git + autojump + zsh-autosuggestions + zsh-syntax-highlighting +) source $ZSH/oh-my-zsh.sh @@ -99,3 +104,16 @@ source $ZSH/oh-my-zsh.sh # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" +# Set/Unset proxy aliases + +# Set/Unset proxy aliases +HOSTIP=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*') +alias setp='export https_proxy="http://${HOSTIP}:7890"; export http_proxy="http://${HOSTIP}:7890"; export all_proxy="socks5://${HOSTIP}:7890"; export ALL_PROXY="socks5://${HOSTIP}:7890";' +alias unsetp='unset https_proxy; unset http_proxy; unset all_proxy; unset ALL_PROXY;' + +# Fzf +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +export FZF_DEFAULT_COMMAND='ag -i --hidden -l -g ""' +export FZF_DEFAULT_OPTS="--layout=reverse --preview '(bat --style=numbers --color=always {} || highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'" +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/snap/bin:$HOME/.fzf/bin + diff --git a/tools/install.sh b/tools/install.sh index fcfbcf778..70d980051 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -67,9 +67,10 @@ zdot="${ZDOTDIR:-$HOME}" ZSH="${ZSH:-$HOME/.oh-my-zsh}" # Default settings -REPO=${REPO:-ohmyzsh/ohmyzsh} +# REPO=${REPO:-ohmyzsh/ohmyzsh} +REPO=${REPO:-gmingj/ohmyzsh} REMOTE=${REMOTE:-https://github.com/${REPO}.git} -BRANCH=${BRANCH:-master} +BRANCH=${BRANCH:-ohmyzsh} # Other options CHSH=${CHSH:-yes}