Skip to content

Instantly share code, notes, and snippets.

@ACupofAir
Last active March 22, 2023 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ACupofAir/2781f8d3f26051daf3cd74f701beb33f to your computer and use it in GitHub Desktop.
Save ACupofAir/2781f8d3f26051daf3cd74f701beb33f to your computer and use it in GitHub Desktop.
bash or zsh config for directory-stack(`dv` show dirs, `pd $index` go to the corresponding dir
#===========================Alias============================
# write by junw
alias dv="dirs -v"
alias pd=jump_to_dir
#=========================Function===========================
function jump_to_dir() {
if [ "$1" != "" ] ;then
pushd -$1 &> /dev/null
echo -e "${RED}Jump${NOCOLOR} to ${GREEN}${PWD}${NOCOLOR}"
else
echo "switch stack top"
pushd &> /dev/null
#pushd &> /dev/null
fi
}
#==========================Export===========================
# Function to open proxy
pxon() {
export http_proxy=http://child-prc.intel.com:913
export https_proxy=http://child-prc.intel.com:913
}
# Function to open proxy
pxoff() {
export http_proxy=""
export https_proxy=""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment