Skip to content

Commit

Permalink
fix: zinit.zsh logging & update misc. plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
  • Loading branch information
vladdoster committed Jan 14, 2023
1 parent 19a753a commit fd2662f
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions zsh/.config/zsh/zinit.zsh
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#!/usr/bin/env zsh
#
# zdharma/continuum/zinit configuration
# https://github.com/vladdoster/dotfiles
# Open an issue in https://github.com/vladdoster/dotfiles if you find a bug,
# have a feature request, or a question. A zinit-continuum configuration for
# macOS and Linux.
#
#=== HELPER METHODS ===================================
error() { builtin print -P "%F{red}[ERROR]%f: %F{yellow}$1%f" && return 1; }
info() { builtin print -P "%F{white}[INFO]%f: %F{cyan}$1%f"; }
error() { builtin print -P "%F{red}Error%f: $1" && return 1; }
info() { builtin print -P "%F{green}==>%f $1"; }
#=== ZINIT ============================================
typeset -gAH ZI=(HOME_DIR $HOME/.local/share/zinit)
ZI+=(
BIN_DIR "$ZI[HOME_DIR]/zinit.git" COMPLETIONS_DIR "$ZI[HOME_DIR]/completions" OPTIMIZE_OUT_OF_DISK_ACCESSES "1"
PLUGINS_DIR "$ZI[HOME_DIR]/plugins" SNIPPETS_DIR "$ZI[HOME_DIR]/snippets" ZCOMPDUMP_PATH "$ZI[HOME_DIR]/zcompdump"
ZPFX "$ZI[HOME_DIR]/polaris" SRC 'zdharma-continuum' BRANCH 'main'
ZPFX "$ZI[HOME_DIR]/polaris" SRC 'zdharma-continuum' BRANCH 'style/logging'
)

if [[ ! -e $ZI[BIN_DIR]/zinit.zsh ]]; then
{
info 'downloading zinit'
Expand All @@ -36,14 +38,18 @@ else
error 'failed to find zinit installation'
fi
#=== OH-MY-ZSH & PREZTO PLUGINS =======================
zi is-snippet light-mode nocompletions for {PZTM::{environment,history},OMZL::{compfix,completion,git,key-bindings}.zsh}
#=== COMPLETIONS ======================================
zi is-snippet light-mode id-as nocompletions for {PZTM::{environment,history},OMZL::{compfix,completion,git,key-bindings}.zsh}
# zi as'completion' for OMZP::{'golang/_golang','pip/_pip'}
# #=== COMPLETIONS ======================================
local GH_RAW_URL='https://raw.githubusercontent.com'
znippet() { zi for id-as light-mode as'completion' has"${1}" nocompile id-as"${1}-completion/_${1}" is-snippet "${GH_RAW_URL}/${2}/_${1}"; }
znippet 'exa' 'ogham/exa/master/completions/zsh'
# znippet 'fd' 'sharkdp/fd/master/contrib/completion'
znippet 'brew' 'Homebrew/brew/master/completions/zsh'
znippet 'docker' 'docker/cli/master/contrib/completion/zsh'
zi light-mode as'completion' nocompile is-snippet for \
"${GH_RAW_URL}/git/git/master/contrib/completion/git-completion.zsh"
# "${GH_RAW_URL}/Homebrew/homebrew-services/master/completions/zsh/_brew_services"
#=== PROMPT ===========================================
eval "MODE_CURSOR_"{'SEARCH="#ff00ff blinking underline"','VICMD="green block"','VIINS="#ffff00 bar"'}";"
zi for id-as as'null' compile'(pure|async).zsh' multisrc'(pure|async).zsh' light-mode atinit"
Expand All @@ -56,11 +62,11 @@ zi for id-as as'null' compile'(pure|async).zsh' multisrc'(pure|async).zsh' light
zstyle ':prompt:pure:prompt:success' color 'green'" \
@sindresorhus/pure
#=== ANNEXES ==========================================
zi for "${ZI[SRC]}"/zinit-annex-{bin-gem-node,binary-symlink,linkman,patch-dl,readurl,submods}
zi light-mode ver'style/logging' for @${ZI[SRC]}/zinit-annex-{linkman,binary-symlink,patch-dl}
zi light-mode for @${ZI[SRC]}/zinit-annex-submods
#=== GITHUB BINARIES ==================================
zi from'gh-r' lman lbin'!' nocompile for @{dandavison/delta,r-darwish/topgrade}

zi as'completions' from'gh-r' lbin'!' lman light-mode null for \
zi lman from'gh-r' id-as lbin'!' nocompile for @{dandavison/delta,r-darwish/topgrade}
zi lman as'completions' from'gh-r' id-as lbin'!' light-mode null for \
dl="$(print -c https://raw.githubusercontent.com/junegunn/fzf/master/{shell/{'key-bindings.zsh;','completion.zsh -> _fzf;'},man/{'man1/fzf.1 -> $ZPFX/share/man/man1/fzf.1;','man1/fzf-tmux.1 -> $ZPFX/share/man/man1/fzf-tmux.1;'}})" \
src'key-bindings.zsh' \
@junegunn/fzf \
Expand All @@ -71,15 +77,16 @@ zi as'completions' from'gh-r' lbin'!' lman light-mode null for \
@ogham/exa
# alias l='exa -blF'; alias la='exa -abghilmu'; alias ll='exa -al'; alias ls='exa --git --group-directories-first'
#=== UNIT TESTING =====================================
# lbin'!zsd*' make"install" \
# @zdharma-continuum/zshelldoc \
zi light-mode lucid wait'!' nocompile for \
as'command' atclone'./build.zsh' pick'zunit' \
as'command' atclone'./build.zsh' ver'main' pick'zunit' \
@zdharma-continuum/zunit \
make"--silent PREFIX=${ZI[ZPFX]} install" \
@zdharma-continuum/zshelldoc \
id-as null lbin'!bin/tig' configure make'install' \
@jonas/tig \
nocompletions nocompile atinit'bindkey -M vicmd "^v" edit-command-line' \
@softmoth/zsh-vim-mode
#=== MISC. ============================================
# ZSH_AUTOSUGGEST_MANUAL_REBIND=1
zi lucid wait light-mode for \
svn submods'zsh-users/zsh-history-substring-search -> external' OMZP::history-substring-search \
atpull'zinit creinstall -q .' blockf zsh-users/zsh-completions \
Expand Down

0 comments on commit fd2662f

Please sign in to comment.