home · contact · privacy
25d13961f8a159b9b7fed3cbb9c1e2b4b6fae4dd
[config] / ansible / files / dotfiles / shinit
1 # Settings for interactive shells.
2
3 # Ensure shell truly is interactive to avoid confusing non-interactive shells.
4 if [[ $- == *i* ]]; then
5
6     # Fancy colors for ls.
7     alias ls="ls --color=auto"
8
9     # Use vim as default editor for anything.
10     export VISUAL=vim
11     export EDITOR=$VISUAL
12
13     # Colored prompt with username, hostname, date/time, directory.
14     colornumber=7 # Default to white if no color set via colornumber dotfile.
15     colornumber_file=~/.shinit_color
16     if [ -f $colornumber_file ]; then
17         colornumber=`cat $colornumber_file`
18     fi
19     tput_color="$(tput setaf $colornumber)$(tput bold)"
20     tput_reset="$(tput sgr0)"
21     # Bash confuses the line length when not told to not count escape sequences.
22     if [ ! "$BASH" = "" ]; then
23         tput_color="\[$tput_color\]"
24         tput_reset="\[$tput_reset\]"
25     fi
26     PS1="${tput_color}["\$\(date\ +%Y-%m-%d/%H:%M:%S/%Z\)" $USER@$(hostname):"\$\(pwd\)"]$ $tput_reset"
27     PS2="${tput_color}> $tput_reset"
28     PS3="${tput_color}select: $tput_reset"
29     PS4="${tput_color}+ $tput_reset"
30
31     # Add local additions.
32     local_shinit_file=~/.shinit_add
33     if [ -f $local_shinit_file ]; then
34         . $local_shinit_file
35     fi
36
37 fi