Last active
March 22, 2023 06:42
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#===========================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