Skip to content

Instantly share code, notes, and snippets.

@Yttehs-HDX
Last active June 29, 2024 16:15
Show Gist options
  • Save Yttehs-HDX/093b22497f1a959ad02f2375e333bc3a to your computer and use it in GitHub Desktop.
Save Yttehs-HDX/093b22497f1a959ad02f2375e333bc3a to your computer and use it in GitHub Desktop.
My custom ~/.bashrc
# +------------------------------------+
# | _ _ |
# | | |__ __ _ ___| |__ _ __ ___ |
# | | '_ \ / _` / __| '_ \| '__/ __| |
# | _| |_) | (_| \__ \ | | | | | (__ |
# | (_)_.__/ \__,_|___/_| |_|_| \___| |
# +------------------------------------+
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias grep='grep --color=auto'
# bash prompt
PS1='\e[0;32m┬─[\e[0m\e[0;33m\u\e[0m@\e[0;36m\h\e[0m:\W\e[0;32m]─[\t]\n╰─>\e[0m\e[0;31m$\e[0m '
# neovim
export EDITOR='nvim'
alias v='vi'
alias vi='vim'
alias vim='nvim'
# language
export LANG=en_US.UTF-8
export LANGUAGE=en_US
# thefuck
eval $(thefuck --alias)
# tgpt
alias a='tgpt'
alias ai='a -i'
alias am='a -m'
alias draw='tgpt -img'
# fastfetch
alias neofetch='fastfetch'
# alias
alias c='clear'
alias t='tmux'
alias h='history | sort -nr | bat'
alias ls='eza --icons --git'
alias ran='ranger'
alias df='duf'
alias ps='procs'
alias top='htop'
alias less='bat'
alias whats='gh copilot explain'
alias howto='gh copilot suggest'
alias timeshift='sudo timeshift'
alias aafire='aafire -driver curses'
# functions
transzh() {
trans :zh $1
}
transen() {
trans :en $1
}
weather() {
curl wttr.in/$1
}
frp-start() {
sudo systemctl start sshd frpc
}
frp-stop() {
sudo systemctl stop sshd frpc
}
frp-enable() {
sudo systemctl enable --now sshd frpc
}
frp-disable() {
sudo systemctl disable --now sshd frpc
}
frp-status() {
systemctl status sshd frpc
}
pdf() {
pdftotext $1 - | bat
}
content() { # list all files recursively whose content contains the given string
find . -type f -exec grep -l $1 {} +
}
icat() {
kitty +kitten icat $1
}
# custom exports
export PATH=$PATH:~/.local/bin
export PATH=$PATH:~/.cargo/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment