chezmoi/dot_dotfiles/oh-my-zsh/custom/02_zplugin.zsh
2020-07-15 11:15:51 +02:00

164 lines
5.7 KiB
Bash

### ZINIT
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zinit-zsh/z-a-rust \
zinit-zsh/z-a-as-monitor \
zinit-zsh/z-a-patch-dl \
zinit-zsh/z-a-bin-gem-node
# Because your terminal should be able to perform tasks asynchronously without external tools!
zinit light mafredri/zsh-async
# Introduce 256 colors in terminal
zplugin light chrissicool/zsh-256color
# What the hell does this do?
zinit light mollifier/anyframe
zstyle ":anyframe:selector:" use fzf
# print github style calendar
zinit ice as"program" atclone'perl Makefile.PL PREFIX=$ZPFX' \
atpull'%atclone' make'install' pick"$ZPFX/bin/git-cal"
zinit light k4rthik/git-cal
# simplistic interactive filtering tool
zinit light peco/peco
# use package manager to install fzf (straight from github?)
zinit pack for fzf
# C^x C^x to launch fzf?
zinit light b4b4r07/easy-oneliner
# search in zsh history
zinit light zsh-users/zsh-history-substring-search
# Enhanced CD command
# wait lucid > suppress output on console, messes with p10 setup
zinit wait lucid light-mode for \
b4b4r07/enhancd
# Oh-My-Zsh plugins
zinit snippet OMZ::plugins/git/git.plugin.zsh
# Bookmarks and jump
zinit light jocelynmallon/zshmarks
# Enhanced dir list with git features
zinit light supercrabtree/k
# Jump back to parent directory
zinit light tarrasch/zsh-bd
# Simple zsh calculator
# Usage: $ calc 5+4
# TODO figure out mismatch with zsh-syntax-highlighting (= is invalid alias)
#zinit light arzzen/calc.plugin.zsh
zinit light djui/alias-tips
zinit light hlissner/zsh-autopair
# Additional completion definitions for Zsh.
zinit light zsh-users/zsh-completions
# Suggests commands as you type based on history and completions.
zinit light zsh-users/zsh-autosuggestions
# zsh-syntax-highlighting must be loaded after executing compinit command and sourcing other plugins
zinit load zsh-users/zsh-syntax-highlighting
# search in zsh history
zinit light zsh-users/zsh-history-substring-search
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
bindkey "^[[1;5A" history-substring-search-up
bindkey "^[[1;5B" history-substring-search-down
# oh-my-zsh plugins
zinit snippet OMZ::plugins/archlinux
zinit snippet OMZ::plugins/bundler
zinit snippet OMZ::plugins/command-not-found
zinit snippet OMZ::plugins/common-aliases
zinit snippet OMZ::plugins/copydir
zinit snippet OMZ::plugins/copyfile
zinit snippet OMZ::plugins/cp
zinit snippet OMZ::plugins/cp
zinit snippet OMZ::plugins/dircycle
zinit snippet OMZ::plugins/dnf
zinit snippet OMZ::plugins/docker-compose
zinit snippet OMZ::plugins/encode64
zinit snippet OMZ::plugins/extract
zinit snippet OMZ::plugins/fancy-ctrl-z
zinit snippet OMZ::plugins/gem
zinit snippet OMZ::plugins/git
zinit snippet OMZ::plugins/git/git.plugin.zsh
zinit snippet OMZ::plugins/golang
zinit snippet OMZ::plugins/gpg-agent
zinit snippet OMZ::plugins/history
zinit snippet OMZ::plugins/node
zinit snippet OMZ::plugins/npm
zinit snippet OMZ::plugins/pip
zinit snippet OMZ::plugins/rvm
zinit snippet OMZ::plugins/sudo
zinit snippet OMZ::plugins/svn
zinit snippet OMZ::plugins/systemd
zinit snippet OMZ::plugins/terraform
zinit snippet OMZ::plugins/tmux
zinit snippet OMZ::plugins/tmuxinator
zinit snippet OMZ::plugins/urltools
zinit snippet OMZ::plugins/vagrant
zinit snippet OMZ::plugins/web-search
# Completions
# the internal list (hash) of commands will be updated for each search by issuing the rehash command
zstyle ':completion:*' rehash true
# http://zsh.sourceforge.net/Doc/Release/Completion-System.html
zstyle ':completion:' completer _complete _match _approximate
zstyle ':completion:' group-name ''
#zstyle ':completion:' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:' use-cache true
zstyle ':completion:' verbose yes
zstyle ':completion::default' menu select=2
zstyle ':completion::descriptions' format '%F{yellow}-- %d --%f'
zstyle ':completion:*:options' description 'yes'
# case-insensitive (uppercase from lowercase) completion
#zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# process completion
#zstyle ':completion:*:processes' command 'ps -au$USER'
#zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31"
zstyle ':completion:*' completer _expand _complete _ignored _approximate
#zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' menu select=2
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*:descriptions' format '%U%F{yellow}%d%f%u'
#zstyle ':completion:*:*:git:*' script ~/.git-completion.sh
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*' group-name ''
# case-insensitive (all), partial-word and then substring completion
zstyle ":completion:*" matcher-list \
"m:{a-zA-Z}={A-Za-z}" \
"r:|[._-]=* r:|=*" \
"l:|=* r:|=*"
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*:default' list-colors "${(s.:.)LS_COLORS}"