updated .bashrc
feat(bashrc): # CLEANED UPDATED BASHRC - Hauptkonfiguration aufgeräumt und modularisiert - History optimiert (gemeinsame History mit history -a; history -n) - Laden ausgelagerter Dateien: ~/.bash_aliases, ~/.bash_env, ~/.bash_paths - farbiger Prompt inkl. xterm/rxvt Fenstertitel - dircolors integriert (LS_OPTIONS als ENV -> .bash_env) - nützliche Shell-Optionen gesetzt (cmdhist, lithist, checkwinsize)
This commit is contained in:
+33
-44
@@ -1,58 +1,57 @@
|
|||||||
# CLEANED UPDATED BASHRC
|
# CLEANED UPDATED BASHRC
|
||||||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
# ~/.bashrc — interactive non-login shells
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
# Exit early if non-interactive
|
||||||
case $- in
|
case $- in
|
||||||
*i*) ;;
|
*i*) ;;
|
||||||
*) return;;
|
*) return;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# History
|
##### History #####
|
||||||
HISTCONTROL=ignoreboth
|
HISTCONTROL=ignoreboth:erasedups
|
||||||
shopt -s histappend
|
shopt -s histappend
|
||||||
HISTSIZE=99999999
|
HISTSIZE=99999999
|
||||||
HISTFILESIZE=99999999
|
HISTFILESIZE=99999999
|
||||||
HISTTIMEFORMAT="%Y-%m-%d %T "
|
HISTTIMEFORMAT="%Y-%m-%d %T "
|
||||||
PROMPT_COMMAND='history -a'
|
PROMPT_COMMAND='history -a; history -n'
|
||||||
|
shopt -s cmdhist
|
||||||
|
shopt -s lithist
|
||||||
shopt -s checkwinsize
|
shopt -s checkwinsize
|
||||||
|
|
||||||
# Debian chroot prompt helper
|
##### Debian chroot prompt helper #####
|
||||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||||
debian_chroot=$(cat /etc/debian_chroot)
|
debian_chroot=$(cat /etc/debian_chroot)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Terminalfarben prüfen
|
##### Prompt #####
|
||||||
case "$TERM" in
|
if [ -x /usr/bin/tput ] && tput setaf 1 >/dev/null 2>&1; then
|
||||||
xterm-color|*-256color) color_prompt=yes;;
|
color_prompt=yes
|
||||||
esac
|
else
|
||||||
|
color_prompt=
|
||||||
if [ -n "$force_color_prompt" ]; then
|
|
||||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
|
||||||
color_prompt=yes
|
|
||||||
else
|
|
||||||
color_prompt=
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prompt
|
if [ "$color_prompt" = yes ]; then
|
||||||
export PS1='\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
|
PS1='\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
|
||||||
|
else
|
||||||
|
PS1='\u@\h \w \$ '
|
||||||
|
fi
|
||||||
|
|
||||||
# xterm/rxvt Fenstertitel
|
|
||||||
case "$TERM" in
|
case "$TERM" in
|
||||||
xterm*|rxvt*)
|
xterm*|rxvt*)
|
||||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||||
;;
|
;;
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# LS-Farben & dircolors
|
##### LS-Farben & dircolors #####
|
||||||
if [ -x /usr/bin/dircolors ]; then
|
if [ -x /usr/bin/dircolors ]; then
|
||||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
if [ -r "$HOME/.dircolors" ]; then
|
||||||
export LS_OPTIONS='--color=auto -h'
|
eval "$(dircolors -b "$HOME/.dircolors")"
|
||||||
|
else
|
||||||
|
eval "$(dircolors -b)"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Bash-Completion
|
##### Bash-Completion #####
|
||||||
if ! shopt -oq posix; then
|
if ! shopt -oq posix; then
|
||||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
. /usr/share/bash-completion/bash_completion
|
. /usr/share/bash-completion/bash_completion
|
||||||
@@ -61,17 +60,7 @@ if ! shopt -oq posix; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Aliase auslagern
|
##### Ausgelagerte Dateien #####
|
||||||
if [ -f ~/.bash_aliases ]; then
|
[ -f "$HOME/.bash_aliases" ] && . "$HOME/.bash_aliases"
|
||||||
. ~/.bash_aliases
|
[ -f "$HOME/.bash_env" ] && . "$HOME/.bash_env"
|
||||||
fi
|
[ -f "$HOME/.bash_paths" ] && . "$HOME/.bash_paths"
|
||||||
|
|
||||||
# env auslagern
|
|
||||||
if [ -f ~/.bash_env ]; then
|
|
||||||
. ~/.bash_env
|
|
||||||
fi
|
|
||||||
|
|
||||||
# PATH auslagern
|
|
||||||
if [ -f ~/.bash_paths ]; then
|
|
||||||
. ~/.bash_paths
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user