Skip to content

Instantly share code, notes, and snippets.

@kazi331
Last active January 14, 2025 07:43
Show Gist options
  • Select an option

  • Save kazi331/6a59b237570ee7f5b4bf591f946885fe to your computer and use it in GitHub Desktop.

Select an option

Save kazi331/6a59b237570ee7f5b4bf591f946885fe to your computer and use it in GitHub Desktop.
minimal but clean and beautiful bashrcs | alternative to zsh
#aliases
alias x="exit"
alias c="clear"
#alias firefox='/opt/firefox/firefox'
alias pnd="pnpm dev"
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"
alias pns="pnpm run server"
alias r="remove"
alias pushall="git push && git push live"
alias ..="cd .."
alias yd="yarn dev"
alias ys="yarn start"
alias gb="git branch"
alias gch="git checkout "
alias cursor="~/apps/cursor/cursor.AppImage"
# special characters to use in PS1 at the end
# λ …» → ✘ ✗ ❭ ❯ ➔ ➙ ➛ ➤ ➯ ➾
# some special characters to use in PS1 at the beginning:
parse_git_branch() {
git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
#
#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\]'
PS1='\[\e[32m\]\u@\h:\[\e[34m\]${PWD##*/}\[\e[31m\]$(parse_git_branch)\[\e[0m\]\$ '
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