X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;ds=inline;f=dotfiles%2Fminimal%2Fshinit;fp=dotfiles%2Fminimal%2Fshinit;h=c80a6bcc148f375d4802382e8be61cfe1be07c78;hb=1277fce3b6a1d59634159fcb6bac6912856da28c;hp=0000000000000000000000000000000000000000;hpb=91fefe78e7da58646b85f864c53cee30a6ae0376;p=config diff --git a/dotfiles/minimal/shinit b/dotfiles/minimal/shinit new file mode 100644 index 0000000..c80a6bc --- /dev/null +++ b/dotfiles/minimal/shinit @@ -0,0 +1,32 @@ +# Settings for interactive shells. + +# Fancy colors for ls. +alias ls="ls --color=auto" + +# Use vim as default editor for anything. +export VISUAL=vim +export EDITOR=$VISUAL + +# Colored prompt with username, hostname, date/time, directory. +colornumber=7 # Default to white if no color set via colornumber dotfile. +colornumber_file=~/.shinit_color +if [ -f $colornumber_file ]; then + colornumber=`cat $colornumber_file` +fi +tput_color="$(tput setaf $colornumber)$(tput bold)" +tput_reset="$(tput sgr0)" +# Bash confuses the line length when not told to not count escape sequences. +if [ ! "$BASH" = "" ]; then + tput_color="\[$tput_color\]" + tput_reset="\[$tput_reset\]" +fi +PS1="${tput_color}["\$\(date\ +%Y-%m-%d/%H:%M:%S/%Z\)" $USER@$(hostname):"\$\(pwd\)"]$ $tput_reset" +PS2="${tput_color}> $tput_reset" +PS3="${tput_color}select: $tput_reset" +PS4="${tput_color}+ $tput_reset" + +# Add local additions. +local_shinit_file=~/.shinit_add +if [ -f $local_shinit_file ]; then + . $local_shinit_file +fi