Skip to content

Commit 0bd88a4

Browse files
committed
bashrc: #7 varexp, #6 shopt
1 parent 537e831 commit 0bd88a4

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

bashrc

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# By Jeff Bai and Arthur Wang
88

99
# System wide aliases and functions.
10-
10+
[ "$BASH" ] || alias shopt=false
1111
# System wide environment variables and startup programs should go into
1212
# /etc/profile. Personal environment variables and startup programs
1313
# should go into ~/.bash_profile. Personal aliases and functions should
@@ -22,36 +22,48 @@
2222
# Provides prompt for non-login shells, specifically shells started
2323
# in the X environment.
2424

25-
# Use case-insensitive filename globbing
26-
shopt -s nocaseglob
2725

2826
# 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
3030

3131
# 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
3444

3545
# Colors
3646
alias l='ls -AFlh'
3747
alias ll='ls -Flh'
3848
alias la='ls -AF'
3949
for c in {e,f,}grep {v,}dir ls; do alias $c="$c --color=auto"; done;
4050

51+
# So they can be unset.
52+
_aosc_bashrc_colors='NORMAL RED GREEN CYAN IRED YELLOW'
4153
NORMAL='\[\e[0m\]'
4254
RED='\[\e[1;31m\]'
4355
GREEN='\[\e[1;32m\]'
4456
CYAN='\[\e[1;36m\]'
4557

4658
# 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"
4860

4961
# A simple error level reporting function.
5062
# Loaded back to PS1
5163
_ret_prompt() {
5264
case $? in
5365
0|130) # Input C-c
54-
[[ $EUID == 0 ]] && printf '#' || printf '$'
66+
printf '\$'
5567
;;
5668
127) # Command not found
5769
printf '\e[1;36m?'
@@ -112,4 +124,5 @@ _lastdir_rec() {
112124
}
113125

114126
unset c
127+
unalias shopt
115128
# End /etc/bashrc

0 commit comments

Comments
 (0)