cleanup custom-bash-options.sh

This commit is contained in:
Tobias Powalowski 2023-02-01 19:36:36 +01:00
parent 48a791426b
commit 72f6e4b09f

View file

@ -4,8 +4,6 @@
[[ -n "${BASH_VERSION:-}" ]] || return [[ -n "${BASH_VERSION:-}" ]] || return
# Not an interactive shell? # Not an interactive shell?
[[ $- == *i* ]] || return [[ $- == *i* ]] || return
# keep history clean from dups and spaces
[[ $- == *i* ]] || return
if [[ "${UID}" == 0 ]]; then if [[ "${UID}" == 0 ]]; then
# red for root user, host green, print full working dir # red for root user, host green, print full working dir
PS1='[\e[1;31m\u\e[m@\e[1;32m\h\e[m \w]\$ ' PS1='[\e[1;31m\u\e[m@\e[1;32m\h\e[m \w]\$ '
@ -13,9 +11,9 @@ else
# blue for normal user,host green, print full working dir # blue for normal user,host green, print full working dir
PS1='[\e[1;34m\u\e[m@\e[1;32m\h\e[m \w]\$ ' PS1='[\e[1;34m\u\e[m@\e[1;32m\h\e[m \w]\$ '
fi fi
# keep history clean from dups and spaces
HISTCONTROL="erasedups:ignorespace" HISTCONTROL="erasedups:ignorespace"
# color output # color grep output
alias ls='ls --color=auto'
alias grep='grep --color=auto' alias grep='grep --color=auto'
# if installed set neovim as default editor # if installed set neovim as default editor
if command -v nvim >/dev/null; then if command -v nvim >/dev/null; then