From a7cfcfae70b9b071ab17a9e0213dc286b2b0aad5 Mon Sep 17 00:00:00 2001 From: Christian Baer Date: Sun, 24 May 2020 23:16:31 +0200 Subject: [PATCH] Modified ZSH config --- .zlogin | 21 --------------------- .zsh/lib/history.zsh | 17 +++++++++-------- .zsh/lib/path.zsh | 20 ++++++++++++++++++++ .zsh/lib/shortcuts.zsh | 2 +- .zshrc | 4 ++-- 5 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 .zsh/lib/path.zsh diff --git a/.zlogin b/.zlogin index 9a75182..2d224a2 100644 --- a/.zlogin +++ b/.zlogin @@ -1,23 +1,2 @@ -# Set $PATH -# Put only directories in $PATH that exist and remove duplicates -typeset -U path # No duplicates -path=() - -_prepath() { - for dir in "$@"; do - dir=${dir:A} - [[ ! -d "$dir" ]] && return - path=("$dir" $path[@]) - done -} - -_prepath /usr/local/bin /bin /usr/local/sbin # General -_prepath /usr/bin /usr/sbin /sbin /Library/Apple/usr/bin # macOS -_prepath /usr/sbin /sbin # FreeBSD - -_prepath "$HOME/bin" - -unfunction _prepath - uname -npsr uptime diff --git a/.zsh/lib/history.zsh b/.zsh/lib/history.zsh index b222571..b197739 100644 --- a/.zsh/lib/history.zsh +++ b/.zsh/lib/history.zsh @@ -1,16 +1,17 @@ ## Command history configuration -HISTFILE=$HOME/.zsh_history -HISTSIZE=10000 -SAVEHIST=10000 +HISTFILE=$ZDOTDIR/history +HISTSIZE=40000 +SAVEHIST=40000 setopt append_history setopt extended_history -setopt hist_expire_dups_first -setopt hist_ignore_dups # ignore duplication command history list -setopt hist_ignore_space +setopt hist_ignore_dups setopt hist_verify -setopt inc_append_history -setopt share_history # share command history data +setopt incappendhistory +setopt histignorespace +setopt histnostore +setopt share_history +HISTORY_IGNORE='([bf]g *|disown|cd ..|cd -)' # Make up and down arrow take what’s typed on the commandline in to account. diff --git a/.zsh/lib/path.zsh b/.zsh/lib/path.zsh new file mode 100644 index 0000000..97ccad4 --- /dev/null +++ b/.zsh/lib/path.zsh @@ -0,0 +1,20 @@ +# Set $PATH +# Put only directories in $PATH that exist and remove duplicates +typeset -U path # No duplicates +path=() + +_prepath() { + for dir in "$@"; do + dir=${dir:A} + [[ ! -d "$dir" ]] && return + path=("$dir" $path[@]) + done +} + +_prepath /usr/local/bin /bin /usr/local/sbin # General +_prepath /usr/bin /usr/sbin /sbin /Library/Apple/usr/bin # macOS +_prepath /usr/sbin /sbin # FreeBSD + +_prepath "$HOME/bin" + +unfunction _prepath diff --git a/.zsh/lib/shortcuts.zsh b/.zsh/lib/shortcuts.zsh index 59c4ccb..a7b9c83 100644 --- a/.zsh/lib/shortcuts.zsh +++ b/.zsh/lib/shortcuts.zsh @@ -4,7 +4,7 @@ hash -d bin=$HOME/bin case `uname` in Darwin) - hash -d hucb=~$HOME/Sites/christianbaer.me + hash -d hucb=$HOME/Sites/christianbaer.me ;; Linux) # commands for Linux go here diff --git a/.zshrc b/.zshrc index 28fa8d9..93613ae 100644 --- a/.zshrc +++ b/.zshrc @@ -1,7 +1,7 @@ -export ZSH=~/.zsh +ZDOTDIR=~/.zsh # Load all of the config files in $ZSH/lib that end in .zsh -for config_file ($ZSH/lib/*.zsh) source $config_file +for config_file ($ZDOTDIR/lib/*.zsh) source $config_file # Load and run compinit autoload -U compinit