dotfiles/zsh/.zshenv

106 lines
3.1 KiB
Plaintext
Raw Normal View History

2022-09-13 15:37:45 +02:00
# PATH variable declaration as array
# -U means unique, which tells the shell not to add anything to the array if it's
# already there.
typeset -U PATH path
2022-07-17 04:25:55 +02:00
2022-09-13 15:37:45 +02:00
# Add /usr/local dirs to PATH
path=("/usr/local/bin" "/usr/local/sbin")
path+=("/bin" "/sbin" "/usr/bin" "/usr/sbin")
# Set Go path if it exist
[ -d "${HOME}/go" ] && GOPATH="${HOME}/go" && path+=("${GOPATH}/bin")
# Set Cargo path for Rust binaries
[ -d "${HOME}/.cargo/bin" ] && path+=("${HOME}/.cargo/bin")
# If ~/bin exists, add it to PATH
[ -d "${HOME}/bin" ] && path+=("${HOME}/bin")
# If ~/.local/bin exists, add it to path
[ -d "${HOME}/.local/bin" ] && path+=("${HOME}/.local/bin")
2022-07-17 04:25:55 +02:00
export PATH
2022-09-13 15:37:45 +02:00
# Setup pager
2022-11-24 07:10:34 +01:00
export PAGER="less -X"
# Setup manpages
export MANWIDTH="88"
export MANROFFOPT="-c"
export MANPAGER="less -X"
# Have less display colours
# from: https://wiki.archlinux.org/index.php/Color_output_in_console#man
export LESS_TERMCAP_mb=$'\e[1;31m' # begin bold
export LESS_TERMCAP_md=$'\e[1;34m' # begin blink
export LESS_TERMCAP_so=$'\e[01;0;33m' # begin reverse video
export LESS_TERMCAP_us=$'\e[01;31m' # begin underline
export LESS_TERMCAP_me=$'\e[0m' # reset bold/blink
export LESS_TERMCAP_se=$'\e[0m' # reset reverse video
export LESS_TERMCAP_ue=$'\e[0m' # reset underline
export GROFF_NO_SGR=1 # for konsole and gnome-terminal
2022-07-17 04:25:55 +02:00
2022-11-05 20:57:02 +01:00
# Editor - emacs else nano
if test -x "$(command -v emacs)"; then
EDITOR="emacs"
2022-09-13 15:37:45 +02:00
else
EDITOR=nano
fi
export EDITOR
# Cargo/Rust
2023-01-18 16:52:18 +01:00
[[ -f "$HOME/.cargo/env" ]] && source "$HOME/.cargo/env"
2022-09-13 15:37:45 +02:00
# Format of process time reports with 'time'
# %% A '%'
# %U CPU seconds spent in user mode
# %S CPU seconds spent in kernel mode
# %E Elapsed time in seconds
# %P CPU percentage, computed as (%U+%S)/%E
# %J The name of this job
# Default is:
# %E real %U user %S system %P %J
TIMEFMT="\
The name of this job : %J
CPU seconds spent in user mode : %U
CPU seconds spent in kernel mode : %S
Elapsed time in seconds : %E
CPU percentage : %P"
# HISTSIZE is the number of lines of history that is kept within any given
# running zsh instance. SAVEHIST is the number of lines of history that is
# written out to the HISTFILE when that event occurs. If you use the
# HIST_EXPIRE_DUPS_FIRST option, setting this value larger than the SAVEHIST
# size will give you the difference as a cushion for saving duplicated history
# events.
HISTSIZE=100000
SAVEHIST=65536
# Name of the file used to store command history
HISTFILE=~/.zsh_history
# If nonnegative, commands whose combined user and system execution times
# (measured in seconds) are greater than this value have timing stats printed
# for them.
REPORTTIME=10
# reply-to email address
export REPLYTO="hyperreal@fedoraproject.org"
2022-07-17 04:25:55 +02:00
2022-09-13 15:37:45 +02:00
# Language
export LANG="en_US.UTF-8"
2022-07-17 04:25:55 +02:00
2022-09-13 15:37:45 +02:00
# Manpages
export MANPATH="${MANPATH:-/usr/share/man:/usr/local/share/man}"
2022-08-12 14:52:48 +02:00
2022-09-13 15:37:45 +02:00
if [ -d "${HOME}/.fzf/man" ]; then
export MANPATH="${MANPATH}:${HOME}/.fzf/man"
fi
2022-07-17 04:25:55 +02:00
2022-09-13 15:37:45 +02:00
# Bat theme
2022-07-17 04:25:55 +02:00
export BAT_THEME="Catppuccin"
2022-09-13 15:37:45 +02:00
# Automatically remove duplicates from these arrays
typeset -gU path cdpath manpath fpath