-
Notifications
You must be signed in to change notification settings - Fork 0
/
bob-profile.j2
91 lines (79 loc) · 2.47 KB
/
bob-profile.j2
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
# vim:syntax=sh filetype=sh
export EDITOR=vim
NVM_SH="$HOMEBREW_PREFIX/opt/nvm/nvm.sh"
NVM_BASH="$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion"
export NVM_DIR="$HOME/.nvm"
[ -s $NVM_SH ] && . $NVM_SH # This loads nvm
[ -s $NVM_BASH ] && . $NVM_BASH # This loads nvm bash_completion
# loads fzf
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
# Binds Ctrl+t to open file in vim
vim_fzf() {
vim "$(fzf)"
}
bind -x '"\C-t": vim_fzf'
#Open VS Code in working dir
vscode () {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
open -a "Visual Studio Code" --args "$F"
fi
}
#git goodies
export GIT_MERGE_AUTOEDIT=no
source {{ ansible_user_dir }}/code/dotfiles/git-completion.bash
# silence OSX catalina error
export BASH_SILENCE_DEPRECATION_WARNING=1
# Go stuff
export PATH="$HOMEBREW_PREFIX/bin/go:$PATH"
# Looks for a branch based on param
# then will check it out
findBranch() {
git find $1;
}
#git aliases
alias gf='git fetch --verbose --prune'
alias gfa='git fetch --all --verbose --prune'
alias gco='git checkout'
alias gu='git up'
alias gc='git c'
alias gjc='git jc'
alias gp='git push -u'
alias gpf='git push --force-with-lease origin'
alias gst='git st'
alias gfb=findBranch
alias gbr='git br'
alias gdv='git diff | vim -'
alias gs='git s'
#CD aliases
alias ..="cd .."
alias ...="cd ../.."
alias .4="cd ../../.."
alias .5="cd ../../../.."
alias .6="cd ../../../.."
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias c="cd ~/code"
alias h="cd ~/"
alias ls=exa # ls sucks exa ftw!
alias lsn="exa -lsnew" # display long sort by newest
alias lso="exa -lsold" # display long sort by oldest
alias mybox="ssh -p49155 bizob2828@bob-pc"
alias linuxbox="ssh -p49155 bizob2828@linux-box"
alias pihole="ssh -p49157 pi@pihole"
alias prune_branches="git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d"
alias kill-whale="docker system prune -a --volumes"
alias stop-containers='docker kill $(docker ps -q)'
alias flush-dns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder && echo \"DNS cache flushed successfully\""
alias xcode-fix="sudo rm -rf /Library/Developer/CommandLineTools && xcode-select --install"
findPort() {
sudo lsof -i -P | grep LISTEN | grep ":$1"
}
alias open-port=findPort
#re source bash_profile
alias sbp="source ~/.bash_profile"
export PATH=$PATH:{{ ansible_user_dir }}/code/gitplus/commands
eval "$(starship init bash)"