tweak bashrc

This commit is contained in:
2025-06-20 17:31:53 +02:00
parent 83851b83a4
commit 6a0f8a0834

26
.bashrc
View File

@@ -12,8 +12,8 @@
# wrapper for lazily loading __git_ps1 whenever it is actually needed
_lazy_git_ps1() {
if [[ -z $__GIT_PROMPT_SOURCED ]]; then
source /usr/share/bash-completion/completions/git &>/dev/null
source /usr/share/git/completion/git-prompt.sh &>/dev/null
. /usr/share/bash-completion/completions/git &>/dev/null
. /usr/share/git/completion/git-prompt.sh &>/dev/null
if [ -d .git ] || git worktree list &>/dev/null; then
export __GIT_PROMPT_SOURCED=1
__git_ps1 "$@"
@@ -42,6 +42,9 @@ _make() {
-e "s/^.*error.*$/\x1b[31m&\x1b[0m/I" >&2)
}
#
# envs
#
# set PS1
PS1=
PS1="$PS1"'\[\033[01;35m\]\u@\h' # user@host
@@ -51,12 +54,14 @@ PS1="$PS1"'\[\033[01;93m\]$(_lazy_git_ps1)' # github branch
PS1="$PS1"'\[\033[00m\]\$ ' # shell sign
# history settings
HISTCONTROL=ignoreboth # don't put duplicate lines or lines starting with space in the history.
HISTSIZE=1000
HISTFILESIZE=2000
HISTSIZE=2048
HISTFILESIZE=2048
HISTCONTROL=erasedups:ignoredups:ignorespace
# vcpkg shit
source /home/user/.local/share/vcpkg/scripts/vcpkg_completion.bash &>/dev/null
#
# bash completion
#
. /home/user/.local/share/vcpkg/scripts/vcpkg_completion.bash &>/dev/null # fucking vcpkg
# check the window size after each command (and if necessary, the values of LINES and COLUMNS)
shopt -s checkwinsize
@@ -91,5 +96,12 @@ alias q='exit'
alias py3='python3'
alias batman='bat -l man'
# quality of life short-hands
alias ..='cd ..'
alias ....='cd ../..'
alias ......='cd ../../..'
alias ........='cd ../../../..'
alias ll="ls -l"
# cute lil hyfetch :3
[[ $TERM == "xterm-kitty" ]] && hyfetch