config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit ef6935aa4d9998f4d9c2078af097f3f587e1d74e
parent 132260212052cf28e642e13ea5f1c9f0c712fca1
Author: jacobs-github <JacobDoesLinux@protonmail.com>
Date:   Mon, 10 Feb 2020 13:20:30 -0800

seperated aliases

removed unused options

sorted everything better

Diffstat:
Mzsh/.zshrc | 197++++++++++++++++---------------------------------------------------------------
1 file changed, 39 insertions(+), 158 deletions(-)

diff --git a/zsh/.zshrc b/zsh/.zshrc @@ -1,44 +1,44 @@ -# vim: foldmethod=marker -source "$HOME/.profile" -#>completion {{{ +# external files +source ~/.profile +source ~/.aliases +source ~/.aliases-private + +# completion fpath=(~/.zsh-completion $fpath) -autoload autoload -Uz compinit zmodload zsh/complist - -# options -setopt noglobdots -setopt COMPLETE_ALIASES - - -zstyle :compinstall filename '/home/jacob/.zshrc' - zstyle ':completion:*' menu select bindkey -M menuselect '^[[Z' reverse-menu-complete +zstyle ':completion:*:options' list-colors '=^(-- *)=32' +zstyle ':completion:*:*:cd:*' list-colors '36' +zstyle ':completion:*:*:ls:*' list-colors '36' +zstyle ':completion:*:*:rm:*' list-colors '36' +zstyle ':completion:*:*:cp:*' list-colors '36' +zstyle ':completion:*:*:mv:*' list-colors '36' +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} + compinit compdef "_files -W "$NOTES"" note -# }}} +# options +setopt noglobdots +setopt COMPLETE_ALIASES -#>keys {{{ -listdir() { echo ; ls --hide 'Downloads' --color=always --group-directories-first } -zle -N listdir +# keybinds bindkey -v bindkey "^[[1;5C" forward-word bindkey "^[[1;5D" backward-word bindkey "^W" backward-delete-word bindkey "^E" delete-word -bindkey "^F" listdir # characters delete word wont care about WORDCHARS='\*?.[]~&;!#$%^(){}<>' typeset -g -A key - key[Home]="${terminfo[khome]}" key[End]="${terminfo[kend]}" key[Insert]="${terminfo[kich1]}" @@ -66,7 +66,6 @@ key[ShiftTab]="${terminfo[kcbt]}" [[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history [[ -n "${key[ShiftTab]}" ]] && bindkey -- "${key[ShiftTab]}" reverse-menu-complete - if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then autoload -Uz add-zle-hook-widget function zle_application_mode_start { @@ -78,165 +77,47 @@ if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then add-zle-hook-widget -Uz zle-line-init zle_application_mode_start add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop fi - # }}} - #>history {{{ + +# history HISTCONTROL='erasedups' -HISTFILE=~/.histfile +HISTFILE="$HOME/.history-zsh" HISTSIZE=1500000 SAVEHIST=1500000 -# }}} - -if [ $(uname | tail -c 4 ) != 'BSD' ]; then - #>alias {{{ - # expansion funciton - typeset -a ealiases - ealiases=() - - function ealias() - { - alias $1 - ealiases+=(${1%%\=*}) - } - function expand-ealias() - { - if [[ $LBUFFER =~ "\<(${(j:|:)ealiases})\$" ]]; then - zle _expand_alias - zle expand-word - fi - zle magic-space - } - zle -N expand-ealias - - bindkey -M viins ' ' expand-ealias - bindkey -M viins '^ ' magic-space # control-space to bypass completion - bindkey -M isearch " " magic-space # normal space during searches - # end - - # GNU / Basic Utilities - source "$HOME/.zsh-user" - alias sudo='sudo -E' - alias grep='grep --color' - alias ls='ls --hide 'Downloads' --color=always --group-directories-first' - alias mv='mv --no-clobber' - alias cp='cp --no-clobber' - alias tmux='tmux -u' - alias suspend='systemctl suspend' - alias hibernate='systemctl hibernate' - - # Program Extentions - alias pacman='pacman-c' - - # Etc - alias ncmpcpp='ncmpcpp -q' - - # Shortcuts/Renaming - alias meta='exiftool' - alias cfg='config' - alias v='nvim' - alias vim='nvim' - - - # functions - function dict(){ curl "dict.org/d:$1" | less } - function gamma(){xrandr --output "$(xrandr --listactivemonitors | tail -n 1 | cut -d '*' -f 2 | awk '{print $1}')" --gamma $1} - function lsrepeat(){ - while true; do - local stat="$( stat '--format=%Y' . )" - - if [ "$stat" -eq "$statago" ]; then - printf '--data updated--\n' - ls - fi - - local statago="$stat" - sleep 1 - done - } - - function daily(){ - time="$(date +%H%M)" - # accounting for my poor sleep patterns - if [[ "$time" -gt 0 ]] && [[ "$time" -lt 600 ]]; then - date="$(date +%Y/%m)/" - day="$( expr "$(date +%d)" - 1 )" - - if [ "$day" -lt 10 ]; then - date="$date/0$day" - else - date="$date/$day" - fi - - else - date="$( date +%Y/%m/%d)" - fi - - if [ ! -e "$NOTES/daily/$date" ]; then - printf "$( date +%d/%m/%Y)\n\n$( date '+%R' )" >> "$NOTES/daily/$date" - else - printf "\n\n$( date '+%R' )" >> "$NOTES/daily/$date" - fi - - note "daily/$date" - } - - #}}} -fi +# prompt +# [] is cursor +# 0 is exit status -#>prompt {{{ +# (~/path/to/your/directory) [] +PROMPT='%F{4}(%f%~%F{4})%f ' +RPROMPT='' -# beutiful +# 0────[~/path/to/your/directory] +# └──[] time user@hostname #RPROMPT='%F{236}%T %F{237}%n@%M%f' #PROMPT='%?%F{4}────[%f%F{109}%~%F{4}]%f #%F{4}└──%f' - -# simple -#RPROMPT='%F{236}%T %F{237}%n@%M%f' -#PROMPT='%?%F{4} >>[%f%F{109}%~%F{4}]%f -#%F{4}^->%f' - - -# simple oneline +# 0 ->[] [~/path/to/your/directory] #PROMPT='%?%F{4} ->%f' #RPROMPT='%F{4}[%f%F{109}%~%F{4}]%f' -# round minimal prompt -PROMPT='%F{4}(%f%~%F{4})%f ' -RPROMPT='' - -# }}} -if [ $(uname | tail -c 4 ) != 'BSD' ]; then -#>syntax hightlighting {{{ +# syntax hightlighting +if [ $(uname | tail -c 4 ) != 'BSD' ]; then # I don't know where bsd stores it's highlighting source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern) # include these - ZSH_HIGHLIGHT_STYLES[precommand]=fg=white,bold # exec, sudo, etc - - #ZSH_HIGHLIGHT_STYLES[alias]=fg=blue,underline # alias : commented because it wasn't properly detecting aliases - ZSH_HIGHLIGHT_STYLES[arg0]=fg=blue,bold # command - ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=red # unknown comand - - ZSH_HIGHLIGHT_STYLES[redirection]=fg=cyan,bold # <|> - ZSH_HIGHLIGHT_STYLES[commandseparator]=fg=white,bold # &&; + ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern) # include these + ZSH_HIGHLIGHT_STYLES[precommand]=fg=white,bold # exec, sudo, etc + ZSH_HIGHLIGHT_STYLES[arg0]=fg=blue,bold # command + ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=red # unknown comand + ZSH_HIGHLIGHT_STYLES[redirection]=fg=cyan,bold # <|> + ZSH_HIGHLIGHT_STYLES[commandseparator]=fg=white,bold # &&; - - - # Colors For Specific Commands + # colors for specific commands ZSH_HIGHLIGHT_PATTERNS=('rm -rf *' 'fg=white,bold,bg=red') ZSH_HIGHLIGHT_PATTERNS=('sudo' 'fg=white,bold') ZSH_HIGHLIGHT_PATTERNS=('pacman' 'fg=yellow,bold') - - zstyle ':completion:*:options' list-colors '=^(-- *)=32' - zstyle ':completion:*:*:cd:*' list-colors '36' - zstyle ':completion:*:*:ls:*' list-colors '36' - zstyle ':completion:*:*:rm:*' list-colors '36' - zstyle ':completion:*:*:cp:*' list-colors '36' - zstyle ':completion:*:*:mv:*' list-colors '36' - - zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} - # }}} fi