From 31ead6cf6767ba44547e341245939ba63199c639 Mon Sep 17 00:00:00 2001 From: Andrea Mistrali Date: Thu, 28 Oct 2021 15:20:11 +0200 Subject: [PATCH] More and more changes, temporary disabled termcolors --- zsh.d/00-options.zsh | 5 +--- zsh.d/10-environment.zsh | 14 +--------- zsh.d/20-termcolors.zsh | 52 ------------------------------------ zsh.d/30-aliases.zsh | 2 +- zsh.d/90-plugins.zsh | 8 ++++++ zsh.d/Darwin/50-darwin.zsh | 16 ++++++++++- zsh.d/Darwin/60-complete.zsh | 3 +-- zshrc | 2 +- 8 files changed, 28 insertions(+), 74 deletions(-) delete mode 100644 zsh.d/20-termcolors.zsh diff --git a/zsh.d/00-options.zsh b/zsh.d/00-options.zsh index 39323f6..8294e1c 100644 --- a/zsh.d/00-options.zsh +++ b/zsh.d/00-options.zsh @@ -1,11 +1,8 @@ -# setopt ALL_EXPORT - setopt ALWAYS_TO_END setopt AUTONAMEDIRS setopt AUTO_PARAM_SLASH setopt AUTO_REMOVE_SLASH setopt AUTO_RESUME -#setopt CDABLE_VARS unsetopt CDABLE_VARS setopt CORRECT setopt FUNCTION_ARGZERO @@ -19,7 +16,6 @@ setopt HIST_NO_STORE setopt HIST_REDUCE_BLANKS setopt INC_APPEND_HISTORY setopt NO_HIST_BEEP -# setopt SHARE_HISTORY setopt LIST_TYPES setopt LONG_LIST_JOBS @@ -38,4 +34,5 @@ setopt AUTO_CD setopt AUTO_MENU setopt no_MENU_COMPLETE setopt AUTO_LIST + # vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/10-environment.zsh b/zsh.d/10-environment.zsh index 4bc536a..35c31ab 100644 --- a/zsh.d/10-environment.zsh +++ b/zsh.d/10-environment.zsh @@ -2,7 +2,7 @@ # Variables ## Vars used always -PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$HOME/bin:." +PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin:$HOME/bin:." MIBS=all LOGD=/var/log @@ -26,18 +26,6 @@ VISUAL=vim export QUOTING_STYLE=escape - -# Setup brew -# We need it here to fix the PATH -# so we can setup pyenv and other stuff - -for prefix in /usr/local /opt/homebrew; do - brew=$(whence $prefix/bin/brew) - if [ $brew ]; then - eval "$($brew shellenv)" - fi -done - # Set umask to collaborative mode umask 002 diff --git a/zsh.d/20-termcolors.zsh b/zsh.d/20-termcolors.zsh deleted file mode 100644 index 009b6ff..0000000 --- a/zsh.d/20-termcolors.zsh +++ /dev/null @@ -1,52 +0,0 @@ -####################################################################################### -# Colorize terminal -autoload colors zsh/terminfo -zmodload zsh/terminfo - -if [[ "$terminfo[colors]" -ge 8 ]]; then - colors -fi -# for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do - # eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' - # eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' - # # (( count = $count + 1 )) -# done -# PR_NO_COLOR="%{$terminfo[sgr0]%}" - -# unset color -# - -typeset -Ag FX FG BG - -FX=( - reset "%{%}" - bold "%{%}" no-bold "%{%}" - italic "%{%}" no-italic "%{%}" - underline "%{%}" no-underline "%{%}" - blink "%{%}" no-blink "%{%}" - reverse "%{%}" no-reverse "%{%}" -) - -for color in {000..255}; do - FG[$color]="%{[38;5;${color}m%}" - BG[$color]="%{[48;5;${color}m%}" -done - - -ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris} - -# Show all 256 colors with color number -function spectrum_ls() { - for code in {000..255}; do - # print -P -- "$code: %F{$code}$ZSH_SPECTRUM_TEXT%f" - print -P -- "$FG[$code]$code: $ZSH_SPECTRUM_TEXT $FX[reset]" - done -} - -# Show all 256 colors where the background is set to specific color -function spectrum_bls() { - for code in {000..255}; do - print -P -- "$BG[$code]$code: $ZSH_SPECTRUM_TEXT $FX[reset]" - done -} -# vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/30-aliases.zsh b/zsh.d/30-aliases.zsh index 5693fba..5569b3d 100644 --- a/zsh.d/30-aliases.zsh +++ b/zsh.d/30-aliases.zsh @@ -1,7 +1,7 @@ ####################################################################################### # Aliases -alias ls='ls -F --color' +# alias ls='ls -F --color' alias dir='ls -l' alias la='ls -A' alias ll='ls -l' diff --git a/zsh.d/90-plugins.zsh b/zsh.d/90-plugins.zsh index 473240d..369ddd5 100644 --- a/zsh.d/90-plugins.zsh +++ b/zsh.d/90-plugins.zsh @@ -10,3 +10,11 @@ whence thefuck > /dev/null && eval $(thefuck --alias) # z [ -f $LIBRARY/plugins/zsh-z/zsh-z.plugin.zsh ] && source $LIBRARY/plugins/zsh-z/zsh-z.plugin.zsh + +# kubectl/krew +export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + +if whence kubectl > /dev/null; then + alias k=kubectl + alias kp='kubectl ipick' +fi diff --git a/zsh.d/Darwin/50-darwin.zsh b/zsh.d/Darwin/50-darwin.zsh index f02fdac..e920b80 100644 --- a/zsh.d/Darwin/50-darwin.zsh +++ b/zsh.d/Darwin/50-darwin.zsh @@ -1,8 +1,22 @@ # Darwin/OSX # Environment and aliases for OSX + + +# Setup brew +# We need it here to fix the PATH +# so we can setup pyenv and other stuff + +for prefix in /usr/local /opt/homebrew; do + brew=$(whence $prefix/bin/brew) + if [ $brew ]; then + eval "$($brew shellenv)" + fi +done + export LSCOLORS="ExgxcxdxCxegedabagacad" -alias ldd='otool -L' + alias ls='ls -F -G' +alias ldd='otool -L' alias skill=killall alias lsrebuild='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user' diff --git a/zsh.d/Darwin/60-complete.zsh b/zsh.d/Darwin/60-complete.zsh index 0db564e..59a93b1 100644 --- a/zsh.d/Darwin/60-complete.zsh +++ b/zsh.d/Darwin/60-complete.zsh @@ -1,5 +1,4 @@ -if type brew &>/dev/null -then +if type brew &>/dev/null;then FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" # # Reload compinit and bashcompinit, to parse brew installed completions diff --git a/zshrc b/zshrc index eb03b94..7a503f1 100644 --- a/zshrc +++ b/zshrc @@ -38,8 +38,8 @@ local KERNEL=`uname -s` local LIBRARY=${BASE}/zsh.d local KERNLIB=${LIBRARY}/${KERNEL} -loadRC ${LIBRARY} loadRC ${KERNLIB} +loadRC ${LIBRARY} # Add local customization file if [ -w $LIBRARY ]; then