update
This commit is contained in:
parent
4e3463691c
commit
eeac487d82
|
@ -0,0 +1,2 @@
|
|||
.DS_Store
|
||||
.zcompdump
|
|
@ -1,9 +1,6 @@
|
|||
[submodule "grc"]
|
||||
path = grc
|
||||
url = https://github.com/garabik/grc
|
||||
[submodule "k"]
|
||||
path = k
|
||||
url = https://github.com/supercrabtree/k
|
||||
[submodule "pure"]
|
||||
path = pure
|
||||
url = https://github.com/sindresorhus/pure
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
set indicator
|
||||
set jumpyscrolling
|
||||
set linenumbers
|
||||
set minibar
|
||||
set nonewlines
|
||||
set nowrap
|
||||
set quickblank
|
||||
set tabsize 4
|
||||
set unix
|
||||
unset historylog
|
||||
|
||||
set functioncolor #088
|
||||
set keycolor #0cc
|
||||
set minicolor #0cc
|
||||
set numbercolor #066
|
||||
set promptcolor #0cc
|
||||
set scrollercolor #088
|
||||
set titlecolor #0cc
|
||||
|
||||
bind ^Z suspend main
|
||||
include "~/.config/nano/syntax/*.nanorc"
|
||||
include "~/.config/nano/syntax/extra/*.nanorc"
|
|
@ -0,0 +1,3 @@
|
|||
skip_global_compinit=1
|
||||
SHELL_SESSIONS_DISABLE=1
|
||||
ZDOTDIR=$HOME/.config/zsh
|
|
@ -0,0 +1,79 @@
|
|||
export PATH=$HOME/.bin:$PATH
|
||||
export EXA_COLORS="uu=38;5;249:un=38;5;241:gu=38;5;245:gn=38;5;241:da=38;5;23:sn=38;5;7:sb=38;5;7:ur=38;5;3;1:uw=38;5;5;1:ux=38;5;1;1:ue=38;5;1;1:gr=38;5;249:gw=38;5;249:gx=38;5;249:tr=38;5;249:tw=38;5;249:tx=38;5;245:fi=38;5;6;1:di=38;5;6:ex=38;5;1:xa=38;5;12:*.png=38;5;4:*.jpg=38;5;4:*.gif=38;5;4"
|
||||
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias bell='echo -en "\007\007"'
|
||||
alias dig='dig +short +noshort'
|
||||
alias grep='grep --color=auto'
|
||||
alias hg='history 1 | grep -i '
|
||||
alias ls='exa -s filename --group-directories-first'
|
||||
alias l='exa -lg --git --color-scale -s filename --group-directories-first'
|
||||
alias la='l -a'
|
||||
alias nolog='unset HISTFILE'
|
||||
|
||||
function cheat { curl cheat.sh/$1 }
|
||||
function rrmdir { find ${1:-.} -depth -type d -exec rmdir '{}' + }
|
||||
function mcd { mkdir -p $1 && cd $1 }
|
||||
function pw { LC_ALL=C < /dev/urandom tr -dc A-Za-z0-9 | head -c${1:-64} }
|
||||
function precmd { print -Pn '\e]2;%m (%~)\a\e]1;%m\a'; }
|
||||
|
||||
HISTORY_IGNORE='(..|...|/*|./*|[ *|[[ *|7z *|\\\\*|ack *|attr *|bell|bg|borg *|cat *|cd|cd *|chmod *|chown *|cp *|curl *|dialog *|dig *|du|du *|echo *|export *|fg|find *|for |git commit *|*grep *|hexdump *|hg *|kill *|l|l *|la|la *|ln *|ls *|man *|mcd *|md5 *|md5sum *|mkdir *|mount *|mv *|nano *|nolog|nslookup *|openssl *|pidof *|ping *|popd *|pushd *|rm *|rmdir *|rmdir *|rsync *|scp *|screen *|sleep *|sysbench *|tail *|tar *|time *|timeout *|touch *|traceroute *|truncate *|umount *|unp *|watch *|wget *|which *|while *|whois *|zcat *)'
|
||||
HISTSIZE=1000000
|
||||
SAVEHIST=$HISTSIZE
|
||||
HISTFILE=$HOME/.config/zhistory
|
||||
FPATH=$FPATH:$ZDOTDIR/pure
|
||||
setopt histignorealldups histignorespace histreduceblanks
|
||||
setopt autocd nohup listpacked alwaystoend correct interactivecomments no_beep
|
||||
|
||||
# cache and completion
|
||||
zstyle ':completion:*' complete-options true
|
||||
zstyle ':completion:*' completer _complete _ignored _approximate
|
||||
zstyle ':completion:*' menu select _complete _ignored _approximate
|
||||
zstyle ':completion:*' rehash true
|
||||
zstyle ':completion:*' squeeze-slashes true
|
||||
zstyle ':completion:*' use-cache off
|
||||
zstyle ':completion:*' verbose yes
|
||||
zstyle ':completion:*:approximate:*' max-errors 2 numeric
|
||||
zstyle ':completion:*:complete:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'
|
||||
|
||||
# colors and messages
|
||||
zstyle ':completion:*' list-colors '=*=0;38;5;249'
|
||||
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
|
||||
zstyle ':completion:*' select-prompt '%SAt %p: Scrolling active%s'
|
||||
zstyle ':completion:*:corrections' format '%F{cyan}%d%f %F{red}%e%f%F{cyan}:%f'
|
||||
zstyle ':completion:*:descriptions' format '%F{cyan}%d:%f'
|
||||
zstyle ':completion:*:messages' format '%F{orange}%d:%f'
|
||||
zstyle ':completion:*:warnings' format '%F{cyan}- no matches found -%f'
|
||||
zstyle ':prompt:pure:prompt:success' color cyan
|
||||
|
||||
# order and grouping
|
||||
zstyle ':completion:*' file all
|
||||
zstyle ':completion:*' group-name ''
|
||||
zstyle ':completion:*' list-dirs-first true
|
||||
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
|
||||
zstyle ':completion:*:expand:*' tag-order all-expansions
|
||||
zstyle ':completion:*:functions' ignored-patterns '_*'
|
||||
zstyle ':completion:*:manuals' separate-sections true
|
||||
|
||||
# ssh and rsync
|
||||
test -f $HOME/.ssh/config && \
|
||||
zstyle ':completion:*:hosts' hosts ${${${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}
|
||||
zstyle ':completion:*:users' ignored-patterns '_*' 'Guest' 'daemon' 'nobody'
|
||||
|
||||
# hotkeys
|
||||
bindkey '^[[Z' reverse-menu-complete # shift+tab
|
||||
|
||||
unalias run-help 2>/dev/null
|
||||
autoload -Uz run-help
|
||||
autoload -Uz compinit && compinit && zmodload -i zsh/complist
|
||||
autoload -Uz promptinit && promptinit && prompt pure
|
||||
|
||||
source "$ZDOTDIR/grc/grc.zsh"
|
||||
source "$ZDOTDIR/pure/pure.plugin.zsh"
|
||||
source "$ZDOTDIR/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh"
|
||||
source "$ZDOTDIR/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh"
|
||||
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=fg=024
|
||||
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
||||
ZSH_HIGHLIGHT_STYLES[comment]=fg=245
|
95
grc.zsh
95
grc.zsh
|
@ -1,95 +0,0 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
if [ "$TERM" = dumb ] || (( ! $+commands[grc] ))
|
||||
then
|
||||
return
|
||||
fi
|
||||
|
||||
# Supported commands
|
||||
cmds=(
|
||||
as
|
||||
ant
|
||||
blkid
|
||||
cc
|
||||
configure
|
||||
curl
|
||||
cvs
|
||||
df
|
||||
diff
|
||||
dig
|
||||
dnf
|
||||
docker
|
||||
docker-compose
|
||||
docker-machine
|
||||
du
|
||||
env
|
||||
fdisk
|
||||
findmnt
|
||||
free
|
||||
g++
|
||||
gas
|
||||
gcc
|
||||
getfacl
|
||||
getsebool
|
||||
gmake
|
||||
id
|
||||
ifconfig
|
||||
iostat
|
||||
ip
|
||||
iptables
|
||||
iwconfig
|
||||
journalctl
|
||||
kubectl
|
||||
last
|
||||
ldap
|
||||
lolcat
|
||||
ld
|
||||
ls
|
||||
lsattr
|
||||
lsblk
|
||||
lsmod
|
||||
lsof
|
||||
lspci
|
||||
make
|
||||
mount
|
||||
mtr
|
||||
mvn
|
||||
netstat
|
||||
nmap
|
||||
ntpdate
|
||||
php
|
||||
ping
|
||||
ping6
|
||||
proftpd
|
||||
ps
|
||||
sar
|
||||
semanage
|
||||
sensors
|
||||
showmount
|
||||
sockstat
|
||||
ss
|
||||
stat
|
||||
sysctl
|
||||
systemctl
|
||||
tcpdump
|
||||
traceroute
|
||||
traceroute6
|
||||
tune2fs
|
||||
ulimit
|
||||
uptime
|
||||
vmstat
|
||||
wdiff
|
||||
whois
|
||||
)
|
||||
|
||||
# Set alias for available commands.
|
||||
for cmd in $cmds ; do
|
||||
if (( $+commands[$cmd] )) ; then
|
||||
$cmd() {
|
||||
grc --colour=auto ${commands[$0]} "$@"
|
||||
}
|
||||
fi
|
||||
done
|
||||
|
||||
# Clean up variables
|
||||
unset cmds cmd
|
1
k
1
k
|
@ -1 +0,0 @@
|
|||
Subproject commit e2bfbaf3b8ca92d6ffc4280211805ce4b8a8c19e
|
|
@ -0,0 +1,8 @@
|
|||
### Install [exa](https://git.sdf.org/michael/zsh/wiki/exa) and [nano](https://git.sdf.org/michael/zsh/wiki/nano)
|
||||
```
|
||||
git clone --recurse https://git.sdf.org/michael/zsh ~/.config/zsh
|
||||
cp ~/.config/zsh/.zshenv.example ~/.zshenv
|
||||
mkdir -p ~/.config/grc && cd ~/.config/grc && ln -s ../zsh/grc/{grc.conf,colourfiles/*} .
|
||||
chsh -s $(which zsh)
|
||||
```
|
||||
![Screenshot](https://michael.sdf.org/zsh.png)
|
44
stats.sh
44
stats.sh
|
@ -1,44 +0,0 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
l="$(tput setaf 245)" # left
|
||||
h="$(tput setaf 10)" # highlight
|
||||
n="$(tput setaf 28)" # normal
|
||||
|
||||
ip=$(hostname -I 2>/dev/null | awk '{print $1}')
|
||||
[ -z $ip ] && ip="$(curl -4s ifconfig.me)"
|
||||
#sessions=$(who | awk '{print $5}' | wc -l)" session"
|
||||
sessions=$(echo $(who | awk '{print $5}' | wc -l))" session"
|
||||
[ $sessions != "1 session" ] && sessions+=s
|
||||
uptime=$(($(cat /proc/uptime | cut -d'.' -f1)/86400))" day"
|
||||
[ $uptime != "1 day" ] && uptime+=s
|
||||
load=$(awk '{print $1, $2, $3}' /proc/loadavg)
|
||||
#ram_free=$(free -m | grep "m:" | awk '{print $7}')
|
||||
ram_free=$(free -m | grep "m:" | awk '{print $4}')
|
||||
swp_used=$(free -m | grep "p:" | awk '{print $3}')
|
||||
space1=$(df -h / | grep dev | awk '{print $4}')
|
||||
#space2=$(df -h /srv | grep dev | awk '{print $4}')
|
||||
|
||||
echo
|
||||
echo " ${l}Host: ${h}$(hostname) @ $ip ${n}(${h}$sessions ${n}open)"
|
||||
echo " ${l}Load: ${h}$load${n}, ${h}$uptime ${n}up"
|
||||
echo " ${l}Memory: ${h}${ram_free}M ${n}free, ${h}${swp_used}M ${n}swapped"
|
||||
echo " ${l}Space: ${h}/ ${h}$space1 ${n}free"
|
||||
#echo " ${l}Space: ${h}/ ${h}$space1 ${n}free, ${h}/srv $space2 ${n}free"
|
||||
|
||||
|
||||
if command -v vnstat &> /dev/null; then
|
||||
traffic_day=$(vnstat --oneline | awk -F';' '{print $6}')
|
||||
traffic_month=$(vnstat --oneline | awk -F';' '{print $11}')
|
||||
echo " ${l}Traffic: ${h}$traffic_day ${n}today, ${h}$traffic_month ${n}this month"
|
||||
fi
|
||||
|
||||
#echo
|
||||
|
||||
#warn=" $(tput blink; tput setaf 196)!$(tput sgr0)"
|
||||
#fortune -os | cowsay -f `find /usr/share/cowsay/cows -type f -size -400c | shuf -n 1` | lolcat -f -S 50 -p 10 | sed 's/^/ /'
|
||||
#fortune -asn 300 | cowsay -nf small | lolcat -f -S 50 -p 10 | sed 's/^/ /'
|
||||
|
||||
echo "$(tput setaf 245)"
|
||||
#fortune -asn 300 | cowsay -nf small | sed 's/^/ /'
|
||||
fortune -as | cowsay -nf small | sed 's/^/ /'
|
||||
echo "$(tput sgr0)"
|
90
zshrc
90
zshrc
|
@ -1,90 +0,0 @@
|
|||
export ZSHDIR=$HOME/.config/zsh
|
||||
export PATH=$HOME/bin:$PATH
|
||||
export FPATH=$FPATH:$ZSHDIR/pure
|
||||
export HISTFILE=$HOME/.zsh_history
|
||||
export OS="$(uname -s)"
|
||||
#export TERM=xterm-256color
|
||||
export EDITOR=nano
|
||||
export HISTSIZE=1000000
|
||||
export SAVEHIST=1000000
|
||||
export HISTORY_IGNORE="(l *|la *|ls *|cd|cd *|rm *|echo *|find *|cat *|ccat *|apt*|mkdir *|rmdir *|rsync *|git *|nano *|screen *|traceroute *|ping *|whois *|md5sum *|timeout *|tmux *|mount *|openssl *|watch *|dpkg *|chown *|mv *|cp *|grc *|scp *|tail *|wget *|zcat *|time *|curl *|while *|unp *|attr *|dialog *|sysbench *|ftp *|truncate *|ln *|grep *|chmod *|*grep*|man *|pidof *|nslookup *|umount *|sleep *|pushd *| popd *|kill *|su *|tar *|touch *|7z *|hexdump *|du|du *|ack *|\\\\*)"
|
||||
setopt hist_reduce_blanks hist_ignore_space hist_ignore_all_dups interactive_comments share_history
|
||||
|
||||
alias ..="cd .."
|
||||
alias ff="find . -type f -iname"
|
||||
alias fd="find . -type d -iname"
|
||||
alias nolog="unset HISTFILE"
|
||||
alias grep="grep --color=auto"
|
||||
alias cdu="cdu.pl -sridh"
|
||||
alias l="k -h --no-vcs --group-directories-first"
|
||||
alias la="k -h -A --no-vcs --group-directories-first"
|
||||
alias bell='echo -en "\007"'
|
||||
if [ "$OS" = "Linux" ]; then
|
||||
alias rm="rm -I"
|
||||
alias update="sudo apt-get update && sudo apt-get upgrade; sudo apt-get clean"
|
||||
elif [ "$OS" = "Darwin" ]; then
|
||||
alias update="brew update && brew upgrade"
|
||||
fi
|
||||
|
||||
function cheat { curl cheat.sh/$1 }
|
||||
function mcd { mkdir -p $1; cd $1 }
|
||||
function pw { echo `tr -dc ACDEFHJKLMNPRTUVWX </dev/urandom | head -c1``pwgen -AnBs 23 1` | fold -w4 | paste -sd'-' - }
|
||||
function precmd { print -Pn "\e]2;%m (%~)\a\e]1;%m\a"; }
|
||||
function _force_rehash { (( CURRENT==1 )) && rehash; return 1 }
|
||||
|
||||
bindkey -e
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
bindkey '^[[5~' up-line-or-history
|
||||
bindkey '^[[6~' down-line-or-history
|
||||
bindkey '^[[A' up-line-or-search
|
||||
bindkey '^[[B' down-line-or-search
|
||||
bindkey '^[[H' beginning-of-line
|
||||
bindkey '^[[1~' beginning-of-line
|
||||
bindkey '^[[F' end-of-line
|
||||
bindkey '^[[4~' end-of-line
|
||||
bindkey '^[[Z' reverse-menu-complete
|
||||
bindkey '^[[3~' delete-char
|
||||
bindkey '^[3;5~' delete-char
|
||||
bindkey '^[m' copy-prev-shell-word
|
||||
bindkey '^[k' history-beginning-search-backward
|
||||
bindkey '^[j' history-beginning-search-forward
|
||||
bindkey '^[^I' _history-complete-older
|
||||
bindkey '^[^[^I' _history-complete-newer
|
||||
bindkey '^U' backward-kill-line
|
||||
bindkey "^[[1;5C" forward-word
|
||||
bindkey "^[[1;5D" backward-word
|
||||
bindkey "^[[1;5A" beginning-of-line
|
||||
bindkey "^[[1;5B" end-of-line
|
||||
|
||||
autoload -Uz promptinit && promptinit && prompt pure
|
||||
autoload -Uz compinit && compinit && zmodload -i zsh/complist
|
||||
|
||||
# ...*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}' #
|
||||
#zstyle ':completion:::::' completer _force_rehash _complete _approximate
|
||||
zstyle ':completion:::::' completer _expand _complete _prefix _ignored _approximate
|
||||
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
|
||||
zstyle ':completion:*:corrections' format "- %d - (errors %e})"
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' group-name ''
|
||||
zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f'
|
||||
zstyle ':completion:*:warnings' format " ${c160}-- no matches found --%f"
|
||||
zstyle ':completion:*:hosts' hosts ${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}
|
||||
zstyle ':completion:*:users' ignored-patterns '_*' 'Guest' 'daemon' 'nobody'
|
||||
zstyle ':completion:*:(scp|rsync):*' group-order hosts users files all-files
|
||||
#zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
|
||||
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami`"
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
||||
zstyle ':completion:*:*:kill:*' menu yes select
|
||||
zstyle ':completion:*:*:kill:*' force-list always
|
||||
zstyle ':completion:*:*:kill:*' insert-ids single
|
||||
zstyle ':completion:*:manuals' separate-sections true
|
||||
zstyle ':completion:*:manuals.(^1*)' insert-sections true
|
||||
zstyle ':prompt:pure:prompt:success' color cyan
|
||||
|
||||
source $ZSHDIR/grc.zsh
|
||||
source $ZSHDIR/k/k.plugin.zsh
|
||||
source $ZSHDIR/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
source $ZSHDIR/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
|
||||
if [[ -d "$HOME/bin/ImageMagick-7.0.1" ]]; then export MAGICK_HOME="$HOME/bin/ImageMagick-7.0.10"; export PATH="$PATH:$MAGICK_HOME/bin"; export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"; fi
|
||||
# $ZSHDIR/stats.sh
|
Loading…
Reference in New Issue