summaryrefslogtreecommitdiff
path: root/zsh/zshrc
blob: bef8f9c809d6fbe8582594339febffc030a4cc22 (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

# Zsh scripts
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
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
HISTSIZE=500			# Max lines of history loaded into memory
SAVEHIST=10000000		# Max lines of history saved to the histfile
setopt EXTENDED_HISTORY		# Save superfluous info with command to reduce disk writes
setopt HIST_IGNORE_DUPS		# Successive duplicate entries ignored
setopt HIST_IGNORE_SPACE	# Entries with leading space ignored
setopt HIST_REDUCE_BLANKS
setopt INC_APPEND_HISTORY	# Create entries after each command, not after zsh exits
setopt SHARE_HISTORY		# Share history between zsh sessions

# Zsh completion settings
setopt MENU_COMPLETE		# Insert first option immediately in completion menu instead of just showing menu

# Input/output settings
setopt INTERACTIVE_COMMENTS	# Comments work as expected in interactive shell

# 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