From d7a3c56269db8e2066412da2d7b3808e531b480c Mon Sep 17 00:00:00 2001 From: cbreton Date: Thu, 10 Oct 2019 09:14:24 +0200 Subject: Rename some dotfile and add a binding for search in history --- dotfiles/zsh/01-aliases.zsh | 314 ++++++++++++++++++++++++++++++++++ dotfiles/zsh/02-autocompletion.zsh | 35 ++++ dotfiles/zsh/03-colored-man-pages.zsh | 24 +++ dotfiles/zsh/04-environment.zsh | 42 +++++ dotfiles/zsh/05-history.zsh | 24 +++ dotfiles/zsh/06-keychain.zsh | 21 +++ dotfiles/zsh/07-plugin.zsh | 8 + dotfiles/zsh/08-keybindings.zsh | 59 +++++++ dotfiles/zsh/09-prompt.zsh | 118 +++++++++++++ dotfiles/zsh/10-security.zsh | 20 +++ dotfiles/zsh/11-sourcerer.zsh | 37 ++++ dotfiles/zsh/12-syntax.zsh | 40 +++++ dotfiles/zsh/aliases.zsh | 313 --------------------------------- dotfiles/zsh/autocompletion.zsh | 35 ---- dotfiles/zsh/colored-man-pages.zsh | 24 --- dotfiles/zsh/environment.zsh | 42 ----- dotfiles/zsh/history.zsh | 24 --- dotfiles/zsh/keybindings.zsh | 56 ------ dotfiles/zsh/keychain.zsh | 21 --- dotfiles/zsh/plugin.zsh | 8 - dotfiles/zsh/prompt.zsh | 118 ------------- dotfiles/zsh/security.zsh | 20 --- dotfiles/zsh/sourcerer.zsh | 37 ---- dotfiles/zsh/syntax.zsh | 40 ----- 24 files changed, 742 insertions(+), 738 deletions(-) create mode 100755 dotfiles/zsh/01-aliases.zsh create mode 100755 dotfiles/zsh/02-autocompletion.zsh create mode 100755 dotfiles/zsh/03-colored-man-pages.zsh create mode 100755 dotfiles/zsh/04-environment.zsh create mode 100755 dotfiles/zsh/05-history.zsh create mode 100755 dotfiles/zsh/06-keychain.zsh create mode 100644 dotfiles/zsh/07-plugin.zsh create mode 100755 dotfiles/zsh/08-keybindings.zsh create mode 100644 dotfiles/zsh/09-prompt.zsh create mode 100644 dotfiles/zsh/10-security.zsh create mode 100644 dotfiles/zsh/11-sourcerer.zsh create mode 100644 dotfiles/zsh/12-syntax.zsh delete mode 100755 dotfiles/zsh/aliases.zsh delete mode 100755 dotfiles/zsh/autocompletion.zsh delete mode 100755 dotfiles/zsh/colored-man-pages.zsh delete mode 100755 dotfiles/zsh/environment.zsh delete mode 100755 dotfiles/zsh/history.zsh delete mode 100755 dotfiles/zsh/keybindings.zsh delete mode 100755 dotfiles/zsh/keychain.zsh delete mode 100644 dotfiles/zsh/plugin.zsh delete mode 100644 dotfiles/zsh/prompt.zsh delete mode 100644 dotfiles/zsh/security.zsh delete mode 100644 dotfiles/zsh/sourcerer.zsh delete mode 100644 dotfiles/zsh/syntax.zsh diff --git a/dotfiles/zsh/01-aliases.zsh b/dotfiles/zsh/01-aliases.zsh new file mode 100755 index 0000000..6888451 --- /dev/null +++ b/dotfiles/zsh/01-aliases.zsh @@ -0,0 +1,314 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ neodarz +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ aliases +#alias l='ls -F --color=auto --group-directories-first' +#alias la='ls -lahF --color=auto --group-directories-first --time-style=+"%d.%m.%Y %H:%M"' +#alias ll='ls -lhF --color=auto --group-directories-first --time-style=+"%d.%m.%Y %H:%M"' +#alias ls='ls -F --color=auto --group-directories-first' +alias ls="exa" +alias la="exa -a" +alias ll="exa -l" +alias lg="exa -l --git" +llo() { ls -l "$@" | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'; } +alias ".."="cd ../" +alias "..."="cd ../.." +alias ".3"="cd ../../.." +alias ".4"='cd ../../../../' +alias ".5"='cd ../../../../..' +alias rmi="rm -i" +alias rmr="rm -if" +alias rmrf="rm -irf" +alias psef="ps -ef" +alias mkdir="mkdir -pv" +#alias cp="cp -r" +alias cp="rsync -ahv --progress" +alias cps="sudo rsync -ahv --progress" +alias scp="scp -r" +alias xsel="xsel -b" +#alias fuck='sudo $(fc -ln -1)' +alias v="nvim" +alias vi="nvim" +alias emacs="nvim" +alias vs="sudo -E nvim" +alias edit="nvim" +alias vinstall="v +PluginInstall +qall" +alias g="git" +alias ga="git add -p" +alias gap="git add -p" +alias gc="git commit" +alias gs="git status" +alias gd="git diff" +#alias gf="git fetch" To use with hub command +alias gm="git merge" +alias gr="git rebase" +alias gp="git push" +alias gu="git pull" +#alias gu="git unstage" # To use with hub command +#alias gg="git graph" # To use with hub command +alias gco="git checkout" +alias gcs="git commit -S -m" +alias gcurl="git config --get remote.origin.url" +#alias gpr="hub pull-request" To use with hub command +#alias ag="ag --color --color-line-number '0;35' --color-match '46;30' --color-path '4;36'" +alias ag="rg" +alias tree='tree -CAFa -I "CVS|*.*.package|.svn|.git|.hg|node_modules|bower_components" --dirsfirst' +alias mixer="alsamixer" +#alias genplaylist="cd ~/music;find . -name '*.mp3' -o -name '*.flac'|sed -e 's%^./%%g' > ~/.mpd/playlists/all.m3u" +#alias find="fd" # Remove this alias because conflid when script use find command +alias matrix="cmatrix -b" +alias tempwatch="while :; do sensors; sleep 1 && clear; done;" +#alias term="urxvtc -hold -e " #used for run menu +#alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" +#alias clbin="curl -F 'clbin=<-' https://clbin.com" +alias toiletlist='for i in ${TOILET_FONT_PATH:=/usr/share/figlet}/*.{t,f}lf; do j=${i##*/}; echo ""; echo "╓───── "$j; echo "╙────────────────────────────────────── ─ ─ "; echo ""; toilet -d "${i%/*}" -f "$j" "${j%.*}"; done' +alias ascii="toilet -t -f 3d" # install from here https://github.com/xero/figlet-fonts +alias future="toilet -t -f future" +alias rusto="toilet -t -f rusto" +alias rustofat="toilet -t -f rustofat" +alias lol="base64 ~/.config/mpd/playlists/all.m3u +# mpc clear +# mpc load all.m3u +# mpc update +#} + +alias tm="~/.scripts/tm.sh" + +alias mpvnv="mpv --no-video " + +alias listalias="cat ~/.zsh/aliases.zsh | grep '^alias' | sed 's/^alias //g'" +alias searchalias="cat ~/.zsh/aliases.zsh | grep '^alias' | sed 's/^alias //g' | peco" + +function email() { + echo $3 | mutt -s $2 $1 +} + +function vpro() { + sudo systemctl $1 vpn-pro.service +} + +function vperso() { + sudo systemctl $1 vpn-perso.service +} + +# colorized cat +function c() { + for file in "$@" + do + pygmentize -O style=sourcerer -f console256 -g "$file" + done +} +# colorized less +function le() { + pygmentize -O style=sourcerer -f console256 -g $1 | less -r +} +# read markdown files like manpages +function mdm() { + pandoc -s -f markdown -t man "$*" | man -l - +} +# nullpointer url shortener +#function short() { +# curl -F"shorten=$*" https://0x0.st +#} + +if ! pgrep -u "$USER" ssh-agent > /dev/null; then + ssh-agent > ~/.ssh-agent-thing +fi +if [[ "$SSH_AGENT_PID" == "" ]]; then + eval "$(<~/.ssh-agent-thing)" +fi + +alias librefox="firefox -p librefox --no-remote" diff --git a/dotfiles/zsh/02-autocompletion.zsh b/dotfiles/zsh/02-autocompletion.zsh new file mode 100755 index 0000000..15ef28c --- /dev/null +++ b/dotfiles/zsh/02-autocompletion.zsh @@ -0,0 +1,35 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ autocompletion systems +autoload -Uz compinit +compinit +autoload -U ~/.zsh/completion/*(:t) +zstyle ':completion:*' auto-description 'specify: %d' +zstyle ':completion:*' completer _expand _complete _correct _approximate +zstyle ':completion:*' format 'Completing %d' +zstyle ':completion:*' group-name '' +zstyle ':completion:*' menu select=2 eval "$(dircolors -b)" +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*' list-colors '' +zstyle ':completion:*' list-prompt %SAt %p: hit TAB for more, or the character to insert%s +zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' +zstyle ':completion:*' menu select=long +zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s +zstyle ':completion:*' use-compctl false +zstyle ':completion:*' verbose true +zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' +zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' diff --git a/dotfiles/zsh/03-colored-man-pages.zsh b/dotfiles/zsh/03-colored-man-pages.zsh new file mode 100755 index 0000000..5819c4f --- /dev/null +++ b/dotfiles/zsh/03-colored-man-pages.zsh @@ -0,0 +1,24 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ source: https://github.com/imkira/dotfiles/blob/master/.zsh/colored-man-pages.zsh +export LESS_TERMCAP_mb=$'\E[01;31m' +export LESS_TERMCAP_md=$'\E[01;38;5;74m' +export LESS_TERMCAP_me=$'\E[0m' +export LESS_TERMCAP_se=$'\E[0m' +export LESS_TERMCAP_so=$'\E[38;33;246m' +export LESS_TERMCAP_ue=$'\E[0m' +export LESS_TERMCAP_us=$'\E[04;38;5;146m' diff --git a/dotfiles/zsh/04-environment.zsh b/dotfiles/zsh/04-environment.zsh new file mode 100755 index 0000000..25c8212 --- /dev/null +++ b/dotfiles/zsh/04-environment.zsh @@ -0,0 +1,42 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ timestamps +#HIST_STAMPS=mm/dd/yyyy + +#█▓▒░ paths +export PATH=$HOME/bin:/usr/local/bin:/home/neodarz/.gem/ruby/2.6.0/bin:/home/neodarz/.local/bin::/home/neodarz/go/bin:$HOME/.rbenv/bin:/opt/cuda/bin:$PATH +#export MANPATH=/usr/local/man:$MANPATH + +#█▓▒░ preferred editor for local and remote sessions +export EDITOR=vim +export VISUAL=vim + +#█▓▒░ language +export LC_COLLATE=en_US.UTF-8 +export LC_CTYPE=en_US.UTF-8 +export LC_MESSAGES=en_US.UTF-8 +export LC_MONETARY=en_US.UTF-8 +export LC_NUMERIC=en_US.UTF-8 +export LC_TIME=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 +#export LANG=en_US.UTF-8 +export LANGUAGE=en_US.UTF-8 +export LESSCHARSET=utf-8 +export GPG_TTY=$(tty) +eval $(thefuck --alias) + +source /usr/bin/virtualenvwrapper.sh diff --git a/dotfiles/zsh/05-history.zsh b/dotfiles/zsh/05-history.zsh new file mode 100755 index 0000000..eec299f --- /dev/null +++ b/dotfiles/zsh/05-history.zsh @@ -0,0 +1,24 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ history +HISTFILE=~/.zhistory +setopt APPEND_HISTORY +HISTSIZE=1200 +SAVEHIST=1000 +setopt HIST_EXPIRE_DUPS_FIRST +setopt EXTENDED_HISTORY +setopt SHARE_HISTORY diff --git a/dotfiles/zsh/06-keychain.zsh b/dotfiles/zsh/06-keychain.zsh new file mode 100755 index 0000000..1585f26 --- /dev/null +++ b/dotfiles/zsh/06-keychain.zsh @@ -0,0 +1,21 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ ssh keys +#export SSH_KEY_PATH="~/.ssh/id_rsa" + +#█▓▒░ funtoo keychain +#eval `keychain -q --eval ~/.ssh/id_rsa` diff --git a/dotfiles/zsh/07-plugin.zsh b/dotfiles/zsh/07-plugin.zsh new file mode 100644 index 0000000..9515043 --- /dev/null +++ b/dotfiles/zsh/07-plugin.zsh @@ -0,0 +1,8 @@ +bindkey -v + +source ~/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source ~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh +source ~/.zsh/plugins/zsh-completions/zsh-completions.plugin.zsh +source ~/.zsh/plugins/zsh-system-clipboard/zsh-system-clipboard.zsh +source /etc/profile.d/autojump.zsh diff --git a/dotfiles/zsh/08-keybindings.zsh b/dotfiles/zsh/08-keybindings.zsh new file mode 100755 index 0000000..cc32062 --- /dev/null +++ b/dotfiles/zsh/08-keybindings.zsh @@ -0,0 +1,59 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ keybindings +bindkey -v +typeset -A key + +key[Home]=${terminfo[khome]} +key[End]=${terminfo[kend]} +key[Insert]=${terminfo[kich1]} +key[Delete]=${terminfo[kdch1]} +key[Up]=${terminfo[kcuu1]} +key[Down]=${terminfo[kcud1]} +key[Left]=${terminfo[kcub1]} +key[Right]=${terminfo[kcuf1]} +key[PageUp]=${terminfo[kpp]} +key[PageDown]=${terminfo[knp]} + +[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line +[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line +[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode +[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char +[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history +[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history +[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char +[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char +[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history +[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history + +if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then + function zle-line-init () { + printf '%s' "${terminfo[smkx]}" + } + function zle-line-finish () { + printf '%s' "${terminfo[rmkx]}" + } + zle -N zle-line-init + zle -N zle-line-finish +fi + +# Navigate words with ctrl+arrow keys +bindkey '^[[1;5D' backward-word +bindkey '^[[1;5C' forward-word + +bindkey '^k' history-substring-search-up +bindkey '^j' history-substring-search-down diff --git a/dotfiles/zsh/09-prompt.zsh b/dotfiles/zsh/09-prompt.zsh new file mode 100644 index 0000000..9c5fce6 --- /dev/null +++ b/dotfiles/zsh/09-prompt.zsh @@ -0,0 +1,118 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +autoload -U compinit colors zcalc +compinit -d +colors + +ICO_DIRTY="⚡" +#ICO_DIRTY="↯" +#ICO_DIRTY="*" +ICO_AHEAD="↑" +#ICO_AHEAD="🠙" +#ICO_AHEAD="▲" +ICO_BEHIND="↓" +#ICO_BEHIND="🠛" +#ICO_BEHIND="▼" +ICO_DIVERGED="⥮" +COLOR_ROOT="%{$fg_bold[red]%}" +COLOR_USER="%F{white}" +COLOR_NORMAL="%F{white}" +PROMPT_STYLE="classic" +# Modify the colors and symbols in these variables as desired. +GIT_PROMPT_SYMBOL="%{$fg[blue]%}±" # plus/minus - clean repo +GIT_PROMPT_PREFIX="%{$fg[green]%} %{$reset_color%}" +GIT_PROMPT_SUFFIX="%{$fg[green]%}%{$reset_color%}" +GIT_PROMPT_AHEAD="%{$fg[red]%}ANUM%{$reset_color%}" # A"NUM" - ahead by "NUM" commits +GIT_PROMPT_BEHIND="%{$fg[white]%}BNUM%{$reset_color%}" # B"NUM" - behind by "NUM" commits +GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}⚡%{$reset_color%}" # lightning bolt - merge conflict +GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●%{$reset_color%}" # red circle - untracked files +GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}●%{$reset_color%}" # yellow circle - tracked files modified +GIT_PROMPT_STAGED="%{$fg_bold[green]%}●%{$reset_color%}" # green circle - staged changes present = ready for "git push" + +parse_git_branch() { + # Show Git branch/tag, or name-rev if on detached head + ( git symbolic-ref -q HEAD || git name-rev --name-only --no-undefined --always HEAD ) 2> /dev/null +} + +parse_git_state() { + # Show different symbols as appropriate for various Git repository states + # Compose this value via multiple conditional appends. + local GIT_STATE="" + local NUM_AHEAD="$(git log --oneline @{u}.. 2> /dev/null | wc -l | tr -d ' ')" + if [ "$NUM_AHEAD" -gt 0 ]; then + GIT_STATE=$GIT_STATE${GIT_PROMPT_AHEAD//NUM/$NUM_AHEAD} + fi + local NUM_BEHIND="$(git log --oneline ..@{u} 2> /dev/null | wc -l | tr -d ' ')" + if [ "$NUM_BEHIND" -gt 0 ]; then + GIT_STATE=$GIT_STATE${GIT_PROMPT_BEHIND//NUM/$NUM_BEHIND} + fi + local GIT_DIR="$(git rev-parse --git-dir 2> /dev/null)" + if [ -n $GIT_DIR ] && test -r $GIT_DIR/MERGE_HEAD; then + GIT_STATE=$GIT_STATE$GIT_PROMPT_MERGING + fi + if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then + GIT_STATE=$GIT_STATE$GIT_PROMPT_UNTRACKED + fi + if ! git diff --quiet 2> /dev/null; then + GIT_STATE=$GIT_STATE$GIT_PROMPT_MODIFIED + fi + if ! git diff --cached --quiet 2> /dev/null; then + GIT_STATE=$GIT_STATE$GIT_PROMPT_STAGED + fi + if [[ -n $GIT_STATE ]]; then + echo "$GIT_PROMPT_PREFIX$GIT_STATE$GIT_PROMPT_SUFFIX" + fi +} + + +#█▓▒░ allow functions in the prompt +setopt PROMPT_SUBST +autoload -Uz colors && colors + +#█▓▒░ colors for permissions +if [[ "$EUID" -ne "0" ]] +then # if user is not root + USER_LEVEL="${COLOR_USER}" +else # root! + USER_LEVEL="${COLOR_ROOT}" +fi + +git_prompt_string() { + local git_where="$(parse_git_branch)" + + # If inside a Git repository, print its branch and state + [ -n "$git_where" ] && echo "[$GIT_PROMPT_SYMBOL$(parse_git_state)$GIT_PROMPT_PREFIX%{$fg[yellow]%}${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX%F{white}]─" + + # If not inside the Git repo, print exit codes of last command (only if it failed) + #[ ! -n "$git_where" ] && echo "%{$fg[red]%}%(?..%?)" +} + + +function error() { + echo "%(?..[$fg[red]%?%F{white}]─)" +} + +function host() { + if [[ -n $SSH_CONNECTION ]]; then + echo "%{$fg_bold[red]%}!$reset_color%F{white}$HOST" + else + echo "$HOST" + fi +} + +PROMPT='%F{white}┌─[${USER_LEVEL}$USER$reset_color%F{white}@$(host)]─$(git_prompt_string)$(error)[%~] +└─ - %f' +setfont lat0-08 diff --git a/dotfiles/zsh/10-security.zsh b/dotfiles/zsh/10-security.zsh new file mode 100644 index 0000000..e24fd52 --- /dev/null +++ b/dotfiles/zsh/10-security.zsh @@ -0,0 +1,20 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ av aliases +alias checkrootkits="sudo rkhunter --update; sudo rkhunter --propupd; sudo rkhunter --check" +alias checkvirus="clamscan --recursive=yes --infected /home" +alias updateantivirus="sudo freshclam" diff --git a/dotfiles/zsh/11-sourcerer.zsh b/dotfiles/zsh/11-sourcerer.zsh new file mode 100644 index 0000000..0826d04 --- /dev/null +++ b/dotfiles/zsh/11-sourcerer.zsh @@ -0,0 +1,37 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ tty colors +if [ "$TERM" = "linux" ] +then + echo -en "\e]P0222222" #black + echo -en "\e]P8111111" #darkgrey + echo -en "\e]P1aa4450" #darkred + echo -en "\e]P9ff6a6a" #red + echo -en "\e]P2719611" #darkgreen + echo -en "\e]PAb1d631" #green + echo -en "\e]P3cc8800" #brown + echo -en "\e]PBff9800" #yellow + echo -en "\e]P46688aa" #darkblue + echo -en "\e]PC90b0d1" #blue + echo -en "\e]P58f6f8f" #darkmagenta + echo -en "\e]PD8181a6" #magenta + echo -en "\e]P6528b8b" #darkcyan + echo -en "\e]PE87ceeb" #cyan + echo -en "\e]P7d3d3d3" #lightgrey + echo -en "\e]PFc1cdc1" #white + clear #for background artifacting +fi diff --git a/dotfiles/zsh/12-syntax.zsh b/dotfiles/zsh/12-syntax.zsh new file mode 100644 index 0000000..755d9ff --- /dev/null +++ b/dotfiles/zsh/12-syntax.zsh @@ -0,0 +1,40 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ color overrides +ZSH_HIGHLIGHT_STYLES[default]='none' +ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red' +ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow' +ZSH_HIGHLIGHT_STYLES[alias]='fg=blue' +ZSH_HIGHLIGHT_STYLES[builtin]='fg=blue' +ZSH_HIGHLIGHT_STYLES[function]='fg=blue' +ZSH_HIGHLIGHT_STYLES[command]='fg=blue' +ZSH_HIGHLIGHT_STYLES[precommand]='none' +ZSH_HIGHLIGHT_STYLES[commandseparator]='none' +ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=blue' +ZSH_HIGHLIGHT_STYLES[path]='none' +ZSH_HIGHLIGHT_STYLES[path_prefix]='none' +ZSH_HIGHLIGHT_STYLES[path_approx]='fg=yellow' +ZSH_HIGHLIGHT_STYLES[globbing]='fg=green' +ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=green' +ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=magenta' +ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=red' +ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='none' +ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=yellow' +ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=yellow' +ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan' +ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan' +ZSH_HIGHLIGHT_STYLES[assign]='none' diff --git a/dotfiles/zsh/aliases.zsh b/dotfiles/zsh/aliases.zsh deleted file mode 100755 index f9658d3..0000000 --- a/dotfiles/zsh/aliases.zsh +++ /dev/null @@ -1,313 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ neodarz -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ aliases -#alias l='ls -F --color=auto --group-directories-first' -#alias la='ls -lahF --color=auto --group-directories-first --time-style=+"%d.%m.%Y %H:%M"' -#alias ll='ls -lhF --color=auto --group-directories-first --time-style=+"%d.%m.%Y %H:%M"' -#alias ls='ls -F --color=auto --group-directories-first' -alias ls="exa" -alias la="exa -a" -alias ll="exa -l" -alias lg="exa -l --git" -llo() { ls -l "$@" | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'; } -alias ".."="cd ../" -alias "..."="cd ../.." -alias ".3"="cd ../../.." -alias ".4"='cd ../../../../' -alias ".5"='cd ../../../../..' -alias rm="rm -i" -alias rmr="rm -if" -alias rmrf="rm -irf" -alias psef="ps -ef" -alias mkdir="mkdir -pv" -#alias cp="cp -r" -alias cp="rsync -ahv --progress" -alias cps="sudo rsync -ahv --progress" -alias scp="scp -r" -alias xsel="xsel -b" -#alias fuck='sudo $(fc -ln -1)' -alias v="nvim" -alias vi="nvim" -alias emacs="nvim" -alias vs="sudo -E nvim" -alias edit="nvim" -alias vinstall="v +PluginInstall +qall" -alias g="git" -alias ga="git add -p" -alias gap="git add -p" -alias gc="git commit" -alias gs="git status" -alias gd="git diff" -#alias gf="git fetch" To use with hub command -alias gm="git merge" -alias gr="git rebase" -alias gp="git push" -alias gu="git pull" -#alias gu="git unstage" # To use with hub command -#alias gg="git graph" # To use with hub command -alias gco="git checkout" -alias gcs="git commit -S -m" -alias gcurl="git config --get remote.origin.url" -#alias gpr="hub pull-request" To use with hub command -#alias ag="ag --color --color-line-number '0;35' --color-match '46;30' --color-path '4;36'" -alias ag="rg" -alias tree='tree -CAFa -I "CVS|*.*.package|.svn|.git|.hg|node_modules|bower_components" --dirsfirst' -alias mixer="alsamixer" -#alias genplaylist="cd ~/music;find . -name '*.mp3' -o -name '*.flac'|sed -e 's%^./%%g' > ~/.mpd/playlists/all.m3u" -#alias find="fd" # Remove this alias because conflid when script use find command -alias matrix="cmatrix -b" -alias tempwatch="while :; do sensors; sleep 1 && clear; done;" -#alias term="urxvtc -hold -e " #used for run menu -#alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" -#alias clbin="curl -F 'clbin=<-' https://clbin.com" -alias toiletlist='for i in ${TOILET_FONT_PATH:=/usr/share/figlet}/*.{t,f}lf; do j=${i##*/}; echo ""; echo "╓───── "$j; echo "╙────────────────────────────────────── ─ ─ "; echo ""; toilet -d "${i%/*}" -f "$j" "${j%.*}"; done' -alias ascii="toilet -t -f 3d" # install from here https://github.com/xero/figlet-fonts -alias future="toilet -t -f future" -alias rusto="toilet -t -f rusto" -alias rustofat="toilet -t -f rustofat" -alias lol="base64 ~/.config/mpd/playlists/all.m3u -# mpc clear -# mpc load all.m3u -# mpc update -#} - -alias tm="~/.scripts/tm.sh" - -alias mpvnv="mpv --no-video " - -alias listalias="cat ~/.zsh/aliases.zsh | grep '^alias' | sed 's/^alias //g'" -alias searchalias="cat ~/.zsh/aliases.zsh | grep '^alias' | sed 's/^alias //g' | peco" - -function email() { - echo $3 | mutt -s $2 $1 -} - -function vpro() { - sudo systemctl $1 vpn-pro.service -} - -function vperso() { - sudo systemctl $1 vpn-perso.service -} - -# colorized cat -function c() { - for file in "$@" - do - pygmentize -O style=sourcerer -f console256 -g "$file" - done -} -# colorized less -function le() { - pygmentize -O style=sourcerer -f console256 -g $1 | less -r -} -# read markdown files like manpages -function mdm() { - pandoc -s -f markdown -t man "$*" | man -l - -} -# nullpointer url shortener -#function short() { -# curl -F"shorten=$*" https://0x0.st -#} - -if ! pgrep -u "$USER" ssh-agent > /dev/null; then - ssh-agent > ~/.ssh-agent-thing -fi -if [[ "$SSH_AGENT_PID" == "" ]]; then - eval "$(<~/.ssh-agent-thing)" -fi - -alias librefox="firefox -p librefox --no-remote" diff --git a/dotfiles/zsh/autocompletion.zsh b/dotfiles/zsh/autocompletion.zsh deleted file mode 100755 index 15ef28c..0000000 --- a/dotfiles/zsh/autocompletion.zsh +++ /dev/null @@ -1,35 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ autocompletion systems -autoload -Uz compinit -compinit -autoload -U ~/.zsh/completion/*(:t) -zstyle ':completion:*' auto-description 'specify: %d' -zstyle ':completion:*' completer _expand _complete _correct _approximate -zstyle ':completion:*' format 'Completing %d' -zstyle ':completion:*' group-name '' -zstyle ':completion:*' menu select=2 eval "$(dircolors -b)" -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} -zstyle ':completion:*' list-colors '' -zstyle ':completion:*' list-prompt %SAt %p: hit TAB for more, or the character to insert%s -zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' -zstyle ':completion:*' menu select=long -zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s -zstyle ':completion:*' use-compctl false -zstyle ':completion:*' verbose true -zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' -zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' diff --git a/dotfiles/zsh/colored-man-pages.zsh b/dotfiles/zsh/colored-man-pages.zsh deleted file mode 100755 index 5819c4f..0000000 --- a/dotfiles/zsh/colored-man-pages.zsh +++ /dev/null @@ -1,24 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ source: https://github.com/imkira/dotfiles/blob/master/.zsh/colored-man-pages.zsh -export LESS_TERMCAP_mb=$'\E[01;31m' -export LESS_TERMCAP_md=$'\E[01;38;5;74m' -export LESS_TERMCAP_me=$'\E[0m' -export LESS_TERMCAP_se=$'\E[0m' -export LESS_TERMCAP_so=$'\E[38;33;246m' -export LESS_TERMCAP_ue=$'\E[0m' -export LESS_TERMCAP_us=$'\E[04;38;5;146m' diff --git a/dotfiles/zsh/environment.zsh b/dotfiles/zsh/environment.zsh deleted file mode 100755 index 25c8212..0000000 --- a/dotfiles/zsh/environment.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ timestamps -#HIST_STAMPS=mm/dd/yyyy - -#█▓▒░ paths -export PATH=$HOME/bin:/usr/local/bin:/home/neodarz/.gem/ruby/2.6.0/bin:/home/neodarz/.local/bin::/home/neodarz/go/bin:$HOME/.rbenv/bin:/opt/cuda/bin:$PATH -#export MANPATH=/usr/local/man:$MANPATH - -#█▓▒░ preferred editor for local and remote sessions -export EDITOR=vim -export VISUAL=vim - -#█▓▒░ language -export LC_COLLATE=en_US.UTF-8 -export LC_CTYPE=en_US.UTF-8 -export LC_MESSAGES=en_US.UTF-8 -export LC_MONETARY=en_US.UTF-8 -export LC_NUMERIC=en_US.UTF-8 -export LC_TIME=en_US.UTF-8 -export LC_ALL=en_US.UTF-8 -#export LANG=en_US.UTF-8 -export LANGUAGE=en_US.UTF-8 -export LESSCHARSET=utf-8 -export GPG_TTY=$(tty) -eval $(thefuck --alias) - -source /usr/bin/virtualenvwrapper.sh diff --git a/dotfiles/zsh/history.zsh b/dotfiles/zsh/history.zsh deleted file mode 100755 index eec299f..0000000 --- a/dotfiles/zsh/history.zsh +++ /dev/null @@ -1,24 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ history -HISTFILE=~/.zhistory -setopt APPEND_HISTORY -HISTSIZE=1200 -SAVEHIST=1000 -setopt HIST_EXPIRE_DUPS_FIRST -setopt EXTENDED_HISTORY -setopt SHARE_HISTORY diff --git a/dotfiles/zsh/keybindings.zsh b/dotfiles/zsh/keybindings.zsh deleted file mode 100755 index c3e2784..0000000 --- a/dotfiles/zsh/keybindings.zsh +++ /dev/null @@ -1,56 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ keybindings -bindkey -v -typeset -A key - -key[Home]=${terminfo[khome]} -key[End]=${terminfo[kend]} -key[Insert]=${terminfo[kich1]} -key[Delete]=${terminfo[kdch1]} -key[Up]=${terminfo[kcuu1]} -key[Down]=${terminfo[kcud1]} -key[Left]=${terminfo[kcub1]} -key[Right]=${terminfo[kcuf1]} -key[PageUp]=${terminfo[kpp]} -key[PageDown]=${terminfo[knp]} - -[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line -[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line -[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode -[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char -[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history -[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history -[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char -[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char -[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history -[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history - -if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then - function zle-line-init () { - printf '%s' "${terminfo[smkx]}" - } - function zle-line-finish () { - printf '%s' "${terminfo[rmkx]}" - } - zle -N zle-line-init - zle -N zle-line-finish -fi - -# Navigate words with ctrl+arrow keys -bindkey '^[[1;5D' backward-word -bindkey '^[[1;5C' forward-word diff --git a/dotfiles/zsh/keychain.zsh b/dotfiles/zsh/keychain.zsh deleted file mode 100755 index 1585f26..0000000 --- a/dotfiles/zsh/keychain.zsh +++ /dev/null @@ -1,21 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ ssh keys -#export SSH_KEY_PATH="~/.ssh/id_rsa" - -#█▓▒░ funtoo keychain -#eval `keychain -q --eval ~/.ssh/id_rsa` diff --git a/dotfiles/zsh/plugin.zsh b/dotfiles/zsh/plugin.zsh deleted file mode 100644 index 9515043..0000000 --- a/dotfiles/zsh/plugin.zsh +++ /dev/null @@ -1,8 +0,0 @@ -bindkey -v - -source ~/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh -source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -source ~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh -source ~/.zsh/plugins/zsh-completions/zsh-completions.plugin.zsh -source ~/.zsh/plugins/zsh-system-clipboard/zsh-system-clipboard.zsh -source /etc/profile.d/autojump.zsh diff --git a/dotfiles/zsh/prompt.zsh b/dotfiles/zsh/prompt.zsh deleted file mode 100644 index 9c5fce6..0000000 --- a/dotfiles/zsh/prompt.zsh +++ /dev/null @@ -1,118 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -autoload -U compinit colors zcalc -compinit -d -colors - -ICO_DIRTY="⚡" -#ICO_DIRTY="↯" -#ICO_DIRTY="*" -ICO_AHEAD="↑" -#ICO_AHEAD="🠙" -#ICO_AHEAD="▲" -ICO_BEHIND="↓" -#ICO_BEHIND="🠛" -#ICO_BEHIND="▼" -ICO_DIVERGED="⥮" -COLOR_ROOT="%{$fg_bold[red]%}" -COLOR_USER="%F{white}" -COLOR_NORMAL="%F{white}" -PROMPT_STYLE="classic" -# Modify the colors and symbols in these variables as desired. -GIT_PROMPT_SYMBOL="%{$fg[blue]%}±" # plus/minus - clean repo -GIT_PROMPT_PREFIX="%{$fg[green]%} %{$reset_color%}" -GIT_PROMPT_SUFFIX="%{$fg[green]%}%{$reset_color%}" -GIT_PROMPT_AHEAD="%{$fg[red]%}ANUM%{$reset_color%}" # A"NUM" - ahead by "NUM" commits -GIT_PROMPT_BEHIND="%{$fg[white]%}BNUM%{$reset_color%}" # B"NUM" - behind by "NUM" commits -GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}⚡%{$reset_color%}" # lightning bolt - merge conflict -GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●%{$reset_color%}" # red circle - untracked files -GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}●%{$reset_color%}" # yellow circle - tracked files modified -GIT_PROMPT_STAGED="%{$fg_bold[green]%}●%{$reset_color%}" # green circle - staged changes present = ready for "git push" - -parse_git_branch() { - # Show Git branch/tag, or name-rev if on detached head - ( git symbolic-ref -q HEAD || git name-rev --name-only --no-undefined --always HEAD ) 2> /dev/null -} - -parse_git_state() { - # Show different symbols as appropriate for various Git repository states - # Compose this value via multiple conditional appends. - local GIT_STATE="" - local NUM_AHEAD="$(git log --oneline @{u}.. 2> /dev/null | wc -l | tr -d ' ')" - if [ "$NUM_AHEAD" -gt 0 ]; then - GIT_STATE=$GIT_STATE${GIT_PROMPT_AHEAD//NUM/$NUM_AHEAD} - fi - local NUM_BEHIND="$(git log --oneline ..@{u} 2> /dev/null | wc -l | tr -d ' ')" - if [ "$NUM_BEHIND" -gt 0 ]; then - GIT_STATE=$GIT_STATE${GIT_PROMPT_BEHIND//NUM/$NUM_BEHIND} - fi - local GIT_DIR="$(git rev-parse --git-dir 2> /dev/null)" - if [ -n $GIT_DIR ] && test -r $GIT_DIR/MERGE_HEAD; then - GIT_STATE=$GIT_STATE$GIT_PROMPT_MERGING - fi - if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then - GIT_STATE=$GIT_STATE$GIT_PROMPT_UNTRACKED - fi - if ! git diff --quiet 2> /dev/null; then - GIT_STATE=$GIT_STATE$GIT_PROMPT_MODIFIED - fi - if ! git diff --cached --quiet 2> /dev/null; then - GIT_STATE=$GIT_STATE$GIT_PROMPT_STAGED - fi - if [[ -n $GIT_STATE ]]; then - echo "$GIT_PROMPT_PREFIX$GIT_STATE$GIT_PROMPT_SUFFIX" - fi -} - - -#█▓▒░ allow functions in the prompt -setopt PROMPT_SUBST -autoload -Uz colors && colors - -#█▓▒░ colors for permissions -if [[ "$EUID" -ne "0" ]] -then # if user is not root - USER_LEVEL="${COLOR_USER}" -else # root! - USER_LEVEL="${COLOR_ROOT}" -fi - -git_prompt_string() { - local git_where="$(parse_git_branch)" - - # If inside a Git repository, print its branch and state - [ -n "$git_where" ] && echo "[$GIT_PROMPT_SYMBOL$(parse_git_state)$GIT_PROMPT_PREFIX%{$fg[yellow]%}${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX%F{white}]─" - - # If not inside the Git repo, print exit codes of last command (only if it failed) - #[ ! -n "$git_where" ] && echo "%{$fg[red]%}%(?..%?)" -} - - -function error() { - echo "%(?..[$fg[red]%?%F{white}]─)" -} - -function host() { - if [[ -n $SSH_CONNECTION ]]; then - echo "%{$fg_bold[red]%}!$reset_color%F{white}$HOST" - else - echo "$HOST" - fi -} - -PROMPT='%F{white}┌─[${USER_LEVEL}$USER$reset_color%F{white}@$(host)]─$(git_prompt_string)$(error)[%~] -└─ - %f' -setfont lat0-08 diff --git a/dotfiles/zsh/security.zsh b/dotfiles/zsh/security.zsh deleted file mode 100644 index e24fd52..0000000 --- a/dotfiles/zsh/security.zsh +++ /dev/null @@ -1,20 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ av aliases -alias checkrootkits="sudo rkhunter --update; sudo rkhunter --propupd; sudo rkhunter --check" -alias checkvirus="clamscan --recursive=yes --infected /home" -alias updateantivirus="sudo freshclam" diff --git a/dotfiles/zsh/sourcerer.zsh b/dotfiles/zsh/sourcerer.zsh deleted file mode 100644 index 0826d04..0000000 --- a/dotfiles/zsh/sourcerer.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ tty colors -if [ "$TERM" = "linux" ] -then - echo -en "\e]P0222222" #black - echo -en "\e]P8111111" #darkgrey - echo -en "\e]P1aa4450" #darkred - echo -en "\e]P9ff6a6a" #red - echo -en "\e]P2719611" #darkgreen - echo -en "\e]PAb1d631" #green - echo -en "\e]P3cc8800" #brown - echo -en "\e]PBff9800" #yellow - echo -en "\e]P46688aa" #darkblue - echo -en "\e]PC90b0d1" #blue - echo -en "\e]P58f6f8f" #darkmagenta - echo -en "\e]PD8181a6" #magenta - echo -en "\e]P6528b8b" #darkcyan - echo -en "\e]PE87ceeb" #cyan - echo -en "\e]P7d3d3d3" #lightgrey - echo -en "\e]PFc1cdc1" #white - clear #for background artifacting -fi diff --git a/dotfiles/zsh/syntax.zsh b/dotfiles/zsh/syntax.zsh deleted file mode 100644 index 755d9ff..0000000 --- a/dotfiles/zsh/syntax.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░ color overrides -ZSH_HIGHLIGHT_STYLES[default]='none' -ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red' -ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow' -ZSH_HIGHLIGHT_STYLES[alias]='fg=blue' -ZSH_HIGHLIGHT_STYLES[builtin]='fg=blue' -ZSH_HIGHLIGHT_STYLES[function]='fg=blue' -ZSH_HIGHLIGHT_STYLES[command]='fg=blue' -ZSH_HIGHLIGHT_STYLES[precommand]='none' -ZSH_HIGHLIGHT_STYLES[commandseparator]='none' -ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=blue' -ZSH_HIGHLIGHT_STYLES[path]='none' -ZSH_HIGHLIGHT_STYLES[path_prefix]='none' -ZSH_HIGHLIGHT_STYLES[path_approx]='fg=yellow' -ZSH_HIGHLIGHT_STYLES[globbing]='fg=green' -ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=green' -ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=magenta' -ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=red' -ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='none' -ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=yellow' -ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=yellow' -ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan' -ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan' -ZSH_HIGHLIGHT_STYLES[assign]='none' -- cgit v1.2.1