1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
|
test -s ~/.alias && . ~/.alias || true
read -r product_family </sys/class/dmi/id/product_family product_name="$(hostname -s)" if [ "${product_family}" = "ThinkPad T14 Gen 1" ] then product_name="ThinkPad-T14" elif [ "${product_family}" = "ThinkPad neo 14" ] then product_name="ThinkPad-Neo14" fi
alias proxyon='export http_proxy=http://127.0.0.1:7890; export https_proxy=http://127.0.0.1:7890;echo proxy is on!' alias proxyoff='unset http_proxy; unset https_proxy;echo proxy is off!' alias tedding.dev='cd ~/Documents/Github/tedding.dev'
export GO="$HOME/.local/bin/go" export V2RAY="$HOME/.local/bin/v2ray" export JETBRAINS="/opt/jetbrains" export FLUTTER="$HOME/.local/bin/flutter" export MACROCURA="$HOME/.local/Documents/Macrocura" export NWJSSDK_V0_40_2="$HOME/.local/bin/nwjs-sdk-v0.40.2-linux-x64/" export GRADLE="$HOME/.local/bin/gradle" export MITMPROXY="$HOME/.local/bin/mitmproxy"
export IDEA="$JETBRAINS/Idea" export CLION="$JETBRAINS/Clion" export RIDER="$JETBRAINS/Rider" export GOLAND="$JETBRAINS/GoLand" export WEBSTORM="$JETBRAINS/WebStorm" export BREW="/home/linuxbrew/.linuxbrew"
export PATH="$MACROCURA:$HOME/.local/bin:$V2RAY:$IDEA/bin:$CLION/bin:$RIDER/bin:$GOLAND/bin:$WEBSTORM/bin:$FLUTTER/bin:$GO/bin:$NWJSSDK_V0_40_2:$GRADLE/bin:$BREW/bin:$MITMPROXY:$PATH"
export VOLTA_HOME="$HOME/.volta" export PATH="$VOLTA_HOME/bin:$PATH"
. "$HOME/.cargo/env"
export LG_WEBOS_TV_SDK_HOME="$HOME/.local/bin/webOS_TV_SDK"
if [ -d "$LG_WEBOS_TV_SDK_HOME/CLI/bin" ]; then export WEBOS_CLI_TV="$LG_WEBOS_TV_SDK_HOME/CLI/bin" export PATH="$PATH:$WEBOS_CLI_TV" fi
COLOR_SCHEME=dark
alias sudo='sudo '
alias ..='cd ..' alias cp='cp -v' alias rm='rm -I' alias mv='mv -iv' alias ln='ln -sriv' alias xclip='xclip -selection c' command -v vim > /dev/null && alias vi='vim'
alias ls='ls --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' alias diff='diff --color=auto' alias ip='ip --color=auto' alias pacman='pacman --color=auto'
alias ll='ls -la' alias la='ls -A' alias l='ls -F' command -v lsd > /dev/null && alias ls='lsd --group-dirs first' && \ alias tree='lsd --tree' command -v colorls > /dev/null && alias ls='colorls --sd --gs' && \ alias tree='colorls --tree'
command -v bat > /dev/null && \ alias bat='bat --theme=ansi' && \ alias cat='bat --pager=never' && \ alias less='bat'
command -v batcat > /dev/null && \ alias batcat='batcat --theme=ansi' && \ alias cat='batcat --pager=never' && \ alias less='batcat'
command -v htop > /dev/null && alias top='htop' command -v gotop > /dev/null && alias top='gotop -p $([ "$COLOR_SCHEME" = "light" ] && echo "-c default-dark")' command -v ytop > /dev/null && alias top='ytop -p $([ "$COLOR_SCHEME" = "light" ] && echo "-c default-dark")' command -v btm > /dev/null && alias top='btm $([ "$COLOR_SCHEME" = "light" ] && echo "--color default-light")'
command -v bashtop > /dev/null && alias top='bashtop' command -v bpytop > /dev/null && alias top='bpytop'
shopt -s globstar shopt -s histappend shopt -s checkwinsize
HISTCONTROL=ignoreboth HISTSIZE=5000 HISTFILESIZE=5000 HISTFILE=~/.bash_history
if [ -f /usr/share/bash-completion/bash_completion ] then source /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ] then source /etc/bash_completion fi
PROMPT_COMMAND="PROMPT_COMMAND=echo"
PS1='\[\033[;32m\]┌──(\[\033[1;34m\]\u@${product_name}\[\033[;32m\])-[\[\033[0;1m\]\w\[\033[;32m\]]\n\[\033[;32m\]└─\[\033[1;34m\]\$\[\033[0m\] '
export VISUAL=vim export EDITOR=$VISUAL
setterm -linewrap on 2> /dev/null
export LESS_TERMCAP_mb=$'\e[1;32m' export LESS_TERMCAP_md=$'\e[1;32m' export LESS_TERMCAP_me=$'\e[0m' export LESS_TERMCAP_se=$'\e[0m' export LESS_TERMCAP_so=$'\e[01;33m' export LESS_TERMCAP_ue=$'\e[0m' export LESS_TERMCAP_us=$'\e[1;4;31m' export LESSHISTFILE=-
[ -x /usr/bin/dircolors ] && eval "$(dircolors -b)"
case "$TERM" in xterm*|rxvt*|Eterm|aterm|kterm|gnome*|alacritty) PS1="\[\e]0;\u@\h: \w\a\]$PS1" ;; esac
lazygit() { USAGE=" lazygit [OPTION]... <msg>
GIT but lazy
Options: --fixup <commit> runs 'git commit --fixup <commit> [...]' --amend runs 'git commit --amend --no-edit [...]' -f, --force runs 'git push --force-with-lease [...]' -h, --help show this help text " while [ $# -gt 0 ] do key="$1"
case $key in --fixup) COMMIT="$2" shift shift ;; --amend) AMEND=true shift ;; -f|--force) FORCE=true shift ;; -h|--help) echo "$USAGE" EXIT=true ;; *) MESSAGE="$1" shift ;; esac done unset key if [ -z "$EXIT" ] then git status . git add . if [ -n "$AMEND" ] then git commit --amend --no-edit elif [ -n "$COMMIT" ] then git commit --fixup "$COMMIT" GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash "$COMMIT"^ else git commit -m "$MESSAGE" fi git push origin HEAD $([ -n "$FORCE" ] && echo '--force-with-lease') fi unset USAGE COMMIT MESSAGE AMEND FORCE }
glog() { setterm -linewrap off 2> /dev/null
git --no-pager log --all --color=always --graph --abbrev-commit --decorate --date-order \ --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' "$@" \ | sed -E \ -e 's/\|(\x1b\[[0-9;]*m)+\\(\x1b\[[0-9;]*m)+ /├\1─╮\2/' \ -e 's/(\x1b\[[0-9;]+m)\|\x1b\[m\1\/\x1b\[m /\1├─╯\x1b\[m/' \ -e 's/\|(\x1b\[[0-9;]*m)+\\(\x1b\[[0-9;]*m)+/├\1╮\2/' \ -e 's/(\x1b\[[0-9;]+m)\|\x1b\[m\1\/\x1b\[m/\1├╯\x1b\[m/' \ -e 's/╮(\x1b\[[0-9;]*m)+\\/╮\1╰╮/' \ -e 's/╯(\x1b\[[0-9;]*m)+\//╯\1╭╯/' \ -e 's/(\||\\)\x1b\[m (\x1b\[[0-9;]*m)/╰╮\2/' \ -e 's/(\x1b\[[0-9;]*m)\\/\1╮/g' \ -e 's/(\x1b\[[0-9;]*m)\//\1╯/g' \ -e 's/^\*|(\x1b\[m )\*/\1⎬/g' \ -e 's/(\x1b\[[0-9;]*m)\|/\1│/g' \ | command less -r $([ $# -eq 0 ] && echo "+/[^/]HEAD")
setterm -linewrap on 2> /dev/null }
find() { if [ $# = 1 ] then command find . -iname "*$@*" else command find "$@" fi }
|