Skip to content

Instantly share code, notes, and snippets.

@ggrrll
Created December 18, 2025 10:45
Show Gist options
  • Select an option

  • Save ggrrll/79ef943ce1b658a3461f561897303a34 to your computer and use it in GitHub Desktop.

Select an option

Save ggrrll/79ef943ce1b658a3461f561897303a34 to your computer and use it in GitHub Desktop.
macos bash profile
# suppress warining
export BASH_SILENCE_DEPRECATION_WARNING=1
# # set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# # don't put duplicate lines or lines starting with space in the history.
# # See bash(1) for more options
HISTCONTROL=ignoreboth
# # append to the history file, don't overwrite it
shopt -s histappend
# # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# add colorful prompt with git branch at the end
# Function to get current git branch
parse_git_branch() {
git branch 2>/dev/null | sed -n '/\* /s///p'
}
# Set colorful prompt with git branch
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# Color prompt: green user@host, blue path, yellow git branch
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[33m\]:$(parse_git_branch)\[\033[00m\]\$ '
else
# Plain prompt with git branch
PS1='\u@\h:\w$(parse_git_branch)\$ '
fi
# # Alias definitions.
# # You may want to put all your additions into a separate file like
# # ~/.bash_aliases, instead of adding them here directly. This way, you
# # can easily re-use your aliases in other bash configurations.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# # fzf
eval "$(fzf --bash)"
@ggrrll
Copy link
Author

ggrrll commented Dec 18, 2025

...and few aliases like

alias ll='ls -lrth'
alias la='ls -A'
alias l='ls -CF'

# # Add an "alert" alias for long running commands.  Use like so:
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

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