More .zshrc modifications to match old .bash_profile.

This commit is contained in:
Jeff Geerling
2019-11-03 23:01:56 -06:00
parent 6d7d64277b
commit 43186ce5cb
+45 -58
View File
@@ -11,15 +11,18 @@ export CLICOLOR=1
export CLICOLOR_FORCE=1 export CLICOLOR_FORCE=1
# Nicer prompt. # Nicer prompt.
PS1="%F{green} %*%F %3~ %F{white}$ " export PS1="%F{green} %*%F %3~ %F{white}$ "
# Enable plugins.
plugins=(git brew history kubectl)
# Custom $PATH with extra locations. # Custom $PATH with extra locations.
#export PATH=/usr/local/bin:/usr/local/sbin:$HOME/bin:/usr/local/git/bin:$HOME/.composer/vendor/bin:$PATH export PATH=/usr/local/bin:/usr/local/sbin:$HOME/bin:/usr/local/git/bin:$HOME/.composer/vendor/bin:$PATH
# Include alias file (if present) containing aliases for ssh, etc. # Include alias file (if present) containing aliases for ssh, etc.
if [ -f ~/.bash_aliases ] if [ -f ~/.aliases ]
then then
source ~/.bash_aliases source ~/.aliases
fi fi
# Git aliases. # Git aliases.
@@ -36,71 +39,55 @@ zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}
# Git upstream branch syncer. # Git upstream branch syncer.
# Usage: gsync master (checks out master, pull upstream, push origin). # Usage: gsync master (checks out master, pull upstream, push origin).
#function gsync() { function gsync() {
# if [[ ! "$1" ]] ; then if [[ ! "$1" ]] ; then
# echo "You must supply a branch." echo "You must supply a branch."
# return 0 return 0
# fi fi
#
# BRANCHES=$(git branch --list $1) BRANCHES=$(git branch --list $1)
# if [ ! "$BRANCHES" ] ; then if [ ! "$BRANCHES" ] ; then
# echo "Branch $1 does not exist." echo "Branch $1 does not exist."
# return 0 return 0
# fi fi
#
# git checkout "$1" && \ git checkout "$1" && \
# git pull upstream "$1" && \ git pull upstream "$1" && \
# git push origin "$1" git push origin "$1"
#} }
# Tell homebrew to not autoupdate every single time I run it (just once a week). # Tell homebrew to not autoupdate every single time I run it (just once a week).
#export HOMEBREW_AUTO_UPDATE_SECS=604800 export HOMEBREW_AUTO_UPDATE_SECS=604800
# Turn on Git autocomplete.
# brew_prefix=`brew --prefix`
#brew_prefix='/usr/local'
#if type brew &>/dev/null; then
# FPATH=$brew_prefix/share/zsh/site-functions:$FPATH
#fi
# Turn on kubectl autocomplete.
#if [ -x "$(command -v kubectl)" ]; then
# source <(kubectl completion bash)
#fi
# Use brew-installed PHP binaries.
#export PATH="/usr/local/opt/php@7.2/bin:$PATH"
#export PATH="/usr/local/opt/php@7.2/sbin:$PATH"
# Python settings. # Python settings.
#export PYTHONPATH="/usr/local/lib/python2.7/site-packages" export PYTHONPATH="/usr/local/lib/python2.7/site-packages"
# Super useful Docker container oneshots. # Super useful Docker container oneshots.
# Usage: dockrun, or dockrun [centos7|fedora27|debian9|debian8|ubuntu1404|etc.] # Usage: dockrun, or dockrun [centos7|fedora27|debian9|debian8|ubuntu1404|etc.]
#dockrun() { dockrun() {
# docker run -it geerlingguy/docker-"${1:-ubuntu1604}"-ansible /bin/bash docker run -it geerlingguy/docker-"${1:-ubuntu1604}"-ansible /bin/bash
#} }
# Enter a running Docker container. # Enter a running Docker container.
#function denter() { function denter() {
# if [[ ! "$1" ]] ; then if [[ ! "$1" ]] ; then
# echo "You must supply a container ID or name." echo "You must supply a container ID or name."
# return 0 return 0
# fi fi
#
# docker exec -it $1 bash docker exec -it $1 bash
# return 0 return 0
#} }
# Delete a given line number in the known_hosts file. # Delete a given line number in the known_hosts file.
#knownrm() { knownrm() {
# re='^[0-9]+$' re='^[0-9]+$'
# if ! [[ $1 =~ $re ]] ; then if ! [[ $1 =~ $re ]] ; then
# echo "error: line number missing" >&2; echo "error: line number missing" >&2;
# else else
# sed -i '' "$1d" ~/.ssh/known_hosts sed -i '' "$1d" ~/.ssh/known_hosts
# fi fi
#} }
# Ask for confirmation when 'prod' is in a command string. # Ask for confirmation when 'prod' is in a command string.
#prod_command_trap () { #prod_command_trap () {