-
Notifications
You must be signed in to change notification settings - Fork 0
/
_bashrc
64 lines (52 loc) · 1.59 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
set -o vi
PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title
PS1="$PS1"$'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change color
PS1="$PS1"'\u@\h ' # user@host<space>
PS1="$PS1"'\[\033[33m\]' # change color
PS1="$PS1"'\w' # current working directory
if test -z "$WINELOADERNOEXEC"
then
PS1="$PS1"'$(__git_ps1)' # bash function
fi
PS1="$PS1"'\[\033[0m\]' # change color
PS1="$PS1"$'\n' # new line
PS1="$PS1"'$ ' # prompt: always $
fu(){
find . -type f -name "$1" | xargs grep -nsiI "$2"
}
ful(){
find . -type f -name "$1" | xargs grep -siIl "$2"
}
function showRemote(){
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then
remote=$1
if [ -z $remote ]
then
remote=origin
fi
url=$(git remote show $remote | grep "Fetch URL" | cut -c 14- | sed -r -e 's/\w+@/http:\/\//' -e '
s/\.git$//' -e 's/\.com:/.com\//' -e 's/^\s*//')
platform=$(uname)
if [[ $platform == Cygwin* || $platform == MINGW* ]]; then
opencmd=start
elif [[ $platform == Darwin* ]]; then
opencmd=open
fi
$opencmd $url
else
echo 'Not in a Git repository'
fi
}
function gvim() {
"/c/Program Files (x86)/Vim/vim74/gvim.exe"
}
# delete the local branches for which the remote tracking branches have been pruned
function prune() {
git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -d
}
[[ -s $USERPROFILE/.pik/.pikrc ]] && source $USERPROFILE/.pik/.pikrc
# source other startup files
for file in ~/.bash_startup/*; do
. $file
done