-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
89 lines (72 loc) · 2.44 KB
/
.bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# ~/.bashrc: executed by bash(1) for non-login shells.
# if not running interactively, don't do anything
if [[ -z "$PS1" ]]; then
return
fi
# enable vi editing-mode
#set -o vi
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS
shopt -s checkwinsize
# enable extended pattern-matching features
shopt -s extglob
# expand aliases
shopt -s expand_aliases
# append to the history file, don't overwrite it
shopt -s histappend
# reload failed history expansion into readline editing buffer
shopt -s histreedit
# load expanded history substitution into readline editing buffer
shopt -s histverify
# attempt hostname expansion when @ is at the beginning of a word
shopt -s hostcomplete
# don't search for completions on an empty line
shopt -s no_empty_cmd_completion
# set variable identifying the chroot you work in (used in prompt below)
#if [[ -z "${debian_chroot:-}" ]] && [[ -r "/etc/debian_chroot" ]]; then
# debian_chroot="$(cat /etc/debian_chroot)"
#fi
#
#if [[ -r "/etc/debian_version" ]]; then
# ...
#fi
#
#PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
# set color prompt according to local/remote and root/user
if [[ -z "$SSH_CLIENT" ]] && [[ -z "$SSH_CONNECTION" ]] && [[ -z "$SSH_TTY" ]]; then
if [[ "$(whoami)" = "root" ]]; then
PS1='\[$RED\]\u\[$BLACK\]@\[$BLACK\]\h\[$nocolor\] \[$white\]\w\[$nocolor\] \[$BLACK\]>>\[$nocolor\] '
else
PS1='\[$BLACK\]\u\[$BLACK\]@\[$BLACK\]\h\[$nocolor\] \[$white\]\w\[$nocolor\] \[$BLACK\]>>\[$nocolor\] '
fi
else
if [[ "$(whoami)" = "root" ]]; then
PS1='\[$RED\]\u\[$BLACK\]@\[$BLACK\]\h\[$nocolor\] \[$white\]\w\[$nocolor\] \[$BLACK\]\$\[$nocolor\] '
else
PS1='\[$BLACK\]\u\[$BLACK\]@\[$BLACK\]\h\[$nocolor\] \[$white\]\w\[$nocolor\] \[$BLACK\]\$\[$nocolor\] '
fi
fi
# aliases
if [[ -r "$HOME/.bash_aliases" ]]; then
source "$HOME/.bash_aliases"
fi
# colors
if [[ -r "$HOME/.bash_colors" ]]; then
source "$HOME/.bash_colors"
fi
# functions
if [[ -r "$HOME/.bash_functions" ]]; then
source "$HOME/.bash_functions"
fi
# enable programmable completion features
#if [[ "$(uname -s)" = "Linux" ]]; then
# if [[ -r "/usr/share/bash-completion/bash_completion" ]]; then
# source "/usr/share/bash-completion/bash_completion"
# elif [[ -r "/etc/bash_completion" ]]; then
# source "/etc/bash_completion"
# fi
#fi
# make less more friendly for non-text input files, see lesspipe(1)
#if [[ -x "/usr/bin/lesspipe" ]]; then
# eval "$(lesspipe)"
#fi