1
0
Fork 0

add `.bashrc`

urosm 2023-08-12 01:22:07 +02:00
parent a905aec649
commit fea02815e2
1 changed files with 69 additions and 0 deletions

69
.bashrc 100644
View File

@ -0,0 +1,69 @@
# .bashrc
# from dot.git
# check interactive
case $- in
*i*) ;;
*) return;;
esac
# history
shopt -s histappend
HISTCONTROL=ignoreboth
HISTSIZE=1000
HISTFILESIZE=2000
# prompt
r="\[\e[00m\]"
b="\[\e[01m\]"
c4="\[\e[34m\]"
c7="\[\e[37m\]"
PS1="${b}\u@\h:$c4\w$c7\$$r "
unset e r b c4 c5 c7
# title
PS1="\[\e]0;\u@\h: \w\a\]$PS1"
# functions
# stat
st () {
find "${1-.}" -mindepth 0 -maxdepth 1 -printf '%m %u %g %Y %p\n'\
| sort -V -k 4,5\
| column -t -N 'i,u,g,t,n' -R 'i,u' -d
}
# aliases
# exit
alias q="exit"
alias :q="exit"
# grep
alias grep="grep --color=auto"
# ls
alias ls="ls --color=auto"
alias ll="ls --group-directories-first -A1v"
# git
alias gitl="git log --pretty=oneline"
alias gits="git status"
alias gitd="git diff"
alias gitc="git commit"
alias gita="git add"
# nvim
alias :e="nvim"
# newsboat
alias nb="newsboat"
# bash completion
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi