diff options
author | Alen <alen@dotfiles.xyz> | 2023-09-07 23:08:41 +0100 |
---|---|---|
committer | Alen <alen@dotfiles.xyz> | 2023-09-08 19:53:59 +0400 |
commit | 45bc2e16f335035a114406bea7d8ef5129a775ac (patch) | |
tree | 739d5227471cdc386091e9c952508f0f8fb74845 /dot_zshenv | |
parent | 97da74b7a66fb824827fede0c4f4863e61c2134d (diff) |
Add basic .z{env,profile,shrc,login,logout}
Set up history, cd/pushd, local bins, locales, pager, other nice-to-haves.
Diffstat (limited to 'dot_zshenv')
-rw-r--r-- | dot_zshenv | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/dot_zshenv b/dot_zshenv new file mode 100644 index 0000000..702bfd3 --- /dev/null +++ b/dot_zshenv @@ -0,0 +1,42 @@ +# First and foremost, set up history +setopt inc_append_history # append to history as commands are run rather than at the end +setopt extended_history # record timestamp of command in HISTFILE +setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds limits +setopt hist_ignore_dups # ignore duplicated commands history list +setopt hist_ignore_space # ignore commands that start with space +setopt hist_verify # show command with history expansion to user before execution +setopt share_history # share command history data +setopt hist_find_no_dups # filter out (even non-contiguous) entries when from history search +unsetopt flowcontrol # do not use ^S/^Q for flor control +export HISTFILE="${HOME}/.zsh_history" +export HISTSIZE=1000000 +export SAVEHIST=1000000 + +# Common nice-to-haves +setopt auto_cd # Auto-cd into directory if only directory name used as command +setopt multios # Implicit cat/tee redirection +setopt prompt_subst # Prompt substitution used by themes + +# Directory management +setopt auto_pushd # Treat cd as pushd +setopt pushd_minus # Flip cd +n and cd -n relative to csh +setopt pushd_silent # Do not print directories +setopt pushd_to_home # No arguments is the same as pushd $HOME - mimic cd with no args +setopt pushd_ignore_dups # Ignore pushd dupes +export DIRSTACKSIZE=16 + +# (Re)set locales, a reminder that we live in a world built upon bad decisions +export LANG=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 + +# Pager - this requires an updated version of less on macOS or --mouse breaks +export LESS="--RAW-CONTROL-CHARS --chop-long-lines --mouse" +export PAGER="less" + +# Add user's bin or .local/bin to PATH, if they exist +if [[ -d "${HOME}/bin" ]]; then + PATH="${HOME}/bin:${PATH}" +fi +if [[ -d "${HOME}/.local/bin" ]]; then + PATH="${HOME}/.local/bin:${PATH}" +fi |