alias lt='EZA_GRID_ROWS=26 eza -w 0 --group --long --grid --group-directories-first --sort=mod -t=mod --time-style=long-iso'
echo pts ;;
esac
-
+
alias emergelog='sudo cat /var/log/emerge.log | grep "started\|completed\|exiting"'
alias k='kks edit'
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
- # Shell is non-interactive. Be done now!
- return
+ # Shell is non-interactive. Be done now!
+ return
fi
+# No double entries in the shell history.
+export HISTCONTROL="$HISTCONTROL erasedups:ignoreboth"
+
+# Do not overwrite files when redirecting output by default.
+set -o noclobber
+
+# Wrap the following commands for interactive use to avoid accidental file overwrites.
+rm() { command rm -i "${@}"; }
+cp() { command cp -i "${@}"; }
+mv() { command mv -i "${@}"; }
+
+# get current branch in git repo
+function parse_git_branch() {
+ BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
+ if [ ! "${BRANCH}" == "" ]
+ then
+ STAT=$(parse_git_dirty)
+ echo "─[${BRANCH}${STAT}]"
+ else
+ echo ""
+ fi
+}
+
+# get current status of git repo
+function parse_git_dirty {
+ status=$(git status 2>&1 | tee)
+ if [ "$LANG" == "de_DE.utf8" ]; then
+ dirty=$(echo -n "${status}" 2> /dev/null | grep "geändert:" &> /dev/null; echo "$?")
+ untracked=$(echo -n "${status}" 2> /dev/null | grep "Unversionierte Dateien:" &> /dev/null; echo "$?")
+ ahead=$(echo -n "${status}" 2> /dev/null | grep "Ihr Branch ist" &> /dev/null; echo "$?")
+ newfile=$(echo -n "${status}" 2> /dev/null | grep "neue Datei:" &> /dev/null; echo "$?")
+ renamed=$(echo -n "${status}" 2> /dev/null | grep "umbenannt:" &> /dev/null; echo "$?")
+ deleted=$(echo -n "${status}" 2> /dev/null | grep "gelöscht:" &> /dev/null; echo "$?")
+ else
+ dirty=$(echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?")
+ untracked=$(echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?")
+ ahead=$(echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?")
+ newfile=$(echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?")
+ renamed=$(echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?")
+ deleted=$(echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?")
+ fi
+ bits=''
+ if [ "${renamed}" == "0" ]; then
+ bits=">${bits}"
+ fi
+ if [ "${ahead}" == "0" ]; then
+ bits="*${bits}"
+ fi
+ if [ "${newfile}" == "0" ]; then
+ bits="+${bits}"
+ fi
+ if [ "${untracked}" == "0" ]; then
+ bits="?${bits}"
+ fi
+ if [ "${deleted}" == "0" ]; then
+ bits="x${bits}"
+ fi
+ if [ "${dirty}" == "0" ]; then
+ bits="!${bits}"
+ fi
+ if [ ! "${bits}" == "" ]; then
+ echo " ${bits}"
+ else
+ echo ""
+ fi
+}
+
+export PS1="┬─[\[\e[33m\]\u\[\e[m\]@\[\e[34m\]\h\[\e[m\]:\w]─[\[\e[37m\]\t\[\e[m\]]\`parse_git_branch\`\n╰─\[\e[31m\]\\$\[\e[m\] "
+
+# enable moving between directories without cd
+shopt -s autocd
+# enable spelling correction
+shopt -s dirspell
+# enable case-insensitivity
+shopt -s nocaseglob
+# expand filename patterns without match to a null string
+shopt -s nullglob
+
# Put your fun stuff here.
#
#[ -x /bin/fish ] && SHELL=/bin/fish exec fish
+fastfetch