summaryrefslogtreecommitdiff
path: root/zsh/zshrc
blob: 8bef6af6ba75973b2e0fc919e44b0ed27cf5f999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env zsh

setopt +o NOMATCH		# Non-existant wildcard matches won't produce an error

# Zsh scripts (load general scripts, then host specific scripts, then scripts prepended with !)
for zscript in "$XDG_CONFIG_HOME/zsh/zscripts"{/[^\!]*.zsh,/hosts/*.$HOST.zsh,/!*.zsh}; do source "$zscript"; done 2>/dev/null

# Colors! + Prompt
autoload -U colors && colors
[ -z "$PS1OVERRIDE" ] && PS1="%B%F{${colbr:-red}}[%F{${colname:-yellow}}%n%F{${colat:-green}}@%F{${colhost:-blue}}%m %F{${coldir:-magenta}}%U%~%u%F{${colbr:-red}}]%f%b%(!.#.$) "

# Cd settings
setopt AUTO_CD			# `cd` is implied
#setopt CDABLE_VARS		# '~/' is implied for `cd` (doesn't work?)

# History settings
HISTFILE="${ZHISTFILE:-$HOME/.zhistory}"
HISTSIZE=500			# Max lines of history loaded into memory for each zsh session
SAVEHIST=10000000		# Max lines of history saved to HISTFILE before overwriting
setopt EXTENDED_HISTORY		# Save superfluous info with command to reduce disk writes when using INC_APPEND_HISTORY or SHARE_HISTORY
setopt HIST_IGNORE_DUPS		# Successive duplicate entries ignored
setopt HIST_IGNORE_SPACE	# Entries with leading space ignored
setopt HIST_REDUCE_BLANKS	# Remove superfluous blank characters before saving
setopt INC_APPEND_HISTORY	# Create entries after each command, not after zsh exits
setopt SHARE_HISTORY		# Share history between zsh sessions

# Input/output settings
setopt INTERACTIVE_COMMENTS	# Comments won't be interpreted in an interactive zsh session

# tmp thing
[ $TTY = /dev/tty2 ] && "/home/timmy/.local/opt/shell-color-scripts/colorscripts/$(ls /home/timmy/.local/opt/shell-color-scripts/colorscripts 2>/dev/null | shuf -n1)" 2>/dev/null

zplugInitialize # Load zsh plugins using zplug; should be last