Modified ZSH config

This commit is contained in:
Christian Baer 2020-05-24 23:16:31 +02:00
parent e80d3cd1f4
commit a7cfcfae70
5 changed files with 32 additions and 32 deletions

21
.zlogin
View File

@ -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

View File

@ -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 whats typed on the commandline in to account.

20
.zsh/lib/path.zsh Normal file
View File

@ -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

View File

@ -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

4
.zshrc
View File

@ -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