|
0 |
# ~/.bashrc: executed by bash(1) for non-login shells.
|
|
1 |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
|
2 |
# for examples
|
|
3 |
|
|
4 |
# If not running interactively, don't do anything
|
|
5 |
case $- in
|
|
6 |
*i*) ;;
|
|
7 |
*) return;;
|
|
8 |
esac
|
|
9 |
|
|
10 |
# don't put duplicate lines or lines starting with space in the history.
|
|
11 |
# See bash(1) for more options
|
|
12 |
HISTCONTROL=ignoreboth
|
|
13 |
|
|
14 |
# append to the history file, don't overwrite it
|
|
15 |
shopt -s histappend
|
|
16 |
|
|
17 |
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
|
18 |
HISTSIZE=1000
|
|
19 |
HISTFILESIZE=2000
|
|
20 |
|
|
21 |
# check the window size after each command and, if necessary,
|
|
22 |
# update the values of LINES and COLUMNS.
|
|
23 |
shopt -s checkwinsize
|
|
24 |
|
|
25 |
# If set, the pattern "**" used in a pathname expansion context will
|
|
26 |
# match all files and zero or more directories and subdirectories.
|
|
27 |
#shopt -s globstar
|
|
28 |
|
|
29 |
# make less more friendly for non-text input files, see lesspipe(1)
|
|
30 |
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
|
31 |
|
|
32 |
# set variable identifying the chroot you work in (used in the prompt below)
|
|
33 |
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
|
34 |
debian_chroot=$(cat /etc/debian_chroot)
|
|
35 |
fi
|
|
36 |
|
|
37 |
# set a fancy prompt (non-color, unless we know we "want" color)
|
|
38 |
case "$TERM" in
|
|
39 |
xterm-color) color_prompt=yes;;
|
|
40 |
esac
|
|
41 |
|
|
42 |
# uncomment for a colored prompt, if the terminal has the capability; turned
|
|
43 |
# off by default to not distract the user: the focus in a terminal window
|
|
44 |
# should be on the output of commands, not on the prompt
|
|
45 |
force_color_prompt=yes
|
|
46 |
|
|
47 |
if [ -n "$force_color_prompt" ]; then
|
|
48 |
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
|
49 |
# We have color support; assume it's compliant with Ecma-48
|
|
50 |
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
|
51 |
# a case would tend to support setf rather than setaf.)
|
|
52 |
color_prompt=yes
|
|
53 |
else
|
|
54 |
color_prompt=
|
|
55 |
fi
|
|
56 |
fi
|
|
57 |
|
|
58 |
if [ "$color_prompt" = yes ]; then
|
|
59 |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
|
60 |
else
|
|
61 |
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
|
62 |
fi
|
|
63 |
unset color_prompt force_color_prompt
|
|
64 |
|
|
65 |
# If this is an xterm set the title to user@host:dir
|
|
66 |
case "$TERM" in
|
|
67 |
xterm*|rxvt*)
|
|
68 |
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
|
69 |
;;
|
|
70 |
*)
|
|
71 |
;;
|
|
72 |
esac
|
|
73 |
|
|
74 |
# enable color support of ls and also add handy aliases
|
|
75 |
if [ -x /usr/bin/dircolors ]; then
|
|
76 |
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
77 |
alias ls='ls --color=auto'
|
|
78 |
#alias dir='dir --color=auto'
|
|
79 |
#alias vdir='vdir --color=auto'
|
|
80 |
|
|
81 |
#alias grep='grep --color=auto'
|
|
82 |
#alias fgrep='fgrep --color=auto'
|
|
83 |
#alias egrep='egrep --color=auto'
|
|
84 |
fi
|
|
85 |
|
|
86 |
# some more ls aliases
|
|
87 |
#alias ll='ls -l'
|
|
88 |
#alias la='ls -A'
|
|
89 |
#alias l='ls -CF'
|
|
90 |
|
|
91 |
# Alias definitions.
|
|
92 |
# You may want to put all your additions into a separate file like
|
|
93 |
# ~/.bash_aliases, instead of adding them here directly.
|
|
94 |
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
|
95 |
|
|
96 |
if [ -f ~/.bash_aliases ]; then
|
|
97 |
. ~/.bash_aliases
|
|
98 |
fi
|
|
99 |
|
|
100 |
# enable programmable completion features (you don't need to enable
|
|
101 |
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
|
102 |
# sources /etc/bash.bashrc).
|
|
103 |
if ! shopt -oq posix; then
|
|
104 |
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
|
105 |
. /usr/share/bash-completion/bash_completion
|
|
106 |
elif [ -f /etc/bash_completion ]; then
|
|
107 |
. /etc/bash_completion
|
|
108 |
fi
|
|
109 |
fi
|