-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
94 lines (80 loc) · 2.24 KB
/
Copy pathbashrc
File metadata and controls
94 lines (80 loc) · 2.24 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
91
92
93
94
### Bash profile for Diego Mosela
# aliases
alias l='ls -1sh --group-directories-first'
alias la='ls -lah --group-directories-first'
alias ll='ls -lh --group-directories-first'
alias ls='ls -sh --color=auto --group-directories-first'
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# colored terminal
test -n "$DISPLAY" && export TERM=xterm-color
# editor
export EDITOR="vim"
# path
export PATH="~/bin:/usr/local/bin:$PATH"
# nodejs
export NODE_ENV="development"
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
# colors
Black="$(tput setaf 0)"
BlackBG="$(tput setab 0)"
DarkGrey="$(tput bold ; tput setaf 0)"
LightGrey="$(tput setaf 7)"
LightGreyBG="$(tput setab 7)"
White="$(tput bold ; tput setaf 7)"
Red="$(tput setaf 1)"
RedBG="$(tput setab 1)"
LightRed="$(tput bold ; tput setaf 1)"
Green="$(tput setaf 2)"
GreenBG="$(tput setab 2)"
LightGreen="$(tput bold ; tput setaf 2)"
Brown="$(tput setaf 3)"
BrownBG="$(tput setab 3)"
Yellow="$(tput bold ; tput setaf 3)"
Blue="$(tput setaf 4)"
BlueBG="$(tput setab 4)"
LightBlue="$(tput bold ; tput setaf 4)"
Purple="$(tput setaf 5)"
PurpleBG="$(tput setab 5)"
Pink="$(tput bold ; tput setaf 5)"
Cyan="$(tput setaf 6)"
CyanBG="$(tput setab 6)"
LightCyan="$(tput bold ; tput setaf 6)"
NC="$(tput sgr0)"
# git status
function git_prompt {
STATUS=`git status 2>&1`
if [[ "$STATUS" == *'Not a git repository'* ]]
then
echo ''
else
if [[ "$STATUS" == *'working directory clean'* ]]
then
echo -e '-clean'
else
echo -e '-dirty'
fi
fi
}
# git branch
function git_info {
ref=$(git symbolic-ref HEAD 2> /dev/null)
gitInfo=""
if [[ -n $ref ]]
then
echo -e "git:($Red${ref#refs/heads/}$Blue)"
fi
}
# powerline-bash
function make_ps1() {
$PROMPT_COMMAND_EXTRAS
export PS1='\[$Blue\]\u\[$Red\] → \[$LightCyan\]\w/ \[$Blue\]\[$(git_info)\]\[$Brown\]\[$(git_prompt)\] '
export PS1=$PS1'\n\[$Yellow\]$\[$NC\] '
}
export PROMPT_COMMAND=make_ps1