aboutsummaryrefslogtreecommitdiff
path: root/runcoms/zshrc
blob: 1683eeab17f7e2e18f10e55645c78ac64c1fa5af (plain)
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
92
93
94
95
96
97
98
99
################################################################################
# Load Functions
################################################################################
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/dotenv.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/graphviz.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/short-uptime.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/figlet-sample.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/prettify-json.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/status.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/sync-repos.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/check-repos.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/ssh-key-helpers.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/todoist.zsh"

################################################################################
# Load Modules
################################################################################
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/environment.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/editor.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/history.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/directory.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/prompt.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/vendor/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/completion.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/aliases.zsh"
source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/color.zsh"

################################################################################
# ENV VARIABLES
################################################################################
# Terminal related
export TERM=xterm-256color

# Paths
# export JAVA_HOME=$(/usr/libexec/java_home) # Enable if using JDK, otherwise disable for performance
export XDG_CONFIG_HOME=$HOME/.config
export GOPATH=$HOME/projects/go
export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle
export PATH=$PATH:$HOME:${GOPATH//://bin:}/bin
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_NDK_HOME:/Applications/calibre.app/Contents/MacOS

# GPG
export GPG_TTY=$(tty)

# FZF Config
[ -x "$(command -v fzf)" ] && source <(fzf --zsh)

export FZF_DEFAULT_COMMAND='/usr/bin/env rg --color never --files --hidden -g \!.git'
export FZF_DEFAULT_OPTS='--preview ''bat --style=numbers --color=always {} | head -500'''

export MANPAGER='nvim +Man!'
[ -x "$(command -v jj)" ] && source <(COMPLETE=zsh jj)

################################################################################
# SECRET ENV VARS!!
################################################################################

if [[ -s "${ZDOTDIR:-$HOME}/.secrets.zsh" ]]; then
  source "${ZDOTDIR:-$HOME}/.secrets.zsh"
fi

# Load a local config

if [[ -s "${ZDOTDIR:-$HOME}/.zshrc.local" ]]; then
  source "${ZDOTDIR:-$HOME}/.zshrc.local"
fi

if [[ -s "/opt/homebrew/bin/brew" ]]; then
  # Brew Setup
  export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:$PATH
  export FZF_VIM_PATH=/opt/homebrew/opt/fzf
  . /opt/homebrew/etc/profile.d/z.sh
else
  # Z (Linux)
  if [[ -s "/usr/libexec/z.sh" ]]; then
    . /usr/libexec/z.sh
  else
    if [[ -s "/usr/share/z/z.sh" ]]; then
      . /usr/share/z/z.sh
    else
      . /usr/local/etc/profile.d/z.sh
    fi
  fi
fi

# ASDF
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"

if [[ -s "$HOME/.cargo/env" ]]; then
. "$HOME/.cargo/env"
fi

if [[ -s "~/.asdf/plugins/java/set-java-home.zsh" ]]; then
  . ~/.asdf/plugins/java/set-java-home.zsh
fi

# Difftastic
export DFT_BACKGROUND=light