2022-04-22 10:06:53 -04:00
|
|
|
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${PATH}"
|
|
|
|
export LANG='en_US.UTF-8'
|
2022-04-27 23:17:40 -04:00
|
|
|
export PAGER='less -RF'
|
2022-04-22 10:06:53 -04:00
|
|
|
|
|
|
|
for editor in nvim vim nano; do
|
|
|
|
if command -v "$editor" &> /dev/null; then
|
|
|
|
export EDITOR="$editor"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2023-06-16 13:29:48 -04:00
|
|
|
if command -v rg &> /dev/null; then
|
|
|
|
export RIPGREP_CONFIG_PATH="${HOME}/.config/ripgrep/ripgreprc"
|
|
|
|
fi
|
|
|
|
|
2022-04-22 10:06:53 -04:00
|
|
|
# if we're in vs code's terminal, set the editor to vs code
|
|
|
|
if [ "${TERM_PROGRAM:-noop}" = "vscode" ]; then
|
2023-05-23 20:44:11 -04:00
|
|
|
if [[ "$TERM_PROGRAM_VERSION" =~ -insider$ ]] && command -v code-insiders &> /dev/null; then
|
|
|
|
export EDITOR='code-insiders'
|
|
|
|
alias code=code-insiders
|
|
|
|
else
|
|
|
|
export EDITOR='code'
|
|
|
|
fi
|
|
|
|
|
|
|
|
export TAG_CMD_FMT_STRING="${EDITOR} --goto {{.Filename}}:{{.LineNumber}}:{{.ColumnNumber}}"
|
2022-04-22 10:06:53 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
export VISUAL="${EDITOR}"
|
|
|
|
|
2022-12-09 01:19:47 -05:00
|
|
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
2022-08-22 20:38:28 -04:00
|
|
|
if [ -x /opt/homebrew/bin/brew ]; then
|
|
|
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
|
|
|
fi
|
2022-08-22 21:52:38 -04:00
|
|
|
|
|
|
|
# Use GNU tools if they're installed :D
|
|
|
|
for d in "${HOMEBREW_PREFIX}/opt"/*/libexec/gnubin; do
|
|
|
|
export PATH="$d:$PATH"
|
|
|
|
done
|
2022-11-28 22:27:56 -05:00
|
|
|
|
|
|
|
for TEST_PATH in /Applications/Tailscale{.localized,}/Tailscale.app/Contents/MacOS/Tailscale; do
|
|
|
|
if [ -x "$TEST_PATH" ]; then
|
|
|
|
alias tailscale="$TEST_PATH"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2022-08-22 20:38:28 -04:00
|
|
|
fi
|
|
|
|
|
2022-04-22 10:06:53 -04:00
|
|
|
if [ -d "${HOME}/bin" ]; then
|
|
|
|
export PATH="${HOME}/bin:${PATH}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "${HOME}/.local/bin" ]; then
|
|
|
|
export PATH="${HOME}/.local/bin:$PATH"
|
|
|
|
fi
|
|
|
|
|
2022-08-22 21:37:55 -04:00
|
|
|
if [ -d "${HOME}/.poetry/bin" ]; then
|
|
|
|
export PATH="${HOME}/.poetry/bin:$PATH"
|
|
|
|
fi
|
|
|
|
|
2022-04-22 10:06:53 -04:00
|
|
|
. "$HOME/.cargo/env" 2>/dev/null
|
|
|
|
|
2022-12-09 01:19:47 -05:00
|
|
|
if command -v pnpm &> /dev/null; then
|
|
|
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
|
|
|
export PNPM_HOME="${HOME}/Library/pnpm"
|
|
|
|
export PATH="$PNPM_HOME:$PATH"
|
2023-02-13 21:26:19 -05:00
|
|
|
mkdir -p "$PNPM_HOME"
|
2022-12-09 01:19:47 -05:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-04-22 10:06:53 -04:00
|
|
|
if command -v go &> /dev/null; then
|
|
|
|
GOPATH="$(go env GOPATH)"
|
|
|
|
if [ -d "${GOPATH}" ]; then
|
|
|
|
export GOPATH
|
|
|
|
export PATH="${GOPATH}/bin:${PATH}"
|
|
|
|
else
|
|
|
|
unset GOPATH
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
. /etc/profile.d/flatpak.sh 2>/dev/null
|
|
|
|
|
|
|
|
# if rootless docker has a unix domain socket, use it!
|
|
|
|
if [ -e "${XDG_RUNTIME_DIR}/docker.sock" ]; then
|
|
|
|
export DOCKER_HOST="unix://${XDG_RUNTIME_DIR}/docker.sock"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if command -v fzf &> /dev/null && command -v ag &> /dev/null; then
|
|
|
|
export FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores --nocolor -g "" -l'
|
|
|
|
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
|
|
|
|
fi
|
2022-04-26 10:44:37 -04:00
|
|
|
|
|
|
|
typeset -U path
|
2022-08-22 23:15:29 -04:00
|
|
|
|
|
|
|
# this is a hack to prevent MacOS from being smarter than us for PATH settings
|
|
|
|
/usr/libexec/path_helper() :
|