Restructured zsh config
This commit is contained in:
		| @@ -14,7 +14,6 @@ _prepath() { | ||||
| _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" | ||||
| _prepath ~/bin | ||||
| 
 | ||||
| unfunction _prepath | ||||
| @@ -10,13 +10,12 @@ fi | ||||
| 
 | ||||
| unfunction _exists | ||||
| 
 | ||||
| 
 | ||||
| alias ls='ls --color=always -h' | ||||
| alias ll='ls -la' | ||||
| alias ...='cd ../..' | ||||
| alias foldersize='du -sh' | ||||
| alias duf='du -sk * | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done' | ||||
| alias whois="whois -h whois-servers.net" | ||||
| alias google='ping -c 10240000 google.com' | ||||
| 
 | ||||
| case `uname` in | ||||
|   Darwin) | ||||
| @@ -27,7 +26,6 @@ case `uname` in | ||||
|     alias r='open -a' | ||||
|     alias sulast='sudo $(history -p !-1)' | ||||
|     alias ydl="youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'" | ||||
|     alias google='ping -c 10240000 google.com' | ||||
|     alias nmap_localnet='nmap -sP 10.0.3.0/24' | ||||
|   ;; | ||||
|   Linux) | ||||
| @@ -35,5 +33,6 @@ case `uname` in | ||||
|   ;; | ||||
|   FreeBSD) | ||||
|     # commands for FreeBSD go here | ||||
|     alias stl="sockstat -l" | ||||
|   ;; | ||||
| esac | ||||
| @@ -9,8 +9,8 @@ setopt always_to_end | ||||
| WORDCHARS='' | ||||
| 
 | ||||
| zmodload -i zsh/complist | ||||
| fpath=(~/.zsh/comp/ $fpath) | ||||
| fpath=(/usr/local/share/zsh/site-functions/ $fpath) | ||||
| fpath=($fpath $ZDOTDIR/completions/) | ||||
| fpath=($fpath /usr/local/share/zsh/site-functions/) | ||||
| 
 | ||||
| ## case-insensitive (all),partial-word and then substring completion | ||||
| if [ "x$CASE_SENSITIVE" = "xtrue" ]; then | ||||
| @@ -1,4 +1,4 @@ | ||||
| # Changing/making/removing directory | ||||
| setopt auto_name_dirs | ||||
| setopt auto_pushd | ||||
| setopt pushd_ignore_dups | ||||
| setopt pushd_ignore_dups | ||||
| @@ -1,4 +1,4 @@ | ||||
| fpath+=$ZDOTDIR/functions | ||||
| fpath=($fpath $ZDOTDIR/functions) | ||||
| 
 | ||||
| autoload extract | ||||
| autoload img2iso | ||||
| @@ -23,4 +23,4 @@ else | ||||
| fi | ||||
| 
 | ||||
| # Apply theming defaults | ||||
| PS1="%n@%m:%~%# " | ||||
| PS1="%n@%m:%~%# " | ||||
| @@ -16,10 +16,3 @@ for color in {000..255}; do | ||||
|     FG[$color]="%{[38;5;${color}m%}" | ||||
|     BG[$color]="%{[48;5;${color}m%}" | ||||
| done | ||||
| 
 | ||||
| # Show all 256 colors with color number | ||||
| function spectrum_ls() { | ||||
|   for code in {000..255}; do | ||||
|     print -P -- "$code: %F{$code}Test%f" | ||||
|   done | ||||
| } | ||||
| @@ -12,7 +12,7 @@ fi | ||||
| PROMPT+='%F{yellow}%~%f ' | ||||
| 
 | ||||
| # Change green arrows (⇣⇡) if connection is via ssh | ||||
| if [[ "${SSH_CLIENT}" ]]; then | ||||
| if [[ "${SSH_CONNECTION}" ]]; then | ||||
| 	PROMPT+="%F{green}⇣⇡%f %F{white}〉%f"; | ||||
| else | ||||
| 	PROMPT+="%F{white}〉%f"; | ||||
		Reference in New Issue
	
	Block a user