|
|
|
#
|
|
|
|
# Executes commands at login pre-zshrc.
|
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Browser
|
|
|
|
#
|
|
|
|
|
|
|
|
# if [[ -z "$BROWSER" && "$OSTYPE" == darwin* ]]; then
|
|
|
|
# export BROWSER='open'
|
|
|
|
# fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Editors
|
|
|
|
#
|
|
|
|
|
|
|
|
if [[ -z "$EDITOR" ]]; then
|
|
|
|
export EDITOR='nvim'
|
|
|
|
fi
|
|
|
|
if [[ -z "$VISUAL" ]]; then
|
|
|
|
export VISUAL='nvim'
|
|
|
|
fi
|
|
|
|
if [[ -z "$PAGER" ]]; then
|
|
|
|
export PAGER='less -R'
|
|
|
|
fi
|
|
|
|
|
|
|
|
# BAT_PAGER does not work on OpenBSD right now...
|
|
|
|
# (displays nothing at all with this VARIABLE set)
|
|
|
|
if [[ -z "$BAT_PAGER" ]]; then
|
|
|
|
export BAT_PAGER='less -R'
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Language
|
|
|
|
#
|
|
|
|
|
|
|
|
if [[ -z "$LANG" ]]; then
|
|
|
|
export LANG='de_AT.UTF-8'
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Paths
|
|
|
|
#
|
|
|
|
|
|
|
|
# Ensure path arrays do not contain duplicates.
|
|
|
|
typeset -gU cdpath fpath mailpath path
|
|
|
|
|
|
|
|
# Set the list of directories that cd searches.
|
|
|
|
# cdpath=(
|
|
|
|
# $cdpath
|
|
|
|
# )
|
|
|
|
|
|
|
|
# Set the list of directories that Zsh searches for programs.
|
|
|
|
path=(
|
|
|
|
$HOME/.cargo/bin(N)
|
|
|
|
$HOME/.rvm/bin(N)
|
|
|
|
$HOME/go/bin(N)
|
|
|
|
$HOME/.local/share/gem/ruby/3.2/bin(N)
|
|
|
|
$HOME/.local/share/gem/ruby/3.0.0/bin(N)
|
|
|
|
$HOME/.yarn/bin(N)
|
zprofile: Expand the default list of well known paths
Two additional sets of paths are now added to the default list of well
known paths: '$HOME/{bin,sbin}' and '/opt/{homebrew,local}/{bin,sbin}'.
- '$HOME/{bin,sbin}': Most users have custom scripts in '$HOME/bin'
anyway, we might as well honor those. '$HOME/sbin' is not really common,
but we can keep it for consistency.
- '/opt/{homebrew,local}/{bin,sbin}': With Homebrew changing default
installation location in macOS on Apple Silicon which will eventually
become ubiquitous, we have a good reason to add these paths by default.
While at it, we also honor MacPorts installation.
In all cases, we add them _iff_ the paths actually exist, not otherwise.
This has the side effect of a newly installed program not available
immediately in the '$path' in a mint fresh system (because of the fact
that '/opt/{homebrew,local}/{bin,sbin}' won't exist initially) until the
shell is reloaded. But that's a minor inconvenience to keep the '$path'
from getting unnecessarily bloated.
3 years ago
|
|
|
$HOME/{,s}bin(N)
|
|
|
|
$HOME/.local/{,s}bin(N)
|
zprofile: Expand the default list of well known paths
Two additional sets of paths are now added to the default list of well
known paths: '$HOME/{bin,sbin}' and '/opt/{homebrew,local}/{bin,sbin}'.
- '$HOME/{bin,sbin}': Most users have custom scripts in '$HOME/bin'
anyway, we might as well honor those. '$HOME/sbin' is not really common,
but we can keep it for consistency.
- '/opt/{homebrew,local}/{bin,sbin}': With Homebrew changing default
installation location in macOS on Apple Silicon which will eventually
become ubiquitous, we have a good reason to add these paths by default.
While at it, we also honor MacPorts installation.
In all cases, we add them _iff_ the paths actually exist, not otherwise.
This has the side effect of a newly installed program not available
immediately in the '$path' in a mint fresh system (because of the fact
that '/opt/{homebrew,local}/{bin,sbin}' won't exist initially) until the
shell is reloaded. But that's a minor inconvenience to keep the '$path'
from getting unnecessarily bloated.
3 years ago
|
|
|
/usr/local/{,s}bin(N)
|
|
|
|
$HOME/opt/qcad-3.31.1-pro-linux-qt5.14-x86_64(N)
|
|
|
|
$path
|
|
|
|
)
|
|
|
|
|
|
|
|
[[ -d $HOME/go ]] && export GOPATH="${HOME}/go"
|
|
|
|
[[ -d ${GOPATH}/bin ]] && export GOBIN="${GOPATH}/bin"
|
|
|
|
[[ -d $HOME/.tmac ]] && export GROFF_TMAC_PATH="$HOME/.tmac"
|
|
|
|
|
|
|
|
# OpenBSD snapshots/current...
|
|
|
|
if [[ "$OSTYPE" == openbsd* ]]; then
|
|
|
|
export PKG_PATH="http://mirror.hs-esslingen.de/pub/OpenBSD/snapshots/packages/amd64"
|
|
|
|
#export PKG_PATH="http://ftp.nluug.nl/OpenBSD/snapshots/packages/amd64"
|
|
|
|
export FETCH_CMD="/usr/local/bin/curl -L -s -q -N"
|
|
|
|
export CVSROOT="anoncvs@ftp.hostserver.de:/cvs"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# still here for reference, used to need that on KDE
|
|
|
|
# export SSH_ASKPASS='/usr/bin/ksshaskpass'
|
|
|
|
|
|
|
|
#
|
|
|
|
# Less
|
|
|
|
#
|
|
|
|
|
|
|
|
# Set the default Less options.
|
|
|
|
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
|
|
|
|
# Remove -X to enable it.
|
|
|
|
if [[ -z "$LESS" ]]; then
|
|
|
|
# export LESS='-R --use-color -Dd+r$Du+b$'
|
|
|
|
# export LESS='-g -i -M -R -S -w -X -z-4'
|
|
|
|
export LESS='-g -i -M -R -S -w -z-4'
|
|
|
|
fi
|
|
|
|
|
|
|
|
# export MANPAGER="sh -c 'col -b -x | bat -l man -p'"
|
|
|
|
# export MANROFFOPT="-c"
|
|
|
|
|
|
|
|
# OpenBSD grep does not want --color
|
|
|
|
# GREP_OPTS='--color=auto' # for aliases since $GREP_OPTIONS is deprecated
|
|
|
|
# GREP_COLOR='1;32' # (legacy) bright green rather than default red
|
|
|
|
# # (new) Matching text in Selected line = green, line numbers dark yellow
|
|
|
|
# GREP_COLORS="ms=${GREP_COLOR}:mc=${GREP_COLOR}:ln=33"
|
|
|
|
# alias grep='grep $GREP_OPTS'
|
|
|
|
# alias egrep='grep -E $GREP_OPTS'
|
|
|
|
# alias fgrep='LC_ALL=C grep -F $GREP_OPTS'
|
|
|
|
|
|
|
|
# Set the Less input preprocessor.
|
|
|
|
# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system.
|
|
|
|
if [[ -z "$LESSOPEN" ]] && (( $#commands[(i)lesspipe(|.sh)] )); then
|
|
|
|
export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-"
|
|
|
|
fi
|