. /etc/bash.bashrc

alias l="ls -lah"
alias la="ls -ah"
alias ls="ls -h"
alias ll="ls -lh"
alias grep="grep --color"
alias egrep="grep -E"
alias lgrep="find | grep"
alias psgrep="ps axu | grep"
alias isotime='date +"%Y-%m-%dT%H:%M:%S%z"'
alias isodate='date +%Y-%m-%dT%H:%M:%S%z'
alias gls=/bin/ls
alias isotime='date +"%Y-%m-%dT%H:%M:%S%z"'
alias isodate='date +%Y-%m-%dT%H:%M:%S%z'
alias datefmt='date $DATEFMT'
alias gotemp="cd $(mktemp -d)"
alias fd=fdfind
alias bak=backup
alias gg=lazygit

export PS1='\[\e[1;31m\]\u@\h \[\e[1;36m\]\w\[\e[1;37m\] \$ \[\e[0m\]'
export DEBEMAIL="software@cscherr.de"
export DEBFULLNAME="Christoph J. Scherr"
export DEBIDENTITY="$DEBFULLNAME <$DEBEMAIL>"
export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
export DATEFMT='+%a %Y-%m-%d %X'
export EDITOR=$(which nvim)
export VISUAL=$(which nvim)
export PATH=$PATH:/sbin

random () {
    if [ $# -ne 1 ] || ! [[ $1 =~ ^[0-9]+$ ]] || [ $1 -lt 1 ]; then
        echo "Error: Please provide one positive integer argument" >&2
        return 1
    fi
    echo $(( (RANDOM % $1) + 1 ))
}
newpass () {
    LC_ALL=C tr -dc '[:alnum:]' < /dev/urandom | head -c${1:-40}
}

# set vi mode
set -o vi