forked from spalmurray/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
83 lines (70 loc) · 2.4 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
78
79
80
81
82
83
#
# ~/.bashrc
#
# macos stuff
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/Applications/Docker.app/Contents/Resources/bin:$PATH"
alias python='python3'
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
export BASH_SILENCE_DEPRECATION_WARNING=1
export SHELL="/opt/homebrew/bin/bash"
# Bash history config
export HISTSIZE=
export HISTFILESIZE=
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
export PS1="\[\e[31m\]\u\]\e[37m\]@\e[33m\]work\e[37m\]:\e[32m\]\w \e[37m\]\n\\$ "
# GPG
unset SSH_AGENT_PID
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
export GPG_TTY=$(tty)
gpgconf --launch gpg-agent
export HOME=/Users/spencer
alias gpgtty='gpg-connect-agent updatestartuptty /bye > /dev/null'
# Aliases
alias vim=nvim
alias c=clear
alias t='tmux attach || tmux'
alias ls='ls --color=auto'
alias nukedocker='docker system prune -af && docker volume prune -af'
# git aliases
alias gs='git status'
alias ga='git add'
alias gc='git commit -S -m'
alias gcob='git checkout -b'
alias gco='git checkout $(git branch -l | fzf)'
alias gcom='git checkout main'
alias gd='git diff'
alias gr='git rebase $(git branch -l | fzf)'
alias gp='gpgtty && git pull'
alias gpu='gpgtty && git push'
alias gpuo='gpgtty && git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)'
alias gu='CURRENT_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) && gpgtty && git checkout main && git pull && git checkout $CURRENT_GIT_BRANCH && git rebase main'
# git autocomplete
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
. `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi
# Exports
export PATH=$PATH:~/bin/
export PATH=$PATH:"$HOME.local/bin"
export SUDO_EDITOR=vim
export EDITOR=vim
export XDG_CONFIG_HOME="$HOME/.config"
# Use vim binds
set -o vi
# enable globstar
shopt -s globstar
# zoxide init
eval "$(zoxide init bash)"
# fzf init
export FZF_DEFAULT_COMMAND='find ~'
export FZF_DEFAULT_OPTS='--border'
bind -m emacs-standard '"\C-f": " \C-b\C-k \C-u`__fzf_cd__`\e\C-e\er\C-m\C-y\C-h\e \C-y\ey\C-x\C-x\C-d"'
bind -m vi-command '"\C-f": "\C-z\C-f\C-z"'
bind -m vi-insert '"\C-f": "\C-z\C-f\C-z"'
eval "$(fzf --bash)"
# volta
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"