1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00
dotfiles/zsh/.zshenv

252 lines
3.8 KiB
Plaintext
Raw Normal View History

2020-05-16 17:57:01 +00:00
path_if_exists() {
if [[ -d $1 ]]; then
export PATH="$1:$PATH"
fi
}
# Stop tmux bitching about 256 colours
TERM="xterm-256color"
# PATH
path_if_exists ~/.config/yarn/global/node_modules/.bin
path_if_exists ~/.local/bin
path_if_exists ~/.emacs.d/bin
2020-06-14 17:59:12 +00:00
path_if_exists ~/.local/share/go/bin
path_if_exists ~/.local/share/cargo/bin
2020-05-16 17:57:01 +00:00
# Set GPG TTY
export GPG_TTY="$(tty)"
# Set default browser
if [ -e "/usr/bin/brave" ]; then
export BROWSER="brave"
else
if [ -e "/usr/bin/firefox" ]; then
export BROWSER="firefox"
elif [ -e "/usr/bin/iceweasel" ]; then
export BROWSER="iceweasel"
fi
fi
# Set default terminal
export TERMINAL="alacritty"
# pkg editor
export VISUAL="nvim"
# editor
export EDITOR="nvim"
# Enable password store extensions
export PASSWORD_STORE_ENABLE_EXTENSIONS="true"
2020-05-16 18:05:52 +00:00
# Make sure pass uses the proper directory
export PASSWORD_STORE_DIR=~/.local/share/pass
# Use alternative muhome
export MU_HOME=~/.cache/mu
# Load xinit from the proper directory
2020-05-18 19:12:24 +00:00
export XINITRC=~/.config/X11/xinitrc
2020-05-16 18:05:52 +00:00
2020-05-16 17:57:01 +00:00
# This needs to be set for bspwm to see config
export XDG_CONFIG_HOME="$HOME/.config"
# Rust
export CARGO_HOME=~/.local/share/cargo
export RUSTUP_HOME=~/.local/share/rustup
# Golang
export GOPATH=~/.local/share/go
# Npm
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
2020-05-16 18:05:52 +00:00
# Enable icons in lf
export LF_ICONS="\
tw=:\
st=:\
ow=:\
dt=:\
di=:\
fi=:\
ln=:\
or=:\
ex=:\
*.c=:\
*.cc=:\
*.clj=:\
*.coffee=:\
*.cp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wd=:\
*.yuv=:\
*.cgm=:\
*.emf=:\
*.ogv=:\
*.ogx=:\
*.aac=:\
*.au=:\
*.flac=:\
*.m4a=:\
*.mid=:\
*.midi=:\
*.mka=:\
*.mp3=:\
*.mpc=:\
*.ogg=:\
*.ra=:\
*.wav=:\
*.oga=:\
*.opus=:\
*.spx=:\
*.xspf=:\
*.pdf=:\
*.nix=:\
"
2020-05-16 17:57:01 +00:00
# Save history file in proper place
HISTFILE=~/.cache/zsh/history
2020-06-12 10:13:27 +00:00
# Load config files from their proper place
ZDOTDIR=~/.config/zsh
2020-05-16 17:57:01 +00:00
# Use alternative muhome
export MU_HOME="/home/alrayyes/.cache/mu"
# Needed to get zsh to play nice with emacs vterm
if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
alias clear='printf "\e]51;Evterm-clear-scrollback\e\\";tput clear'
fi
vterm_prompt_end() {
printf "\e]51;A$(whoami)@$(hostname):$(pwd)\e\\"
}
PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
# Make fzf use ripgrep if available
if type rg &> /dev/null; then
export FZF_DEFAULT_COMMAND='rg --files'
export FZF_DEFAULT_OPTS='-m --height 50% --border'
fi