-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash_profile
77 lines (60 loc) · 1.97 KB
/
bash_profile
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
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
[ -f /usr/local/etc/bash_completion.d ] && . /usr/local/etc/bash_completion.d
source ~/.nvm/nvm.sh # So nvm will be loaded and work
# Make it so OSX knows about our global gitignore file
git config --global core.excludesfile ~/.gitignore
source ~/dotfiles/git-completion.bash
__git_complete gch _git_checkout
__git_complete ga _git_add
__git_complete gpu _git_push
# Setting PS1
export PS1="\W @ \h [\u] $ "
# Colorscheme stuff
# BASE16_SHELL=$HOME/.config/base16-shell/
# [ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
# Path stuff
export PATH="$HOME/.node_modules_global/bin:$PATH:$HOME/dotfiles"
# Aliases
alias unraid='ssh [email protected]'
alias UMich='cd ~/Documents/UMich/2017-2018'
alias c++='g++ -Wall -Werror -pedantic -g -std=c++14'
# Git aliases
alias gs='git status'
alias gch='git checkout'
alias ga='git add '
alias gb='git branch '
alias gco='git commit '
alias gcof='git commit --amend --no-edit && git push --force'
alias gpl='git pull '
alias gpu='git push '
alias gm='git merge '
alias gd='git diff '
# Functions
function cmd() {
SECTION="# "
SECTION+="$@"
sed -n "/^$SECTION$/,/^$/p" $HOME/dotfiles/alwaysforget.txt
}
function killp() {
PORT=$1
PROCESSES=$(lsof -t -i :$PORT)
printf "Processes running at port $PORT:\n$(lsof -i :$PORT)\n"
read -p "Kill? (y/n)?" choice
case "$choice" in
y|Y )
echo "Killing processes at $PORT"
kill -kill "$PROCESSES"
;;
n|N ) echo "Exiting";;
* ) echo "Invalid choice";;
esac
}
# Tells FZF to use ag, only printing filenames, including hidden ones, and
# respecting .gitignore
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'
alias clr='clear'
# Vi mode in bash
set -o vi
export PATH="/usr/local/opt/openssl/bin:$PATH"
export PATH="/usr/local/opt/openssl/bin:$PATH"