Skip to content

Instantly share code, notes, and snippets.

@jgermade
Last active July 11, 2022 01:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jgermade/d7943af70a01f23ed601c24fd0477b43 to your computer and use it in GitHub Desktop.
Save jgermade/d7943af70a01f23ed601c24fd0477b43 to your computer and use it in GitHub Desktop.
sh
alias ll='ls -alF'
alias l='ls -alF'
alias c='clear'
alias .='echo $PWD'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias ~='cd ~'
alias nuke='rm -rf'
alias pull='echo "Pulling from branch: $(git symbolic-ref --short HEAD)" && git pull origin $(git symbolic-ref --short HEAD)'
alias push='echo "Pushing to branch: $(git symbolic-ref --short HEAD)" && git push origin $(git symbolic-ref --short HEAD)'
local ret_status="%(?:%{$fg_bold[white]%}➤ :%{$fg_bold[red]%}➤ %s)"
PROMPT='%{$fg[blue]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%} %{$fg_bold[green]%}%p %{$fg[yellow]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}${ret_status}% %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$bg[blue]%}%{$fg[white]%} "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[yellow]%}⚡ %{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[white]%}✓ %{$reset_color%} "
# util for custom tab name
function git_current_branch() {
ingit=`git rev-parse --is-inside-work-tree 2>/dev/null`
if [ "$ingit" = "true" ]; then
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo " [ ${ref#refs/heads/} ]"
fi
}
# custom tab name
function precmd {
# echo -ne "\e]1;${PWD//*\//} $(git_prompt_info)\a"
print -Pn "\e]0;$(pwd | sed -e "s,^$HOME,~,")$(git_current_branch)\a"
}
unset color_prompt force_color_prompt
export PS1=' \e[93m\w $(__git_ps1 "\e[44;97m %s \e[49m ")\[\033[01;39m\]➤\[\033[00m\] '
local ret_status="%(?:%{$fg_bold[white]%}➤ :%{$fg_bold[red]%}➤ %s)"
PROMPT='%{$fg_bold[green]%}%p %{$fg[yellow]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}${ret_status}% %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$bg[blue]%}%{$fg[white]%} "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[yellow]%}⚡ %{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[white]%}✓ %{$reset_color%} "
# util for custom tab name
function git_current_branch() {
ingit=`git rev-parse --is-inside-work-tree 2>/dev/null`
if [ "$ingit" = "true" ]; then
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo " [ ${ref#refs/heads/} ]"
fi
}
# custom tab name
function precmd {
# echo -ne "\e]1;${PWD//*\//} $(git_prompt_info)\a"
print -Pn "\e]0;$(pwd | sed -e "s,^$HOME,~,")$(git_current_branch)\a"
}
@himanshuxd
Copy link

Mind If I steal alias nuke='rm -rf' ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment