forked from darkowlzz/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc
77 lines (52 loc) · 1.8 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
platform=$(uname);
if [[ $platform == 'Darwin' ]]; then
# Use a long listing format
alias ll='ls -la'
# Show hidden files
alias l.='ls -d .* --color=auto'
# System sleep
alias goodnight='pmset sleepnow'
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# vagrant-completion
if [ -f `brew --prefix`/etc/bash_completion.d/vagrant ]; then
source `brew --prefix`/etc/bash_completion.d/vagrant
fi
elif [[ $platform == 'Linux' ]]; then
# Colorize the ls output
alias ls='ls --color=auto'
# Use a long listing format
alias ll='ls -la'
# Show hidden files
alias l.='ls -d .* --color=auto'
fi
# PS1 with git branch
PS1='\[\e[0;32m\]\u@\[\e[1;34m\]\h\[\e[0m\]\[\e[0m\]:\[\e[1;31m\]\W\[\e[0;32m\]$(__git_ps1 " (%s)")\[\e[0;39m\]\$ '
# Load git-completion
source ~/git-completion.bash
# Load git-prompt
source ~/.git-prompt.sh
# Indicate staged and non-staged changes
GIT_PS1_SHOWDIRTYSTATE=1
# Check Internet connection
alias pingg="ping -s 0 8.8.8.8"
# Show size of file or dir
alias sizeof="du -sh"
# Show system storage info
alias space="df -h"
# Show what's running on a given port
alias onport="lsof -i"
# tmux(Screen) aliases
alias mv+="tmux swap-window -t +1" # move window to right
alias mv-="tmux swap-window -t -1" # move window to left
# nvm setup
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# Source nvm bash completion
[[ -r $NVM_DIR/bash_completion ]] && . $NVM_DIR/bash_completion
nvm alias default 5 &> /dev/null
# rvm setup
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
[[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion
rvm use 2 --default &> /dev/null