Eric Bower
·
2024-08-24
zshrc
1# Path to your oh-my-zsh installation.
2export ZSH="$HOME/.oh-my-zsh"
3export EDITOR="nvim"
4export VISUAL="nvim"
5export GPG_TTY=$(tty)
6export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#bd93f9,underline"
7export XDG_CONFIG_HOME="$HOME/.config"
8
9# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
10ZSH_THEME="robbyrussell"
11
12# Required installations
13# https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md#oh-my-zsh
14# https://github.com/zsh-users/zsh-completions#oh-my-zsh
15# https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md#oh-my-zsh
16plugins=(zsh-completions zsh-autosuggestions zsh-syntax-highlighting docker-compose history bundler)
17
18source $ZSH/oh-my-zsh.sh
19
20# zsh-autosuggetion ctrl+space
21bindkey '^ ' autosuggest-accept
22# zsh-completions
23autoload -U compinit && compinit
24# load zsh completions
25fpath=(~/.zsh.d/ $fpath)
26# manual completions
27zstyle ':completion:*:manuals' separate-sections true
28zstyle ':completion:*:manuals.*' insert-sections true
29zstyle ':completion:*:man:*' menu yes select
30
31alias vimdiff='nvim -d'
32alias gu="git remote update --prune"
33alias ga="git add -A"
34alias gm="git commit -S"
35alias gs="git commit -S --amend --no-edit"
36alias gl="git --no-pager log --oneline -n 30"
37alias gt="git log --graph --oneline --all"
38alias pushall="git remote | xargs -I R git push R"
39alias tmux="tmux -u"
40alias scratch="nvim ~/scratch.md"
41alias bcp='rsync -avzu --progress'
42alias weather='curl wttr.in/Ann+Arbor+Michigan'
43alias dhe="distrobox-host-exec"
44alias img="img2sixel"
45
46export PATH="$PATH:/usr/local/bin:$HOME/.local/bin:$HOME/bin"
47
48case "$OSTYPE" in
49 darwin*)
50 setopt NO_NOMATCH
51 alias aptible-login="aptible login --lifetime 7days --email eric.bower@aptible.com"
52 alias pss='aws-vault exec prod ~/work/pancake/bin/pancake stack:ssh eric'
53 alias aptible-eric="DOMAIN=aptible-sandbox.com SUBDOMAIN_SUFFIX=eric APTIBLE_AUTH_ROOT_URL=https://auth-eric.aptible-sandbox.com APTIBLE_API_ROOT_URL=https://api-eric.aptible-sandbox.com APTIBLE_REMOTE=eric"
54 export PATH="/opt/homebrew/opt/libpq/bin:/opt/homebrew/bin:/Users/eric/.deno/bin:/usr/local/sbin:$PATH"
55 export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
56 alias sbx-main='DOMAIN=aptible-sandbox.com SUBDOMAIN_SUFFIX=sbx-main APTIBLE_AUTH_ROOT_URL=https://auth-sbx-main.aptible-sandbox.com APTIBLE_API_ROOT_URL=https://api-sbx-main.aptible-sandbox.com APTIBLE_REMOTE=sbx-main'
57 gpgconf --launch gpg-agent
58
59 source /opt/homebrew/opt/chruby/share/chruby/chruby.sh
60
61 export NVM_DIR="$HOME/.config/nvm"
62 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
63 [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
64 ;;
65 linux*)
66 # alias paclean="sudo pacman -Rs $(sudo pacman -Qqtd)"
67 # ncdu to see folder sizes
68 # imv for pictures
69 # thunar for gui file manager
70 # alias webcam="mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0"
71 alias inbox="mlist $MDIR/INBOX"
72
73 export VDIRSYNCER_CONFIG="$HOME/.config/vdirsyncer/config"
74 export MDIR="$HOME/mail"
75 export MOZ_ENABLE_WAYLAND=1
76 # https://github.com/qutebrowser/qutebrowser/discussions/7938#discussioncomment-8672918
77 # export QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor
78
79 eval $(keychain --eval --quiet --agents ssh,gpg ~/.ssh/id_ed25519 76D3FD02)
80 export PATH="/home/erock/.deno/bin:/home/erock/.yarn/bin:/home/erock/go/bin:/home/erock/.npm-packages/bin:/opt/nvim-linux64/bin:/home/erock/nvim/bin:$PATH"
81 ;;
82esac
83
84if [ -x "$(command -v direnv)" ]; then
85 eval "$(direnv hook zsh)"
86fi
87
88export PROMPT='%{$fg[yellow]%}@%M %{$fg_bold[green]%}%c%{$reset_color%} $(git_prompt_info)'