Commit d9a3c0e698e23068a161cafee9097275ea78bfe7

Authored by Ian Foster
1 parent d84428e03f
Exists in master

improved man search color

Showing 1 changed file with 1 additions and 1 deletions Inline Diff

shell/bashrc View file @ d9a3c0e
# ----------- 1 1 # -----------
# .bashrc 2 2 # .bashrc
# ----------- 3 3 # -----------
4 4
# If not running interactively, don't do anything 5 5 # If not running interactively, don't do anything
case $- in 6 6 case $- in
*i*) ;; 7 7 *i*) ;;
*) return;; 8 8 *) return;;
esac 9 9 esac
10 10
#sets the default permissions for newly created files 11 11 #sets the default permissions for newly created files
#umask 022 12 12 #umask 022
13 13
# check the window size after each command and, if necessary, 14 14 # check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS. 15 15 # update the values of LINES and COLUMNS.
shopt -s checkwinsize 16 16 shopt -s checkwinsize
17 17
# If set, the pattern "**" used in a pathname expansion context will 18 18 # If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories. 19 19 # match all files and zero or more directories and subdirectories.
#shopt -s globstar 20 20 #shopt -s globstar
21 21
22 22
23 23
# ----------- 24 24 # -----------
# Colors 25 25 # Colors
# ----------- 26 26 # -----------
27 27
# we want lots of colors 28 28 # we want lots of colors
export TERM=xterm-256color 29 29 export TERM=xterm-256color
30 30
# set a fancy prompt (non-color, unless we know we "want" color) 31 31 # set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in 32 32 case "$TERM" in
xterm-color) color_prompt=yes;; 33 33 xterm-color) color_prompt=yes;;
esac 34 34 esac
35 35
# uncomment for a colored prompt, if the terminal has the capability; turned 36 36 # uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window 37 37 # off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt 38 38 # should be on the output of commands, not on the prompt
#force_color_prompt=yes 39 39 #force_color_prompt=yes
40 40
if [ -n "$force_color_prompt" ]; then 41 41 if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 42 42 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48 43 43 # We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such 44 44 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.) 45 45 # a case would tend to support setf rather than setaf.)
color_prompt=yes 46 46 color_prompt=yes
else 47 47 else
color_prompt= 48 48 color_prompt=
fi 49 49 fi
fi 50 50 fi
51 51
if [ "$color_prompt" = yes ]; then 52 52 if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 53 53 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else 54 54 else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 55 55 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi 56 56 fi
unset color_prompt force_color_prompt 57 57 unset color_prompt force_color_prompt
58 58
# If this is an xterm set the title to user@host:dir 59 59 # If this is an xterm set the title to user@host:dir
case "$TERM" in 60 60 case "$TERM" in
xterm*|rxvt*) 61 61 xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 62 62 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;; 63 63 ;;
*) 64 64 *)
;; 65 65 ;;
esac 66 66 esac
67 67
# enable color support of ls and also add handy aliases 68 68 # enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then 69 69 if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 70 70 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto' 71 71 alias ls='ls --color=auto'
#alias dir='dir --color=auto' 72 72 #alias dir='dir --color=auto'
#alias vdir='vdir --color=auto' 73 73 #alias vdir='vdir --color=auto'
74 74
alias grep='grep --color=auto' 75 75 alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto' 76 76 #alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto' 77 77 #alias egrep='egrep --color=auto'
fi 78 78 fi
79 79
# Less Colors for Man Pages 80 80 # Less Colors for Man Pages
man() 81 81 man()
{ 82 82 {
# begin blinking 83 83 # begin blinking
# begin bold 84 84 # begin bold
# end mode 85 85 # end mode
# end standout-mode 86 86 # end standout-mode
# begin standout-mode - info box & search results 87 87 # begin standout-mode - info box & search results
# end underline 88 88 # end underline
# begin underline 89 89 # begin underline
env LESS_TERMCAP_mb=$'\E[01;31m' \ 90 90 env LESS_TERMCAP_mb=$'\E[01;31m' \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \ 91 91 LESS_TERMCAP_md=$'\E[01;38;5;74m' \
LESS_TERMCAP_me=$'\E[0m' \ 92 92 LESS_TERMCAP_me=$'\E[0m' \
LESS_TERMCAP_se=$'\E[0m' \ 93 93 LESS_TERMCAP_se=$'\E[0m' \
LESS_TERMCAP_so=$'\E[42;5;246m' \ 94 94 LESS_TERMCAP_so=$'\E[7;49;35m' \
LESS_TERMCAP_ue=$'\E[0m' \ 95 95 LESS_TERMCAP_ue=$'\E[0m' \
LESS_TERMCAP_us=$'\E[04;38;5;146m' \ 96 96 LESS_TERMCAP_us=$'\E[04;38;5;146m' \
man "$@" 97 97 man "$@"
} 98 98 }
99 99
100 100
# ----------- 101 101 # -----------
# History 102 102 # History
# ----------- 103 103 # -----------
104 104
# don't put duplicate lines or lines starting with space in the history. 105 105 # don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options 106 106 # See bash(1) for more options
HISTCONTROL=ignoreboth 107 107 HISTCONTROL=ignoreboth
108 108
# append to the history file, don't overwrite it 109 109 # append to the history file, don't overwrite it
shopt -s histappend 110 110 shopt -s histappend
111 111
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 112 112 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000 113 113 HISTSIZE=1000
HISTFILESIZE=2000 114 114 HISTFILESIZE=2000
115 115
116 116
117 117
# ------------------- 118 118 # -------------------
# PATH 119 119 # PATH
# ------------------- 120 120 # -------------------
121 121
# include sbin in PATH 122 122 # include sbin in PATH
if [ -d "/sbin" ] ; then 123 123 if [ -d "/sbin" ] ; then
PATH="/sbin:$PATH" 124 124 PATH="/sbin:$PATH"
fi 125 125 fi
if [ -d "/usr/sbin" ] ; then 126 126 if [ -d "/usr/sbin" ] ; then
PATH="/usr/sbin:$PATH" 127 127 PATH="/usr/sbin:$PATH"
fi 128 128 fi
# set PATH so it includes user's private bin if it exists 129 129 # set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then 130 130 if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH" 131 131 PATH="$HOME/bin:$PATH"
fi 132 132 fi
133 133
134 134
135 135
# ------------------- 136 136 # -------------------
# Default Apps 137 137 # Default Apps
# ------------------- 138 138 # -------------------
139 139
export PAGER='less' 140 140 export PAGER='less'
export EDITOR='vim' 141 141 export EDITOR='vim'
142 142
143 143
144 144
# ------------------- 145 145 # -------------------
# Aliases 146 146 # Aliases
# ------------------- 147 147 # -------------------
148 148
# Alias definitions. 149 149 # Alias definitions.
if [ -f ~/.bash_aliases ]; then 150 150 if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases 151 151 . ~/.bash_aliases
fi 152 152 fi
153 153
alias untar="tar -xf" 154 154 alias untar="tar -xf"
155 155
# ls aliases 156 156 # ls aliases