dotfiles/lib/env.zsh

125 lines
2.8 KiB
Bash
Raw Normal View History

2022-08-13 13:26:55 -05:00
#!/usr/bin/env zsh
2021-12-08 09:38:24 -06:00
# XDG
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
2022-03-29 12:40:10 -05:00
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.local/cache}"
2021-12-08 09:38:24 -06:00
2022-01-21 10:06:52 -06:00
export HISTFILE=~/.zsh_history
2022-01-18 12:29:42 -06:00
export HISTSIZE=32768
export HISTFILESIZE="${HISTSIZE}"
2021-12-08 09:38:24 -06:00
export SAVEHIST=4096
export HISTCONTROL=ignoredups:erasedups
export LESS='-R'
2022-12-17 21:09:05 -06:00
export LS_COLORS="ow=1;34:tw=1;34:st=00;"
2021-12-08 09:38:24 -06:00
2022-04-13 00:53:34 -05:00
# add completions to fpath
2022-06-20 15:05:05 -05:00
fpath=($DOTFILES_DIR/lib/completions $fpath)
2022-04-13 00:53:34 -05:00
2021-12-08 09:38:24 -06:00
# Append to the history file, rather than overwriting it
setopt APPEND_HISTORY
# Disable autocd
unsetopt autocd
# Vim Settings
# export VIMINIT='source $MYVIMRC'
2022-06-20 15:05:05 -05:00
# export MYVIMRC='$DOTFILES_DIR/lib/.vimrc'
2022-08-04 00:26:32 -05:00
2022-01-27 10:41:14 -06:00
if is-executable lvim; then
2022-03-02 12:58:49 -06:00
export EDITOR=lvim
2022-01-27 10:41:14 -06:00
elif is-executable nvim; then
2021-12-08 09:38:24 -06:00
export EDITOR=nvim
else
export EDITOR=vim
fi
# spelling correction
# setopt CORRECT
# setopt CORRECT_ALL
# Setup fzf
# ---------
2022-12-01 14:30:31 -06:00
# if [[ $PATH != *$HOME/.fzf/bin* ]]; then
# export PATH="${PATH:+${PATH}:}$HOME/.fzf/bin"
# fi
2021-12-08 09:38:24 -06:00
# ---------
# Add lfcd command
# ----------------
if is-executable lf; then
source "$XDG_CONFIG_HOME/lf/lfcd.sh"
fi
# ----------------
2022-12-01 14:30:31 -06:00
#
2022-12-09 14:24:46 -06:00
if is-executable fnm && ! is-tty; then
eval "$(fnm env --shell zsh)"
fi
2022-12-01 14:30:31 -06:00
#
2022-01-19 15:12:29 -06:00
if is-executable bat; then
2022-04-29 10:36:13 -05:00
export BAT_THEME=Catppuccin
2022-03-02 12:58:49 -06:00
export BAT_STYLE=header,numbers,grid
2022-01-19 15:12:29 -06:00
fi
2022-02-08 09:38:03 -06:00
if is-executable zoxide; then
2022-03-02 12:58:49 -06:00
export _ZO_FZF_OPTS="--preview 'command lsd --tree --color always --icon always {2..}'"
2022-02-08 09:38:03 -06:00
fi
2021-12-08 09:38:24 -06:00
export ENHANCD_DOT_ARG="up"
2022-05-18 00:21:46 -05:00
if is-tty; then
2022-06-04 11:46:08 -05:00
export STARSHIP_CONFIG=~/.config/starship/plain.toml
2022-05-18 00:21:46 -05:00
else
2022-06-04 11:46:08 -05:00
export STARSHIP_CONFIG=~/.config/starship/config.toml
2022-05-18 00:21:46 -05:00
fi
2021-12-08 09:38:24 -06:00
export EGET_BIN=$HOME/bin
# for dotenv
export ZSH_DOTENV_ALLOWED_LIST=$HOME/.cache/dotenv-allowed.list
export ZSH_DOTENV_DISALLOWED_LIST=$HOME/.cache/dotenv-disallowed.list
2022-02-13 19:41:41 -06:00
# mamba
export MAMBA_NO_BANNER=1
2022-04-15 08:40:14 -05:00
# shiv
2022-04-15 08:41:08 -05:00
if is-executable shiv; then
export SHIV_ROOT=$HOME/.local/share/shiv
2022-04-15 08:40:14 -05:00
fi
# pyenv
2022-06-04 11:46:08 -05:00
if [ -d "$HOME/.pyenv" ]; then
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
2022-06-04 11:46:08 -05:00
# pnpm
2022-09-29 10:18:29 -05:00
export PNPM_HOME="$HOME/.local/share/pnpm"
2022-12-01 14:30:31 -06:00
# export PATH="$PNPM_HOME:$PATH"
add-to-path prepend "$PNPM_HOME:$PATH"
2022-08-12 08:59:20 -05:00
if [ -d "$HOME/.pkgs/google-cloud-sdk" ]; then
2022-09-29 10:18:29 -05:00
source "$HOME/.pkgs/google-cloud-sdk/completion.zsh.inc"
2022-12-01 14:30:31 -06:00
# source "$HOME/.pkgs/google-cloud-sdk/path.zsh.inc"
add-to-path prepend "$HOME/.pkgs/google-cloud-sdk/bin"
2022-08-12 08:59:20 -05:00
fi
2022-08-18 13:17:52 -05:00
if [ -d "$HOME/.deno" ]; then
2022-09-29 10:18:29 -05:00
export DENO_INSTALL="$HOME/.deno"
2022-12-01 14:30:31 -06:00
# export PATH="$DENO_INSTALL/bin:$PATH"
add-to-path prepend "$DENO_INSTALL/bin:$PATH"
2022-08-18 13:17:52 -05:00
fi
if [ -d "$HOME/.bun" ]; then
2022-08-30 23:08:41 -05:00
# bun completions
2022-09-29 10:18:29 -05:00
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"
2022-08-18 13:17:52 -05:00
2022-08-30 23:08:41 -05:00
# bun
export BUN_INSTALL="$HOME/.bun"
2022-12-01 14:30:31 -06:00
# export PATH="$BUN_INSTALL/bin:$PATH"
add-to-path prepend "$BUN_INSTALL/bin:$PATH"
2022-08-18 13:17:52 -05:00
fi