|
7 | 7 | # By Jeff Bai and Arthur Wang
|
8 | 8 |
|
9 | 9 | # System wide aliases and functions.
|
10 |
| - |
| 10 | +[ "$BASH" ] || alias shopt=false |
11 | 11 | # System wide environment variables and startup programs should go into
|
12 | 12 | # /etc/profile. Personal environment variables and startup programs
|
13 | 13 | # should go into ~/.bash_profile. Personal aliases and functions should
|
|
22 | 22 | # Provides prompt for non-login shells, specifically shells started
|
23 | 23 | # in the X environment.
|
24 | 24 |
|
25 |
| -# Use case-insensitive filename globbing |
26 |
| -shopt -s nocaseglob |
27 | 25 |
|
28 | 26 | # Make bash append rather than overwrite the history on disk
|
29 |
| -shopt -s histappend |
| 27 | +# Allows user to edit a failed hist exp. |
| 28 | +# Allows user to verify the results of hist exp. |
| 29 | +shopt -s histappend histreedit histverify |
30 | 30 |
|
31 | 31 | # When changing directory small typos can be ignored by bash
|
32 |
| -# for example, cd /vr/lgo/apaache would find /var/log/apache |
33 |
| -shopt -s cdspell |
| 32 | +# Chdirs into it if command is a dir |
| 33 | +# Chdirs into $var if var not found |
| 34 | +shopt -s cdspell autocd cdable_vars |
| 35 | + |
| 36 | +# Do not complete when readline buf is empty |
| 37 | +shopt -s no_empty_cmd_completion |
| 38 | + |
| 39 | +# Extended glob (3.5.8.1) & find-all-glob with ** |
| 40 | +shopt -s extglob globstar |
| 41 | + |
| 42 | +# Hashtable the commands! |
| 43 | +shopt -s checkhash |
34 | 44 |
|
35 | 45 | # Colors
|
36 | 46 | alias l='ls -AFlh'
|
37 | 47 | alias ll='ls -Flh'
|
38 | 48 | alias la='ls -AF'
|
39 | 49 | for c in {e,f,}grep {v,}dir ls; do alias $c="$c --color=auto"; done;
|
40 | 50 |
|
| 51 | +# So they can be unset. |
| 52 | +_aosc_bashrc_colors='NORMAL RED GREEN CYAN IRED YELLOW' |
41 | 53 | NORMAL='\[\e[0m\]'
|
42 | 54 | RED='\[\e[1;31m\]'
|
43 | 55 | GREEN='\[\e[1;32m\]'
|
44 | 56 | CYAN='\[\e[1;36m\]'
|
45 | 57 |
|
46 | 58 | # Linux tty color workaround
|
47 |
| -[ $(tput colors) == 8 ] && YELLOW='\e[1;33m' IRED="\e[0;31m" || YELLOW='\e[1;93m' IRED="\e[0;91m" |
| 59 | +[ "$(tput colors)" == 8 ] && YELLOW='\e[1;33m' IRED="\e[0;31m" || YELLOW='\e[1;93m' IRED="\e[0;91m" |
48 | 60 |
|
49 | 61 | # A simple error level reporting function.
|
50 | 62 | # Loaded back to PS1
|
51 | 63 | _ret_prompt() {
|
52 | 64 | case $? in
|
53 | 65 | 0|130) # Input C-c
|
54 |
| - [[ $EUID == 0 ]] && printf '#' || printf '$' |
| 66 | + printf '\$' |
55 | 67 | ;;
|
56 | 68 | 127) # Command not found
|
57 | 69 | printf '\e[1;36m?'
|
@@ -112,4 +124,5 @@ _lastdir_rec() {
|
112 | 124 | }
|
113 | 125 |
|
114 | 126 | unset c
|
| 127 | +unalias shopt |
115 | 128 | # End /etc/bashrc
|
0 commit comments