-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_bashrc
More file actions
90 lines (70 loc) · 1.86 KB
/
Copy path_bashrc
File metadata and controls
90 lines (70 loc) · 1.86 KB
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
90
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
#MacOS is different - set some variables.
if [ "$(uname)" == "Darwin" ]; then
export CLICOLOR=1
alias ls='ls -GFh'
fi
# User specific aliases and functions
# These are easier to see on dark terminals
# which I tend to use. Helps my color-
# blindness. (Red/Green)
LS_COLORS='di=01;35:fi=00:ln=01;36'
#### PROMPT ####
# Set colors we use in the prompt
NO_COLOR="\[\033[0m\]"
CYAN="\[\033[0;36m\]"
GREEN="\[\033[0;32m\]"
RED="\[\033[0;31m\]"
ORANGE="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
GREY="\[\033[0;37m\]"
# if we're root or equivalent - we want to signify that slightly
# I change the user portion of the prompt red for this.
if [[ $EUID == "0" ]];
then
USER_COLOR=$RED
else
USER_COLOR=$GREY
fi
# Decoration
if [ "$(uname)" == "Linux" ]
then
OSLOGO=🐧
elif [ "$(uname)" == "Darwin" ]
then
OSLOGO=APPLE
else
OSLOGO="" # Default to nothing.
fi
PS1="$OSLOGO $GREEN[$USER_COLOR\u$CYAN@$YELLOW\h$GREEN] $ORANGE:$CYAN\w$GREY\$ $NO_COLOR"
# Remove Aliases
# I dislike that rm is usually alised to prompt
# and I don't use ll
# The redirect supresses output in case they weren't
# previously aliased.
unalias ll 2>/dev/null
unalias l. 2>/dev/null
unalias rm 2>/dev/null
# Add aliases for ls
alias ls="ls --color=auto"
# systemd adds a bunch of mounts, supress them in df
alias df="df -x tmpfs -x devtmpfs -x efivarfs"
#Support for MacOS brew installation path of gnu utilities
#if [ "$(uname)" == "Darwin" ] && [ -d /usr/local/opt/coreutils/libexec/gnubin ]; then
# PATH=/usr/local/bin;/usr/local/opt/coreutils/libexec/gnubin:$PATH
#fi
#### Optional Paths ####
for PATHDIR in ~/minishift ~/.local/bin
do
if [ -d $PATHDIR ]
then
PATH=$PATHDIR:$PATH
fi
done
export PAGER=more
export EDITOR=vim
export PATH