Skip to content

Instantly share code, notes, and snippets.

@kazi331
Last active July 1, 2024 11:56
Show Gist options
  • Save kazi331/6a59b237570ee7f5b4bf591f946885fe to your computer and use it in GitHub Desktop.
Save kazi331/6a59b237570ee7f5b4bf591f946885fe to your computer and use it in GitHub Desktop.
minimal but clean and beautiful bashrcs
#aliases
alias nd="npm run dev"
alias ns="npm start"
alias nb="npm run build"
alias ga="git add ."
alias gc="git commit -m"
alias c="clear"
alias x="exit"
alias su="sudo apt update && sudo apt upgrade"
alias killport="lsof -t -i:3000"
alias pn="pnpm"
alias spi="sudo apt install"
alias spr="sudo apt remove"
alias spa="sudo apt autoremove"
# special characters to use in PS1 at the end
# λ …» → ✘ ✗ ❭ ❯ ➔ ➙ ➛ ➤ ➯ ➾
# some special characters to use in PS1 at the beginning:
#
#PS1='\[\033[01;33m\]\u\[\033[01;36m\]@$(basename $(dirname $PWD))/\[\033[01;36m\]$(basename $PWD)\[\033[00m\] \[\033[01;33m\] > \[\033[00m\]'
PS1='\[\033[38;5;111m\]\u\[\033[38;5;120m\]@\[\033[38;5;162m\]\W\[\033[00m\] \[\033[38;5;226m\]✘ \[\033[00m\]'
PS1='\[\033[01;39m\]\u\[\033[01;36m\]@\[\033[04;36m\]$(basename $PWD)\[\033[00m\] \[\033[01;33m\]✗ \[\033[00m\]'
# with branch name
PS1='\[\033[01;39m\]\u\[\033[01;36m\]@\[\033[04;36m\]$(basename $PWD)$(parse_git_branch)\[\033[00m\] \[\033[01;33m\]✗ \[\033[00m\]'
@kazi331
Copy link
Author

kazi331 commented Jul 1, 2024

if you get purse_git_branch() not found then add this inside of .bashrc

parse_git_branch() {
  git branch 2>/dev/null | grep '*' | sed 's/* //'
}

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