dotfiles/.zshrc

58 lines
1.6 KiB
Bash
Raw Permalink Normal View History

export GEM_HOME="$HOME/.local/gems"
2021-09-06 16:39:30 +00:00
export PATH="$HOME/.local/bin:$PATH"
2017-07-16 21:51:11 +00:00
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME=""
2017-07-02 18:27:07 +00:00
2017-07-16 21:51:11 +00:00
function prompt_char {
if [ $UID -eq 0 ]; then echo "#"; else echo $; fi
}
2017-07-02 18:27:07 +00:00
DISABLE_UNTRACKED_FILES_DIRTY="true"
plugins=(git)
source $ZSH/oh-my-zsh.sh
2017-07-16 21:51:11 +00:00
export LANG=en_US.UTF-8
2017-07-02 18:27:07 +00:00
export EDITOR='vim'
2017-07-16 21:51:11 +00:00
2020-11-09 14:53:42 +00:00
PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%})(%m)%{%F{24}%} %(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '
2017-07-16 21:51:11 +00:00
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
2018-07-09 15:03:58 +00:00
zle_highlight=( default:fg=default )
2017-07-02 18:27:07 +00:00
parent() { [[ ${1[1,$#2]} == $2 ]] }
sibling() { [[ ${1:a:h} == ${2:a:h} ]] }
function chpwd() {
emulate -L zsh
# Automatically fetch remotes and display Git status information when entering a repository.
if [[ -d .git ]]; then
git status
fi
}
alias git='noglob git'
alias ga='git add'
alias gc='git commit'
alias gd='git diff'
alias gds='git diff --staged'
alias gp='git push'
alias gs='git status'
2017-12-22 21:44:06 +00:00
alias gtree='git log --graph --all --pretty=format:"%Cred%h%Creset - %Cgreen(%cd - %cr)%Creset %s%C(yellow)%d %an%Creset" --abbrev-commit --date=iso'
2018-05-31 22:09:54 +00:00
alias getunicode="perl -C7 -ne 'for(split(//)){print sprintf(\"U\+\%04X\", ord).\" \".\$_.\"\n\"}'"
2018-07-09 15:03:58 +00:00
2020-08-10 12:23:11 +00:00
if [ -z "$SSH_AUTH_SOCK" ]
then
# Check for a currently running instance of the agent
2020-11-09 15:08:10 +00:00
RUNNING_AGENT="`ps -x | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
2020-08-10 12:23:11 +00:00
if [ "$RUNNING_AGENT" = "0" ]
then
# Launch a new instance of the agent
ssh-agent -s &> ~/.ssh/ssh-agent
eval `cat ~/.ssh/ssh-agent`
2020-08-10 12:23:11 +00:00
fi
fi
2018-07-09 15:03:58 +00:00
prompt_context() {}