dorkhub

zpwr

ZPWR => World's Most Advanced UNIX Terminal Environment

MenkeTechnologies
Shell22515 forksMITupdated 6 days ago
git clone https://github.com/MenkeTechnologies/zpwr.gitMenkeTechnologies/zpwr
 _______ _______ _  _  _ ______
|____   |_____  | |  \| |_____/
    /  / |_____] |_|\_| |    \_  v48.9.4
>>> JACK INTO THE GRID <<<

CI GitHub tag Commits since v1.0 Contributors Docs License: MIT

[NEON-LIT UNIX TERMINAL OS // 504 VERBS // 190k LOC // STRYKE-POWERED]

"The street finds its own uses for things." — William Gibson

tmux final

ZPWR is a high-voltage terminal environment built on zinit, weaponized with layers of custom zshrs, vimlrs and stryke (the official language of ZPWR) code. It rewires your shell into a neural interface — autocomplete that anticipates your next move, keybindings that feel like muscle memory from a past life, and a ztmux cockpit that turns your terminal into a multi-pane command center. Began as a fork of Hashrocket's Dotmatrix; evolved into a sprawling cyberdeck OS for the command line. Will be migrating to zshrs — a next-gen, highly parallel login shell designed as a drop-in replacement for zsh. If your terminal isn't glowing, you're not running ZPWR.

Read the Docs · Engineering Report · strykelang · zshrs · zsh-more-completions


Category Of One -- The Dotfile Super-OS

[ NO DIRECT COMPETITORS // A NEW CLASS OF MACHINE ]

ZPWR invented the terminal-OS concept -- the idea that a shell environment can be a coherent operating system for the command line, not a loose pile of dotfiles. It has no direct competitor because it is not in any existing category; it originated and defines a new one: the dotfile super-OS. Every adjacent tool covers exactly one of ZPWR's axes; none integrate all of them in a single installable system:

  • Verb-dispatcher mega-CLI -- zpwr <verb> exposing a discoverable, menucompleted command vocabulary spanning the whole environment.
  • Full-stack curated cockpit -- zsh + ztmux + fzf + zmax wired together as one coherent machine, not a pile of configs.
  • Scale -- thousands of aliases, tens of thousands of completions, thousands of functions, and a custom env-var control plane, all in one repo.
  • Single-author, single-install OS -- one curl jacks the entire stack in.

The landscape splits cleanly along these axes, and each rival owns only one:

Class Examples What it covers Why it isn't ZPWR
Zsh/Bash config frameworks oh-my-zsh, Prezto, Zim, bash-it plugin loading + themes no verb dispatcher, no command suite
Plugin managers zinit, antigen, zplug, znap loading infrastructure ZPWR is built on zinit -- they are a component, not a competitor
Personal dotfiles repos mathiasbynens, holman, thoughtbot, voidrice one person's curated config config snapshots; no dispatched CLI, far smaller scale
CLI builder frameworks Cobra, oclif, Click a way to build one tool wrong layer -- they build CLIs, they aren't an environment
Dotfile managers chezmoi, dotbot, GNU stow, yadm sync / templating orthogonal plumbing, not a shipped environment

Closest by spirit -- the famous personal dotfiles repos -- top out at curated configs with a bin/ of scripts. None expose a namespaced <tool> <verb> dispatcher of this breadth, and none ship the full multi-tool cockpit at this scale. ZPWR is the only thing that is simultaneously a verb-CLI, a full-stack terminal environment, and a single-author OS. Category of one.

The nearest ancestor is Hashrocket's Dotmatrix -- ZPWR's original fork point, and a similar concept in seed form. Dotmatrix is dotfiles for provisioning a dev machine: shell/git/vim/ztmux configs plus hr, a subcommand utility for developer tasks. ZPWR took that seed to terminal-OS breadth -- a verb-dispatcher spanning the entire environment (not just dev chores), a fully wired zsh + ztmux + zmax + fzf + spacemacs cockpit, an env-var control plane, and completions at corpus scale. The novelty is not "a shell with a helper command" -- that predecessor existed and is credited here -- it is configuring every aspect of the terminal as one coherent OS. That is what ZPWR originated.


System Map

Full Installation -- Jack Into ~/.zpwr

sh -c "$(curl -fsSL raw.githubusercontent.com/MenkeTechnologies/zpwr/main/install/s)"

OR

git clone --depth 1 -- https://github.com/MenkeTechnologies/zpwr.git ~/.zpwr && cd ~/.zpwr/install && ./zpwrInstall.sh

The installer will confirm what will be installed and overwritten before executing.

Zinit will install plugins on first zsh after install.

Full Installation to Custom $ZPWR -- Choose Your Safehouse

To install to a custom directory, clone the project to custom directory and start the installer. ZPWR will pick up its location and export ZPWR to that directory. This also means you can move ZPWR after install after updating the sym links that are in $HOME. First export ZPWR_INSTALL=<mydirectory>/install in current shell. Replace <mydirectory> with your new install dir and keep /install in the export. Then run zpwr regenconfiglinks in same shell to create new sym links pointing to your new directory <mydirectory>. Then exec a new zsh with exec zsh and all environment variables will be set accordingly.

Installation Options to ~/.zpwr/install/zpwrInstall.sh

    Options:
        -a  Install all dependencies
        -c  Copy just configs
        -n  Do not start ztmux at end of installer
        -s  Skip main section
        -h  Display this message
        -V  Display script version

ZPWR Augmentations

[ SYSTEM SPECS // ACTIVE MODULES ]

  • 504 zpwr subcommands -- your neural command vocabulary with colorized zsh menucompletion zpwr <tab>
  • 177 centralized environment variables in the ZPWR namespace -- dials and switches for every subsystem
  • 890+ centralized ZPWR files in ~/.zpwr -- clean uninstall, no ghost processes
  • 48k zsh tab completions including zsh-more-completions -- predictive input at machine speed
  • 183 bash, stryke, zshrs and pythonrs scripts in ~/.zpwr/scripts or $ZPWR_SCRIPTS git tracked
  • 2000+ aliases -- shorthand for the initiated
  • 360+ git aliases from OMZ git plugin and zsh-git-acp
  • user specific ZPWR files in ~/.zpwr/local git ignored -- your private data vault
  • installer specific ZPWR files in ~/.zpwr/install git tracked
  • ZPWR installer output in ~/.zpwr/local/installer git ignored
  • central kill switch for zpwr colorful output with ZPWR_COLORS
  • zshrs completion with descriptions for parameters, regular, suffix and global aliases
  • spelling correction, abbreviation expansion and automatic capitalization on the command line zsh-expand -- the shell corrects you before you finish typing
  • snippets with tabstops that expand with spacebar and advance to next stop with C-o zsh-expand
  • expanding regular aliases and global aliases from zsh menu selection and in vim insert mode zsh-expand
  • optional preexec expansion of regular aliases and global aliases or only history expansion of aliases
  • neon-coded groups of zsh menu completion for commands, aliases, reswords, functions, builtins, parameters, files, command history, correction
  • neon-coded groups of zsh menu completion for man pages
  • neon-coded groups of zsh menu completion for git subcommands
  • neon-coded groups of zsh menu completion for git objects
  • heavily colorized man pages zsh-very-colorful-manuals -- manpages that glow
  • insert matching quotes, brackets and parentheses like most IDEs zsh-autopair
  • custom keybinding to open files most recently edited based on viminfo and emacs recentf and placed into fzf for fuzzy searching zpwr vimrecent -- time travel through your edit history
  • vim keybindings (insert, normal and visual modes) to run current code file open in vim in ztmux pane to right -- write and execute in one fluid motion
  • vim keybindings (insert, normal and visual modes) to run current vim selection in ztmux pane to right as standalone script
  • vim keybindings (insert, normal and visual modes) to run current vim selection in ztmux pane to right in REPL
  • fzf preview pane show contents of JAR, WAR, deb, rpm, zip, tgz and gzip files controlled by central FZF.*OPTS env vars -- x-ray vision for archives
  • ergonomic, repeating ztmux keybindings for next and previous windows
  • zsh keybindings to fzf search file names and syntax highlighted, numbered file preview from bat or pygmentize zpwr vimfilesearch
  • zsh keybindings to fzf search file contents and syntax highlighted, numbered file preview from bat or pygmentize zpwr vimwordsearch
  • zsh keybindings to fzf search of network processes with lsof return PIDs zpwr lsof -- scan the local net like a deck jockey
  • zsh function to cache all git directories zpwr regengitrepocache
  • zsh function for fzf searching of all git directories zpwr gitrepos
  • zsh function for fzf searching of all dirty git directories zpwr gitreposdirty -- find every repo with uncommitted cargo
  • zsh function to exec cmd in all git directories zpwr gitreposexec -- broadcast commands across all repos simultaneously
  • integration of z frecency database into _files completion
  • integration of fasd frecency database into _files completion
  • zsh menucompletion for z command based on frecency z and fasd databases
  • keybindings to save to mysql learning table zsh-learn
  • functions zpwr searchl to search from mysql learning table zsh-learn
  • zpwr redo <number/regex...> prints to prompt SQL update statements for learning items zsh-learn
  • zpwr redosql <number/regex...> prints to vim SQL update statements for learning items that run once vim is quit zsh-learn
  • zle keybinding formats newlines and spaces before saving to mysql learning database zsh-learn
  • zsh plugins loading based on OS
  • zsh functions autoloading based on OS
  • ztmux keybindings and scripts based on OS
  • custom ZPWR banner with latest commit and tag when zpwr update, zpwr banner or zpwr about and $ZPWR_INSTALL/zpwrInstall.sh run
  • custom banners when new shell is launched ZPWR_BANNER_COMMAND
  • zle sed sub widget to replace globally on current command line zsh-sed-sub
  • expanded vim text objects on command line
  • vim extract method from visual selection for shell, stryke and pythonrs scripts (gv to select extracted)
  • vim extract variable under cursor for shell, stryke and pythonrs scripts (gv to select extracted)
  • vim extract variable from visual selection for shell, stryke and pythonrs scripts (gv to select extracted)
  • vim autohighlight word under cursor after delay like JetBrains IDEs
  • software updater script, source ~/.zpwr/scripts/autoUpdater.sh, on 24 hour loop
  • colorized side diffs on zsh keybinding before git push zsh-git-acp
  • zsh keybindings to git add, commit and push with commit message from current command line zsh-git-acp
  • git commit blacklisted directories zsh-git-acp
  • zle quote swapper widget
  • zsh, ztmux and vim keybindings to copy/paste to system clipboard
  • shell function to pull down latest code changes from this repo with zpwr update
  • shell function that is wrapper around bat that works with text, jars, tgz, rpm, deb and zips with zpwr cat or c
  • shell function uses same shell code to generate output that default FZF preview pane does with zpwr cat or c
  • shell function automatically runs sudo when file is not readable with zpwr cat or c
  • shell function that cds to any of parent directories with zsh completion with zpwr cdup or r
  • zpwrClearList function that run clear and ls and show stats for commands, files, aliases, functions etc
  • color-coded, grouped zpwrClearList zsh completion
  • search google from ztmux mouse drag selection (ztmux's copy-mode-vi) -- highlight text, query the net
  • open URLs and files from ztmux mouse drag selection (ztmux's copy-mode-vi) -- drag to launch
  • zpwr subcommands count with zpwr verbscount
  • zpwr subcommands into fzf then execed with zpwr verbs
  • zpwr subcommands into fzf with zpwr verbsedit then onto command line
  • zpwr environment counts with zpwr envcounts
  • centralized FZF preview pane customization with environment variables
  • environment variables in ZPWR namespace in vim YCM completion from ctags generated ~/tags
  • systemd functions for starting/enabling, stopping/disabling service with zsh completion
  • systemd service, poll.service, that polls github and download latest zpwr code
  • systemd service, learn.service, that runs learning collection API
  • restart function that launches poll.service and learn by enabling and starting in systemd
  • 3k+ line README -- you are here, deep in the docs
  • 190k+ LOC -- hand-forged in the neon glow of late-night terminals

ZPWR Firmware Stack

  • zshrs
  • ztmux
  • zvcs
  • zmax
  • stryke
  • zterminal
  • iftoprs
  • temprs
  • lsofrs
  • storageshower
  • htoprs
  • eza
  • arb
  • bat
  • fd-find
  • thumbs
  • ripgrep
  • grcrs
  • cargo-update
  • rust/cargo
  • rustup
  • powerliners for ztmux
  • fzf
  • bash (4.0+, 3.2 not supported)
  • zinit with 48 plugins of which 33 are custom
  • powerlevel10k zsh prompt with ~dirs via cached hash dirs and prompt_dir override
  • youcompleteme
  • ultisnips
  • supertab
  • pathogen
  • vundle
  • go
  • bottom
  • lolcat
  • python3
  • mycli
  • pgcli
  • ponysay

Compatible Chassis:

  • macOS
  • raspbian
  • debian
  • mx linux
  • garuda
  • popos!
  • freebsd
  • kali
  • fedora
  • oraclelinux
  • centos
  • debian
  • alpine
  • arch
  • artix
  • manjaro
  • arcolinux
  • endeavouros
  • mint
  • zorin
  • parrot OS
  • WSL ubuntu/kali/suse/leap/fedora
  • SUSE
  • AMI

ZPWR Black Market Extras (Not Installed)

  • JetBrains .ideamvimrc
  • JetBrains plugin list
  • JetBrains settings zip
  • JetBrains JVM Options idea.vmoptions
  • Spacemacs Config with 490+ packages in .spacemacs
  • Emacs Yasnippets
  • Alacritty Main Config
  • Alacritty Color Theme
  • macOS Terminal Color Theme
  • gtags from zpwr and .globalrc
  • .gitconfig and .gitignore_global

Minimal Implant

git clone --depth 1 -- https://github.com/MenkeTechnologies/zpwr.git ~/.zpwr && cd ~/.zpwr/install && ./zpwrInstall.sh -c

This will install just config files not dependencies.

You can then run each install shell script in ~/.zpwr/install manually to install just vim plugins or cargo packages etc.

Install Destination

All zpwr configs are wired into ~/.zpwr by default -- the ZPWR environment variable. ~/.zshrc, ~/.vimrc, ~/.tmux.conf and other config files are sym linked into home dir to be read by the respective program. Your old configs are archived in approximately ~/.zpwr/local/username.rc.bak.date after install. Exact directory name is generated as shown.

backupdir="$ZPWR_HIDDEN_DIR/$USER.rc.bak.$(date +'%m.%d.%Y')"

Installer artifacts such as log files and cloned repos go into ~/.zpwr/local/installer.

Unplug

Run zpwr uninstall. This will ask for confirmation before moving backups dirs to $HOME, unlinking all configs from $HOME and deleting all config dirs.

OR

  1. Run zpwr rmconfiglinks (zpwrUnlinkConf) to unlink all zpwr config symlinks.
  2. Copy all configs from backup dir mentioned above to home directory most importantly the .zshrc, .vimrc and .tmux.conf.
  3. Remove the zpwr dir as shown.
rm -rf ~/.zpwr

This will not uninstall packages installed by system package manager, pip modules, gems, vim plugins, ztmux plugins and zsh plugins. You must remove these manually if desired. If desired you can also uninstall zinit with rm -rf ~/.zinit. Make sure ~/.zshrc and other config files in $HOME are original versions.

Glyph Firmware (Font)

You need to change the Terminal font to display the Powerline triangles and other special characters in the Powerlevel10k $PROMPT.

The installer installs Hack Nerd Font on the Mac with Homebrew and Powerline Symbols on Linux. Without the right font, the glyphs render as static -- consult your terminal emulator documentation.

Patching In

zpwr updateall (zua) relinks all config files, pulls latest ZPWR code, updates zsh plugins, regens all caches and updates all dependencies -- a full system refresh.

zpwr update and zpwrLinkConf functions

zpwr update pulls the latest changes from this repository into ~/.zpwr, relinks all config files and updates all zsh plugins. It invokes zpwr regenconfiglinks (zpwrLinkConf) which sym links ~/.zshrc, ~/.vimrc and ~/.tmux.conf and other config files into $HOME.

Ztmux Prefix -- The Activation Key

The default ztmux prefix key is C-a (control-a) on macOS so one can control inner ztmux sessions (nested sessions into remote machines) on Linux/UNIX (prefix is C-b) separately. To invoke C-a in the shell press C-a twice or to invoke C-b press C-b twice. The left most segment of the ztmux powerline status bar lights up when the prefix is active and goes dark when deactivated. You change the prefixes in ~/.zpwr/local/.tokens.sh with these environment variables.

# the ztmux prefix on mac
export ZPWR_TMUX_PREFIX_MAC='C-a'
# the ztmux prefix on linux
export ZPWR_TMUX_PREFIX_LINUX='C-b'

Autosaving Vim Plugins -- Persistent Memory

The vim-autosave plugin autosaves all edits, making :w unnecessary -- your work is never lost. :u 0 in vim command(colon) mode will reset all changes in buffer which will then be autosaved.

Auto List Completions

zpwr startauto [delay] will start automatically listing completion choices. zpwr stopauto will disable this. ZPWR_AUTO_COMPLETE will turn this on permanently with ZPWR_AUTO_COMPLETE_DELAY as delay time.

# list completion choices automatically
export ZPWR_AUTO_COMPLETE=false
# delay before listing completion choices automatically
export ZPWR_AUTO_COMPLETE_DELAY=3.0

Bypassing expansion on space

C-Space (Control-Space or actually the ^@ terminal escape code) will bypass all expansion of globbing, aliases and words. Expansion can be disabled entirely by adding zinit unload MenkeTechnologies/zsh-expand &>/dev/null to ~/.zpwr/local/.tokens-post.sh or removing zsh-expand from ZPWR_GH_PLUGINS array in ~/.zpwr/local/.tokens.sh.

~/.zpwr/local/.tokens-post.sh

zinit unload MenkeTechnologies/zsh-expand &>/dev/null

OR

~/.zpwr/local/.tokens.sh

ZPWR_GH_PLUGINS[$ZPWR_GH_PLUGINS[(i)MenkeTechnologies/zsh-expand]]=()

Alternatively, change these env vars to false in ~/.zpwr/local/.tokens.sh. The first turn off expansion in any position. The second variable turns off expansion in second position. For example with sudo/zpwr/env in the first position and the alias to expand in the second position on the command line. The third turn offs glob/history/param etc expansion in any position. The fourth turns off spelling correction in any position.

~/.zpwr/local/.tokens.sh

# disable all expansion
export ZPWR_EXPAND=false
# aliases expand in second position after sudo
export ZPWR_EXPAND_SECOND_POSITION=false
# expand globs, history etc with zle expand-word
export ZPWR_EXPAND_NATIVE=false
# spelling correction in zsh-expand plugin
export ZPWR_CORRECT=false
# expand inside "
export ZPWR_EXPAND_QUOTE_DOUBLE=true
# expand inside '
export ZPWR_EXPAND_QUOTE_SINGLE=false

Turning off ponies (default is off) and colors globally -- Kill The Neon

To turn off all ponysay ponies, colored groups and colored group descriptions, add to tokens file. Sometimes you need to go dark.

~/.zpwr/local/.tokens.sh

# ponysay banner when shell startup finishes
export ZPWR_BANNER_TYPE=noponies
# output is more colorful
export ZPWR_COLORS=false
# colored section headers
export ZPWR_COLORS_SECTIONS=false

Supported Runtimes -- Running script from vim in ztmux right pane

~/.vimrc

    let supportedTypes=['sh','zsh', 'cr','py','rb','pl', 'clj', 'tcl', 'vim', 'lisp', 'hs', 'ml', 'coffee', 'swift', 'lua', 'java', 'f90']

File ending of currently edited file in vim determines the interpreter used by the bash script $ZPWR_SCRIPTS/runner.sh which defaults to ~/.zpwr/scripts/runner.sh

Ztmux Main Window -- The Cockpit

The main window shown in the screenshots is started by prefix-D in an empty ztmux window. This sources ~/.zpwr/tmux/control-window.conf. Alternatively invoke by prefix-: source-file ~/.zpwr/tmux/control-window.conf or from the terminal with tmux source-file ~/.zpwr/tmux/control-window.conf in an empty ztmux pane.

Personal Config -- Your Identity File

Startup shell files will source ~/.zpwr/local/.tokens.sh before zsh config and zinit startup -- put your custom code and overrides here. This file survives zpwr update. You can override installer variables in this file before install. Because this file is sourced by bash installer and zsh startup you should check if the shell is zsh before any zsh only features like zpwrIsZsh && myZshConfig. ~/.zpwr/local/.tokens-post.sh is sourced after all zsh config and zinit startup -- the final layer of customization.

To use a different .vimrc and/or tmux.conf, set these environment variables to absolute path of custom configs and then zpwr regenconfiglinks.

~/.zpwr/local/.tokens.sh

# user tmux.conf file
export ZPWR_TMUXRC="$HOME/.tmux.conf"
# user vimrc file
export ZPWR_VIMRC="$HOME/.vimrc"

Running zpwr regen will regenerate all cache files in ~/.zpwr/local and create a ctags file named ~/tags in your home directory. YCM (vim code completion engine) will source this file (autocmd filetype * set tags+=~/tags includes ~/tags), while providing completion so ZPWR env vars vim code completion in ~/.zpwr/local/.tokens.sh should work. Inside vim <Space>] will jump to definition of the tag in the preview window.

zpwr verbs

Typing zpwr <tab> will invoked zsh menucompletion for zpwr verbs/subcommands. These subcommands invoke other shell functions passing all args. zpwr verbs will list them all in fzf and then execute selected verbs (fzf multiselection is enabled). zpwr verbsedit puts selected verbs onto command line for editing.

Man Page -- man zpwr and man zpwrall

ZPWR ships two UNIX man pages at ~/.zpwr/man/man1/. Add the directory to your MANPATH to view them with the system man:

export MANPATH="$ZPWR/man:$MANPATH"
man zpwr        # quick reference
man zpwrall     # comprehensive meta-page

zpwr(1) is the quick reference: dispatcher overview, -h/-V flags, a curated verb catalog (diagnostics, profiling, history analytics, snapshot/restore, cache management, navigation, eye-candy, ztmux), key environment variables, files, and runnable examples.

zpwrall(1) is the comprehensive meta-page -- the equivalent of zshall(1) for ZPWR. It contains:

  • the full alphabetic catalog of all 460 dispatcher verbs with their underlying commands,
  • every documented ZPWR_* environment variable grouped by purpose (banner, auto-behaviors, colors, expansion, logging, editor, ztmux, plugins, paths),
  • the canonical install layout and per-directory purpose,
  • ztmux prefix, key bindings, and synced-pane semantics,
  • zsh keymap layout and the keybinding search verbs,
  • caching and compilation surfaces (.zwc, ctags, gtags, env cache, git repo cache),
  • log levels and destinations,
  • plugin/zinit interaction,
  • startup-profile and health-check surfaces.

For the live colorized verb list use zpwr help; for the interactive encyclopedia use zpwr docs.

ZPWR_GITHUB_ACCOUNT variable

Change in ~/.zpwr/local/.tokens.sh

export ZPWR_GITHUB_ACCOUNT='MenkeTechnologies'

to match your GitHub account name to enable various functionality with your account like zpwr github, zpwr githubcreate and zpwr githubdelete shell functions for opening your GitHub home page, creating and deleting GitHub repos from the command line respectively.

Adding more Zinit plugins

Add in ~/.zpwr/local/.tokens-post.sh your extra plugins like such

zinit ice lucid nocompile wait'0a'
zinit load \
hlissner/zsh-autopair

Environment Variables -- System Tuning Parameters

These are the environment variables in ~/.zpwr/env/.zpwr_env.sh and ~/.zpwr/env/.zpwr_re_env.sh -- the dials and switches of the ZPWR cyberdeck. Override them in ~/.zpwr/local/.tokens.sh to tune the system to your neural patterns. ~/.zpwr/env/.zpwr_re_env.sh is reread after user tokens file to update dependent variables.

# Global Environment Variables for ZPWR by MenkeTechnologies
# More Environment Variables in ~/.zpwr/env/.shell_aliases_functions.sh near top of file
# override in ~/.zpwr/local/.tokens.sh, ~/.zpwr/local is git ignored
# see README.md
# linux OS SSH auto attach to ztmux sessions
export ZPWR_AUTO_ATTACH=true
# list completion choices automatically
export ZPWR_AUTO_COMPLETE=false
# delay before listing completion choices automatically
export ZPWR_AUTO_COMPLETE_DELAY=3.0
# run ls after rm and other modifying commands such as touch automatically
export ZPWR_AUTO_LS_RM=true
# run ls after cd automatically
export ZPWR_AUTO_LS_CD=true
# auto select first item of menuselect
export ZPWR_AUTO_SELECT=true
# clear and ls before and after banner
export ZPWR_BANNER_CLEARLIST=true
# cd to Desktop after banner Darwin
export ZPWR_BANNER_DESKTOP_DARWIN=false
# cd to Desktop after banner Linux
export ZPWR_BANNER_DESKTOP_LINUX=true
# ponysay banner when shell startup finishes
export ZPWR_BANNER_TYPE=ponies
# bat (syntax highlighting) theme
export ZPWR_BAT_THEME='GitHub'
# this the description separator in compsys option completions (ls -<tab>)
# and the separator for function se() between row number and learning
export ZPWR_CHAR_LOGO='<<)(>>'
# group description leading chars
export ZPWR_DESC_PRE='-<<'
# group description trailing chars
export ZPWR_DESC_POST='>>-'
# group description text color ANSI codes
export ZPWR_DESC_TEXT_COLOR='34'
# group description leading chars color ANSI codes
export ZPWR_DESC_PRE_COLOR='1;31'
# group description trailing chars color ANSI codes
export ZPWR_DESC_POST_COLOR='1;31'
# output is more colorful
export ZPWR_COLORS=true
# colored section headers
export ZPWR_COLORS_SECTIONS=true
# zpwr <tab> is more colorful
export ZPWR_COLORS_VERBS=true
# common colors ANSI codes
export ZPWR_COLOR_BLUE="\x1b[37;44m"
export ZPWR_COLOR_RED="\x1b[31m"
export ZPWR_COLOR_RESET="\x1b[0m"
# ANSI styling codes for git commits
export ZPWR_COMMIT_STYLE='1;37;45'
# named compsys colors zsh pattern and ANSI codes
export ZPWR_NAMED_COLORS='=(#b)(*)=1;37;46'
# file prefix compsys colors
export ZPWR_COMMON_ZSTYLE_OPTS='reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)(*)==37;45=37;43=34}:${(s.:.)LS_COLORS}")'
# sudo prefix to add when you get permission denied
export ZPWR_SUDO_CMD='sudo -E'
# sudo for aliases and expansion
export ZPWR_FULL_SUDO='"builtin" "command" "sudo" -E "env" PATH="$PATH"'
# the repo name for more zsh compsys completions
export ZPWR_COMPLETION_DIR='zsh-more-completions'
# spelling correction in zsh-expand plugin
export ZPWR_CORRECT=true
# aliases expand after spelling correction
export ZPWR_CORRECT_EXPAND=true
# turns on debugging logs using zpwrLogDebug function
export ZPWR_DEBUG=false
# default OMZ theme if Powerlevel 10k not used
export ZPWR_DEFAULT_OMZ_THEME=simonoff
# for alternating pretty printer
export ZPWR_DELIMITER_CHAR='%'
# the default vim command, override in tokens file
export ZPWR_VIM='nvim'
# set EDITOR to $ZPWR_VIM command
export ZPWR_EDITOR_TO_VIM='true'
# the emacs command
export ZPWR_EMACS='command emacs -nw'
# the emacs client command
export ZPWR_EMACS_CLIENT='emacsclient -c -nw -a ""'
# eza command invoked from zpwrClearList shows extended attributes
export ZPWR_EXA_EXTENDED=true
# enable all expansion
export ZPWR_EXPAND=true
# aliases expand in second position after sudo
export ZPWR_EXPAND_SECOND_POSITION=true
# expand globs, history etc with zle expand-word
export ZPWR_EXPAND_NATIVE=true
# aliases expand before command line is accepted
export ZPWR_EXPAND_PRE_EXEC=true
# globs etc expand before command line is accepted
export ZPWR_EXPAND_PRE_EXEC_NATIVE=false
# second pos expand before command line is accepted
export ZPWR_EXPAND_PRE_EXEC_SECOND_POSITION=true
# expand inside "
export ZPWR_EXPAND_QUOTE_DOUBLE=true
# expand inside '
export ZPWR_EXPAND_QUOTE_SINGLE=false
# command for fd
export ZPWR_FD='command fd --follow --type file --threads 8'
# command for all fzf
export ZPWR_FZF='fzf --ansi'
# prompt for all fzf
export ZPWR_FZF_LOGO='<<)ZPWR(>>'
# GH username
export ZPWR_GITHUB_ACCOUNT='MenkeTechnologies'
# the char that prefixes global aliases like je<space>
export ZPWR_GLOBAL_ALIAS_PREFIX=j
# whether to search interactively in menuselect
export ZPWR_INTERACTIVE_MENU_SELECT=true
# timeout for keybindings
export ZPWR_KEYTIMEOUT=10
# whether to include all the zpwr learning functions
export ZPWR_LEARN=true
# zpwrLogColor function underscore color ANSI codes
export ZPWR_LOG_UNDER_COLOR='\x1b[0;34m'
# zpwrLogColor function quote color
export ZPWR_LOG_QUOTE_COLOR='\x1b[0;35m'
# zpwrLogColor function timestamp color
export ZPWR_LOG_DATE_COLOR='\x1b[0;32;44m'
# zpwrLogColor function message color
export ZPWR_LOG_MSG_COLOR='\x1b[0;37;45m'
# when true vim normal mode C-V mapped to exec current file in right ztmux pane
export ZPWR_MAP_C_V_VIM_NORMAL=false
# the marker found color in bat output into fzf from ag search ANSI codes
export ZPWR_MARKER_COLOR='0;1;4;37;44m'
# default value for pygmentize theme
export ZPWR_PYGMENTIZE_COLOR="emacs"
# zpwr colorizer = bat or pygmentize
export ZPWR_COLORIZER=bat
# zsh options set in precmd fn before prompt
export ZPWR_OPTS=
# the OS of the host
export ZPWR_OS_TYPE="$(uname -s | tr A-Z a-z)"
# plugin framework
export ZPWR_PLUGIN_MANAGER=zinit
# uses the zprof function to profile startup
export ZPWR_PROFILING=false
# set to POWERLEVEL to use the powerlevel10k prompt
export ZPWR_PROMPT=powerlevel10k
# pssh timeout
export ZPWR_PSSH_TIMEOUT=0
# git colored output cmd prefix
export ZPWR_GIT_COLOR_PREFIX="git -c color.status=always -c color.ui=always --no-pager"
# char to separate log messages
export ZPWR_QUOTE_START_CHAR='<<('
# char to separate log messages
export ZPWR_QUOTE_END_CHAR=')>>'
# maybe z4ze
export ZPWR_REPO_NAME='zpwr'
# when true sends every char to synced panes
# when false does not send enter and Control to synced panes
export ZPWR_SEND_KEYS_FULL=false
# how long to sleep after display of counts in zpwr display of all
export ZPWR_LOOK_TIME=5
# set to comma separated list of pane numbers
# to activate sending to numbered ztmux panes
export ZPWR_SEND_KEYS_PANE=-1
# typing leading quote, paren, bracket inserts trailing after caret
export ZPWR_SURROUND=true
# the string that marks a tabstop when expanding aliases
export ZPWR_TABSTOP=__________
# include tabstop aliases
export ZPWR_TABSTOP_ALIASES=true
# the ztmux prefix on mac
export ZPWR_TMUX_PREFIX_MAC='C-a'
# the ztmux prefix on linux
export ZPWR_TMUX_PREFIX_LINUX='C-b'
# the ztmux copy mode history limit
export ZPWR_TMUX_HISTORY_LIMIT=30000
# turns on set -x in critical regions
export ZPWR_TRACE=false
# add header template to certain filetypes in vim
export ZPWR_VIM_TEMPLATES=true
# use bindkey -v
export ZPWR_BINDKEY_VI=true
# delay between shell start and compinit
export ZPWR_ZINIT_COMPINIT_DELAY=0
# username for zdharma
export ZPWR_ZDHARMA="zdharma-continuum"
# regex for ztmux thumbs
export ZPWR_THUMBS_REGEX='^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
((?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]{2,})(?::.*)?'
# store tty for prompt, set from zsh $TTY after p10k finalize
export ZPWR_TTY=$TTY
if [[ $ZPWR_PLUGIN_MANAGER == zinit ]]; then
    zpwrEvalIfNeeded ZPWR_PLUGIN_MANAGER_HOME "$ZPWR_PLUGIN_MANAGER_HOME" "$HOME/.zinit" "$HOME"
    export ZSH="$ZPWR_PLUGIN_MANAGER_HOME"
    zpwrEvalIfNeeded ZSH_CUSTOM "$ZSH_CUSTOM" "$ZSH" "$ZSH"
elif [[ $ZPWR_PLUGIN_MANAGER == oh-my-zsh ]]; then
    zpwrEvalIfNeeded ZPWR_PLUGIN_MANAGER_HOME "$ZPWR_PLUGIN_MANAGER_HOME" "$HOME/.oh-my-zsh" "$HOME"
    export ZSH="$ZPWR_PLUGIN_MANAGER_HOME"
    zpwrEvalIfNeeded ZSH_CUSTOM "$ZSH_CUSTOM" "$ZSH/custom" "$ZSH"
fi

# fzf dir
zpwrEvalIfNeeded ZPWR_FZF_DIR "$ZPWR_FZF_DIR" "$ZSH_CUSTOM/plugins/fzf" "$ZSH"
# local file ignored by git
zpwrEvalIfNeeded ZPWR_LOCAL "$ZPWR_LOCAL" "$ZPWR/local" "$ZPWR"
# plugin misc cache files
zpwrEvalIfNeeded ZSH_CACHE_DIR "$ZSH_CACHE_DIR" "$ZPWR_LOCAL/.cache" "$ZPWR_LOCAL"
# alias and function file bash compatible
zpwrEvalIfNeeded ZPWR_ALIAS_FILE "$ZPWR_ALIAS_FILE" "$ZPWR_ENV/.shell_aliases_functions.sh" "$ZPWR_ENV"
# autoloaded non completion functions
zpwrEvalIfNeeded ZPWR_AUTOLOAD "$ZPWR_AUTOLOAD" "$ZPWR/autoload" "$ZPWR"
# autoloaded common non completion functions
zpwrEvalIfNeeded ZPWR_AUTOLOAD_COMMON "$ZPWR_AUTOLOAD_COMMON" "$ZPWR_AUTOLOAD/common" "$ZPWR_AUTOLOAD"
# autoloaded common completion but completion helper functions
zpwrEvalIfNeeded ZPWR_AUTOLOAD_COMPS "$ZPWR_AUTOLOAD_COMPS" "$ZPWR_AUTOLOAD/comps" "$ZPWR_AUTOLOAD"
# autoloaded common non completion but completion helper functions
zpwrEvalIfNeeded ZPWR_AUTOLOAD_COMP_UTILS "$ZPWR_AUTOLOAD_COMP_UTILS" "$ZPWR_AUTOLOAD/comp_utils" "$ZPWR_AUTOLOAD"
# autoloaded darwin non completion functions
zpwrEvalIfNeeded ZPWR_AUTOLOAD_DARWIN "$ZPWR_AUTOLOAD_DARWIN" "$ZPWR_AUTOLOAD/darwin" "$ZPWR_AUTOLOAD"
# autoloaded fzf helper functions
zpwrEvalIfNeeded ZPWR_AUTOLOAD_FZF "$ZPWR_AUTOLOAD_FZF" "$ZPWR_AUTOLOAD/fzf" "$ZPWR_AUTOLOAD"
# autoloaded linux non completion functions
zpwrEvalIfNeeded ZPWR_AUTOLOAD_LINUX "$ZPWR_AUTOLOAD_LINUX" "$ZPWR_AUTOLOAD/linux" "$ZPWR_AUTOLOAD"
# autoloaded systemctl non completion functions
zpwrEvalIfNeeded ZPWR_AUTOLOAD_SYSTEMCTL "$ZPWR_AUTOLOAD_SYSTEMCTL" "$ZPWR_AUTOLOAD/systemctl" "$ZPWR_AUTOLOAD"
# autoloaded completion functions
zpwrEvalIfNeeded ZPWR_COMPS "$ZPWR_COMPS" "$ZPWR/autoload/comps" "$ZPWR"
# cross OS command file
zpwrEvalIfNeeded ZPWR_CROSS_OS_CMD "$ZPWR_CROSS_OS_CMD" "$ZPWR_SCRIPTS/crossOSCommands.sh" "$ZPWR_SCRIPTS"
# cross OS fn file
zpwrEvalIfNeeded ZPWR_CROSS_OS_EXE "$ZPWR_CROSS_OS_EXE" "$ZPWR_SCRIPTS/crossOSExecute.sh" "$ZPWR_SCRIPTS"
# the location of macOS only associated interpreted scripts
# custom plugin dir
zpwrEvalIfNeeded ZPWR_PLUGIN_DIR "$ZPWR_PLUGIN_DIR" "$ZSH_CUSTOM/plugins" "$ZSH_CUSTOM"
# fzf custom plugin dir
zpwrEvalIfNeeded ZPWR_ZINIT_FZF "$ZPWR_ZINIT_FZF" "$ZPWR_PLUGIN_DIR/MenkeTechnologies---fzf" "$ZPWR_PLUGIN_DIR"
# same as zpwr local
zpwrEvalIfNeeded ZPWR_HIDDEN_DIR "$ZPWR_HIDDEN_DIR" "$ZPWR/local" "$ZPWR"
# private tokens file sourced before
zpwrEvalIfNeeded ZPWR_TOKEN_PRE "$ZPWR_TOKEN_PRE" "$ZPWR_LOCAL/.tokens.sh" "$ZPWR_LOCAL"
# private tokens file sourced after
zpwrEvalIfNeeded ZPWR_TOKEN_POST "$ZPWR_TOKEN_POST" "$ZPWR_LOCAL/.tokens-post.sh" "$ZPWR_LOCAL"
zpwrEvalIfNeeded ZPWR_TEST "$ZPWR_TEST" "$ZPWR/tests" "$ZPWR"
# zpwr install files
zpwrEvalIfNeeded ZPWR_INSTALL "$ZPWR_INSTALL" "$ZPWR/install" "$ZPWR"
# user tmux.conf file
zpwrEvalIfNeeded ZPWR_TMUXRC "$ZPWR_TMUXRC" "$ZPWR_INSTALL/.tmux.conf" "$ZPWR_INSTALL"
# user vimrc file
zpwrEvalIfNeeded ZPWR_VIMRC "$ZPWR_VIMRC" "$ZPWR_INSTALL/.vimrc" "$ZPWR_INSTALL"
# user ideavimrc file
zpwrEvalIfNeeded ZPWR_IDEAVIMRC "$ZPWR_IDEAVIMRC" "$ZPWR_INSTALL/.ideavimrc" "$ZPWR_INSTALL"
# zpwr ztmux config files
zpwrEvalIfNeeded ZPWR_TMUX "$ZPWR_TMUX" "$ZPWR/tmux" "$ZPWR"
# zpwr ztmux git ignored files
zpwrEvalIfNeeded ZPWR_TMUX_LOCAL "$ZPWR_TMUX_LOCAL" "$ZPWR_TMUX/local" "$ZPWR_TMUX"
# the base path for zsh temp
zpwrEvalIfNeeded TMPPREFIX "$TMPPREFIX" "$ZPWR_LOCAL/.temp/zsh" "$ZPWR_LOCAL"
# the base dir for zpwr temp
zpwrEvalIfNeeded ZPWR_LOCAL_TEMP "$ZPWR_LOCAL_TEMP" "$ZPWR_LOCAL/.temp" "$ZPWR_LOCAL"
# the path to a lock file (semaphore) for zpwr
zpwrEvalIfNeeded ZPWR_LOCK_FILE "$ZPWR_LOCK_FILE" "$ZPWR_LOCAL/.lock" "$ZPWR_LOCAL"
# cache file for all zpwr env lookups
zpwrEvalIfNeeded ZPWR_LOCAL_ENV "$ZPWR_LOCAL_ENV" "$ZPWR_LOCAL/zpwrEnv" "$ZPWR_LOCAL"
# powerlevel10k config file for PROMPT
zpwrEvalIfNeeded ZPWR_PROMPT_FILE "$ZPWR_PROMPT_FILE" "$ZPWR_ENV/.p10k.zsh" "$ZPWR_ENV"
# the location of associated interpreted scripts
zpwrEvalIfNeeded ZPWR_SCRIPTS "$ZPWR_SCRIPTS" "$ZPWR/scripts" "$ZPWR"
# the location of macOS only associated interpreted scripts
zpwrEvalIfNeeded ZPWR_SCRIPTS_MAC "$ZPWR_SCRIPTS_MAC" "$ZPWR_SCRIPTS/macOnly" "$ZPWR_SCRIPTS"
# the location of zpwr verbs setup script
zpwrEvalIfNeeded ZPWR_VERBS_FILE "$ZPWR_VERBS_FILE" "$ZPWR_ENV/zpwr.zsh" "$ZPWR_ENV"
# the location of zpwr lib file
zpwrEvalIfNeeded ZPWR_LIB "$ZPWR_LIB" "$ZPWR_SCRIPTS/lib.sh" "$ZPWR_SCRIPTS"
# the location of zpwr init file
zpwrEvalIfNeeded ZPWR_LIB_INIT "$ZPWR_LIB_INIT" "$ZPWR_SCRIPTS/init.sh" "$ZPWR_SCRIPTS"
# command for all fzf clearlist in preview pane
zpwrEvalIfNeeded ZPWR_FZF_CLEARLIST "$ZPWR_FZF_CLEARLIST" "zsh $ZPWR_SCRIPTS/zpwrClearList.zsh -- \\\$file | fold -s -w 80" "$ZPWR_SCRIPTS"
# the file used to find most recent files opened in neovim
zpwrEvalIfNeeded ZPWR_NVIMINFO "$ZPWR_NVIMINFO" "$ZPWR_LOCAL/.nviminfo" "$ZPWR_LOCAL"
# emacs recent files
zpwrEvalIfNeeded ZPWR_RECENTF "$ZPWR_RECENTF" "$HOME/.emacs.d/.cache/recentf" "$HOME"
# alternate banner to ponysay
zpwrEvalIfNeeded ZPWR_BANNER_COMMAND "$ZPWR_BANNER_COMMAND" "bash $ZPWR_SCRIPTS_MAC/figletRandomFontOnce.sh $(hostname)" "$ZPWR_SCRIPTS_MAC"
# zpwr banner file location
zpwrEvalIfNeeded ZPWR_BANNER_SCRIPT "$ZPWR_BANNER_SCRIPT" "$ZPWR_SCRIPTS/about.sh" "$ZPWR_SCRIPTS"
# cache of git dirs
zpwrEvalIfNeeded ZPWR_ALL_GIT_DIRS "$ZPWR_ALL_GIT_DIRS" "$ZPWR_LOCAL/zpwrGitDirs.txt" "$ZPWR_LOCAL"
# cache of clean git dirs
zpwrEvalIfNeeded ZPWR_ALL_GIT_DIRS_CLEAN "$ZPWR_ALL_GIT_DIRS_CLEAN" "$ZPWR_LOCAL/zpwrGitDirsClean.txt" "$ZPWR_LOCAL"
# cache of dirty git dirs
zpwrEvalIfNeeded ZPWR_ALL_GIT_DIRS_DIRTY "$ZPWR_ALL_GIT_DIRS_DIRTY" "$ZPWR_LOCAL/zpwrGitDirsDirty.txt" "$ZPWR_LOCAL"
# log file
zpwrEvalIfNeeded ZPWR_LOGFILE "$ZPWR_LOGFILE" "$ZPWR_LOCAL/zpwrLog.txt" "$ZPWR_LOCAL"
# cache of env keys
zpwrEvalIfNeeded ZPWR_ENV_KEY_FILE "$ZPWR_ENV_KEY_FILE" "${ZPWR_LOCAL_ENV}Key.txt" "$ZPWR_LOCAL_ENV"
# cache of env values
zpwrEvalIfNeeded ZPWR_ENV_VALUE_FILE "$ZPWR_ENV_VALUE_FILE" "${ZPWR_LOCAL_ENV}Value.txt" "$ZPWR_LOCAL_ENV"
# temp files
zpwrEvalIfNeeded ZPWR_TEMPFILE "$ZPWR_TEMPFILE" "$ZPWR_LOCAL_TEMP/.temp$$-$USER" "$ZPWR_LOCAL_TEMP" "$USER"
zpwrEvalIfNeeded ZPWR_TEMPFILE1 "$ZPWR_TEMPFILE1" "$ZPWR_LOCAL_TEMP/.temp$$-1$USER" "$ZPWR_LOCAL_TEMP" "$USER"
zpwrEvalIfNeeded ZPWR_TEMPFILE2 "$ZPWR_TEMPFILE2" "$ZPWR_LOCAL_TEMP/.temp$$-2$USER" "$ZPWR_LOCAL_TEMP" "$USER"
zpwrEvalIfNeeded ZPWR_TEMPFILE3 "$ZPWR_TEMPFILE3" "$ZPWR_LOCAL_TEMP/.temp$$-3$USER" "$ZPWR_LOCAL_TEMP" "$USER"
zpwrEvalIfNeeded ZPWR_TEMPFILE4 "$ZPWR_TEMPFILE4" "$ZPWR_LOCAL_TEMP/.temp$$-4$USER" "$ZPWR_LOCAL_TEMP" "$USER"
zpwrEvalIfNeeded ZPWR_TEMPFILE_PROCESSED "$ZPWR_TEMPFILE_PROCESSED" "$ZPWR_LOCAL_TEMP/.temp$$-processed$USER" "$ZPWR_LOCAL_TEMP" "$USER"
# SQL temp files for use with learning collection
zpwrEvalIfNeeded ZPWR_TEMPFILE_SQL "$ZPWR_TEMPFILE_SQL" "$ZPWR_LOCAL_TEMP/.temp$$-2$USER.sql" "$ZPWR_LOCAL_TEMP" "$USER"
# last ztmux window text capture
zpwrEvalIfNeeded ZPWR_TMUX_CAPTURE "$ZPWR_TMUX_CAPTURE" "$ZPWR_TMUX_LOCAL/tmux-capture-$$-$USER" "$ZPWR_TMUX_LOCAL" "$USER"
# socket for IPC
zpwrEvalIfNeeded ZPWR_SOCKET "$ZPWR_SOCKET" "$ZPWR_LOCAL_TEMP/.temp-$USER-socket" "$ZPWR_LOCAL_TEMP" "$USER"
# fifo for IPC
zpwrEvalIfNeeded ZPWR_FIFO "$ZPWR_FIFO" "$ZPWR_LOCAL_TEMP/.temp-$USER-fifo" "$ZPWR_LOCAL_TEMP" "$USER"
# zsh compsys completion system dir for cached completions
zpwrEvalIfNeeded ZPWR_COMPSYS_CACHE "$ZPWR_COMPSYS_CACHE" "$ZPWR_LOCAL/zcompcache" "$ZPWR_LOCAL"
# compsys cache file
zpwrEvalIfNeeded ZSH_COMPDUMP "$ZSH_COMPDUMP" "$ZPWR_LOCAL/.zcompdump-$ZPWR_REPO_NAME-$ZPWR_GITHUB_ACCOUNT" "$ZPWR_LOCAL" "$ZPWR_REPO_NAME" "$ZPWR_GITHUB_ACCOUNT"
# forked repos dir
zpwrEvalIfNeeded ZPWR_FORKED_DIR "$ZPWR_FORKED_DIR" "$HOME/forkedRepos" "$HOME"
# common dirs
zpwrEvalIfNeeded ZPWR_D "$ZPWR_D" "$HOME/Desktop" "$HOME"
zpwrEvalIfNeeded ZPWR_DOC "$ZPWR_DOC" "$HOME/Documents" "$HOME"
zpwrEvalIfNeeded ZPWR_DL "$ZPWR_DL" "$HOME/Downloads" "$HOME"
# history file
zpwrEvalIfNeeded HISTFILE "$HISTFILE" "$ZPWR_LOCAL/.$ZPWR_REPO_NAME-$ZPWR_GITHUB_ACCOUNT-history" "$ZPWR_LOCAL" "$ZPWR_REPO_NAME" "$ZPWR_GITHUB_ACCOUNT"
# the path for vim keybindings cache
zpwrEvalIfNeeded ZPWR_VIM_KEYBINDINGS "$ZPWR_VIM_KEYBINDINGS" "$ZPWR_LOCAL/zpwrVimKeybindings.txt" "$ZPWR_LOCAL"
# the path for all keybindings cache
zpwrEvalIfNeeded ZPWR_ALL_KEYBINDINGS "$ZPWR_ALL_KEYBINDINGS" "$ZPWR_LOCAL/zpwrAllKeybindings.txt" "$ZPWR_LOCAL"
# build GitHub URL
zpwrEvalIfNeeded ZPWR_GITHUB_URL "$ZPWR_GITHUB_URL" "https://github.com/$ZPWR_GITHUB_ACCOUNT" "$ZPWR_GITHUB_ACCOUNT"

Diagnostics

The test suite contains thousands of zunit tests across tests/*.zsh covering autoload function existence, type resolution, whence/which lookups, function body validation, fpath integrity, source syntax, script readability, shebang detection, verb callability, environment variable isolation, and behavioral checks for scripts/lib.sh helpers (required-argument validation, usage errors, and bash zpwrExists multi-argument parity with zsh).

zpwrCommandExists tests are limited to commands present on the Ubuntu runner base image or installed by .github/workflows/ci.yml (including stryke, installed there via cargo install stryke for functions such as zpwrContribCount); they do not assume optional packages (for example lsof, jq, openssl, sudo, pagers, or file/strings from extra packages) unless those packages are added to that workflow.

All ZPWR_* environment variables are unset before each test run to prevent user env from leaking into test results.

You can run zpwr unit tests via zpwr test and include plugin tests with zpwr testall.

There is also the alias tru (tests run) to run the tests.

zpwrExists zunit && {
    alias tru="( builtin cd $ZPWR && zunit --verbose )"
}

Boot Time -- Shell Startup Speed

Running zpwr recompile will zrecompile all zpwr configs and all autoloaded functions and compsys completions in fpath. zpwr refreshzwc will remove old .zwc files before zrecompile. This will maximize startup and running speed -- a tighter boot sequence.

ZPWR uses Powerlevel10k instant prompt to render a cached prompt in under 10ms -- well below the 100ms human perceptibility threshold. Named directories (hash -d) are cached to $ZPWR_LOCAL/zpwr-hash-dirs.zsh so the instant prompt resolves paths like ~ZPWR without sourcing the full environment first. The cache is regenerated each session by zpwrBindDirs. The remaining shell initialization (env vars, aliases, autoloads, zinit plugin declarations) completes behind the visible prompt. Turbo-deferred plugins (syntax highlighting, autosuggestions, completions) load asynchronously after the prompt is interactive. The banner is automatically suppressed when instant prompt is active to avoid fd conflicts. Run zpwr environmentcounts to see both prompt time and total startup time.

External command forks in the startup path have been systematically replaced with zsh builtins: ${commands[zsh]} instead of $(which zsh), zf_ln from zsh/files instead of ln for completion symlinks, $TTY instead of $(tty), : >| instead of touch for empty file creation, and [[ pattern ]] instead of echo | grep for PATH checks. These changes eliminate ~35ms of fork overhead per interactive shell startup.

With Zinit Turbo mode, despite the number of plugins and completions, total initialization usually takes < 1 second on faster machines (.15 to .4 seconds on M1 Max) but up to 2-10 seconds on slower rigs such as WSL. Zinit runs compinit in the background after startup and you will experience a brief lockup (unnoticeable if zpwr regenzsh and zpwr recompile have run to create .zcompdump.zwc). This variable controls the delay between prompt and compinit.

export ZPWR_ZINIT_COMPINIT_DELAY=0

Startup Benchmark -- zpwr bench

zpwr bench [N] runs N shell startups (default 10) and reports detailed performance metrics with a cyberpunk-styled output. It reports system info, environment counts (functions, completions, aliases, plugins), per-run timing with a progress bar, percentile statistics (avg, p50, p99, min, max, spread), a phase breakdown showing time spent in each startup stage (instant prompt, env+aliases, plugin declarations, compsys, options+fzf), baseline comparison with delta percentage, and a persistent run history. Save a baseline after optimizing and future runs will show whether startup got faster or slower.

zpwr bench -h      # cyberpunk help
zpwr bench 5       # run 5 iterations
zpwr bench         # default 10 iterations
zpwr bench 20      # 20 iterations for stable p99

Baselines and history are stored in $ZPWR_LOCAL/zpwr-bench-baseline.txt and $ZPWR_LOCAL/zpwr-bench-history.txt.

Environment Snapshots -- zpwr snapshot / zpwr restore

zpwr snapshot [name] captures the full terminal environment into a portable snapshot stored in $ZPWR_LOCAL/snapshots/. Each snapshot captures: named directories (hash -d), aliases (regular, global, suffix), environment variables, ZPWR_VARS, shell history, directory stack, git repo status, ztmux sessions/windows/panes with tmux-resurrect integration, and vim session files.

zpwr snapshot -h                    # cyberpunk help
zpwr snapshot myproject             # capture with custom name
zpwr snapshot                       # capture with timestamp name
zpwr restore -h                     # cyberpunk help
zpwr restore                        # list all snapshots
zpwr restore myproject              # restore everything
zpwr restore myproject aliases env  # restore only specific components

Available restore components: hash, aliases, env, tmux, vim, history, dirs. Tmux restore stages the resurrect file -- press prefix+Ctrl-r to apply. History is merged rather than overwritten.

Live Dashboard -- zpwr top

zpwr top [interval] displays a live-updating dashboard of shell resource usage. Shows memory (RSS with bar graph, virtual memory), history size, child processes, jobs, zle widgets, hooks, shell objects (functions, completions, aliases, commands, builtins, parameters, modules) with delta tracking between refreshes, loaded zsh modules, paths, git status, ztmux session counts, top 5 largest functions with size bars, and top 5 longest PATH entries. Includes sparkline graphs: startup time history (last 40 shell starts, color-coded green/yellow/red with min/max/avg stats) and commit velocity (commits per day over last 30 days). Startup times are automatically logged to $ZPWR_LOCAL/startup_history.log on each shell init. Runs in an alternate screen buffer -- press q to quit cleanly.

zpwr top -h    # cyberpunk help
zpwr top       # refresh every 2s (default)
zpwr top 5     # refresh every 5s
zpwr top 1     # fast refresh

Tmux Layout Save/Load -- zpwr tmuxsave / zpwr tmuxload

zpwr tmuxsave [name] captures the current ztmux session layout — windows, pane splits, layout geometry, working directories, and window names — into a self-contained zsh script in $ZPWR_LOCAL/layouts/. The generated script recreates the exact layout via ztmux new-session, split-window, and select-layout with the original geometry string, then cds each pane to its saved directory. zpwr tmuxload [name] sources the script to restore the layout, with optional fzf picker when no name is given. Also available as zpwr layoutsave and zpwr layoutload.

zpwr tmuxsave              # save with timestamp name
zpwr tmuxsave dev          # save as "dev"
zpwr tmuxsave --list       # list saved layouts
zpwr tmuxsave --delete dev # delete "dev" layout
zpwr tmuxload dev          # restore "dev" layout
zpwr tmuxload dev mywork   # restore as session "mywork"
zpwr tmuxload              # fzf picker (if fzf available)

Health Check -- zpwr doctor

zpwr doctor scans the environment for common issues and reports with pass/warn/fail indicators. Checks for: stale .zwc compiled files, zcompdump freshness, duplicate and missing PATH/FPATH entries, broken symlinks, invalid named directories, p10k named dir pollution, missing dependencies (git, eza, fzf, tmux, stryke, python3), zinit installation, history file and backups, and config symlinks (.zshrc, .vimrc, .tmux.conf, .p10k.zsh). Reports a signal bar and summary with pass/warning/error counts.

zpwr doctor -h  # cyberpunk help
zpwr doctor     # run full diagnostic

Flame Chart -- zpwr flame

zpwr flame [N] launches an instrumented shell with zprof, parses the profiling data, and renders an ASCII flame chart of the top N functions by total time. Bars are heat-colored (red = hot, yellow = warm, green = cool, cyan = cold). Includes a summary with the hottest function, total profiled count, and contextual optimization tips based on which function dominates startup.

zpwr flame -h    # cyberpunk help with heat scale legend
zpwr flame       # top 20 functions (default)
zpwr flame 40    # top 40 functions
zpwr flame 5     # quick view of hottest 5

Startup Profile -- zpwr startup

zpwr startup [N] launches a fresh zsh with zprof enabled and displays a colorized breakdown of function call times. Unlike zpwr bench (which measures total wall time over multiple iterations), zpwr startup gives a single-shot, per-function profile showing exactly where time is spent during initialization. Functions are color-coded by self-percentage: red (>=10%), yellow (>=3%), cyan (>=1%), dim (<1%). Includes the call tree section when available.

zpwr startup -h        # cyberpunk help
zpwr startup           # top 30 functions (default)
zpwr startup 50        # top 50 functions
zpwr startup 100       # full breakdown

Shell Lint -- zpwr lint

zpwr lint [OPTIONS] runs zsh -n syntax checking on all autoload functions and env files, and shellcheck on all shell scripts in scripts/ and install/. Shellcheck runs with zsh-incompatible warnings suppressed (SC1071, SC1090, SC1091, SC2034, SC2139, SC2148, SC2154, SC2206, SC2296). Reports per-file pass/fail with a summary of errors and warnings.

zpwr lint -h           # cyberpunk help
zpwr lint              # run all checks
zpwr lint -z           # zsh -n syntax check only
zpwr lint -s           # shellcheck only

Listening Ports -- zpwr ports

zpwr ports [OPTIONS] [PORT] shows all listening TCP ports with process name, PID, user, port number, and bind address. Ports are color-coded: red for privileged (<1024), yellow for common ranges (<10000), green for high ports. Supports filtering by port number and killing the process on a specific port.

zpwr ports -h          # cyberpunk help
zpwr ports             # show all listening ports
zpwr ports 8080        # filter to port 8080
zpwr ports -k 3000     # kill whatever is on port 3000

Stale File Finder -- zpwr stale

zpwr stale [OPTIONS] scans the zpwr directory tree for stale .zwc compiled files (source newer than compiled), orphan .zwc files (source deleted), broken symlinks, and empty cache files. Use --fix to delete all stale artifacts in one pass.

zpwr stale -h          # cyberpunk help
zpwr stale             # scan and report
zpwr stale -f          # delete all stale files

Path Audit -- zpwr pathaudit

zpwr pathaudit [OPTIONS] audits PATH, FPATH, and MANPATH for duplicate entries, missing directories, and world-writable directories (security risk). Reports per-array with totals. Use --verbose to see every entry including healthy ones.

zpwr pathaudit -h      # cyberpunk help
zpwr pathaudit         # audit all three arrays
zpwr pathaudit -v      # verbose: show all entries

Git Who -- zpwr gitwho

zpwr gitwho [N] aggregates git shortlog -sn across all cached git repos ($ZPWR_ALL_GIT_DIRS). Shows each contributor's total commits and number of repos, ranked by commit count with bar charts. Results are cached in $ZPWR_LOCAL/zpwrGitwho.txt (pre-sorted) and auto-rebuild when the repo cache changes. Use --reset to force a rebuild. Requires the git repo cache — run zpwr regengitrepocache first.

zpwr gitwho -h         # cyberpunk help
zpwr gitwho            # top 20 authors across all repos
zpwr gitwho 50         # top 50
zpwr gitwho -a         # show everyone
zpwr gitwho -r         # force cache rebuild

History Timeline -- zpwr timeline

zpwr timeline [DATE] renders a visual timeline of shell history grouped by hour. Commands are color-coded by type (git=green, editors=cyan, zpwr=magenta, destructive=red, navigation=yellow). Directory changes are highlighted inline. Includes an activity heatmap showing commands-per-hour with bars.

zpwr timeline -h              # cyberpunk help
zpwr timeline                 # today's activity
zpwr timeline 2026-04-01      # specific date
zpwr timeline -n 500          # last 500 history entries

Alias Analytics -- zpwr aliasrank

zpwr aliasrank [N] mines shell history to rank alias usage. Since zsh-expand expands aliases before they hit history, aliasrank matches expanded commands against alias definitions (reverse lookup). Shows the top N most-used aliases with frequency bars, lists never-matched aliases (candidates for removal), and identifies frequently typed commands that have no alias (candidates for creation). Results are cached in $ZPWR_LOCAL/ and rebuild automatically when history grows by 1000+ lines. Use --reset to force a cache rebuild.

zpwr aliasrank -h       # cyberpunk help
zpwr aliasrank          # top 20 (default)
zpwr aliasrank 50       # top 50
zpwr aliasrank --reset  # clear cache and rebuild

Function Rank -- zpwr funcrank

zpwr funcrank [N] ranks functions and zpwr verbs by history usage. Shows top N most-called functions, top N most-used zpwr verbs (parsed from zpwr <verb> history entries), lists never-used zpwr verbs (candidates for discovery), and lists unused autoloaded functions that were never called directly. Shares the same history cache as aliasrank.

zpwr funcrank -h       # cyberpunk help
zpwr funcrank          # top 20 (default)
zpwr funcrank 40       # top 40
zpwr funcrank --reset  # clear cache and rebuild

File Watcher -- zpwr watch

zpwr watch <glob> <command> watches files for changes using fswatch (macOS) or inotifywait (Linux) and runs a command on each change. Shows trigger count, timestamp, changed filename, and execution time.

zpwr watch -h                          # cyberpunk help
zpwr watch '*.zsh' 'zpwr recompile'   # recompile on zsh change
zpwr watch 'src/**/*.ts' 'npm run build'
zpwr watch 'Makefile' 'make'
zpwr watch '.' 'echo changed'         # watch entire directory

Command Replay -- zpwr replay

zpwr replay [N] [mode] replays the last N commands from history. Three modes: preview (default) lists commands without executing, exec runs them in the current shell with per-command timing, and tmux opens a new tmux split pane and plays them with a delay between each.

zpwr replay -h         # cyberpunk help with mode docs
zpwr replay 10         # preview last 10 commands
zpwr replay 20         # preview last 20
zpwr replay 5 exec     # execute last 5 with timing
zpwr replay 10 tmux    # replay in new tmux pane

All new commands support -h/--help with cyberpunk-styled output matching the temprs aesthetic -- ASCII banners, signal bars, // separators, and full option documentation.

Command Trace -- zpwr trace

zpwr trace [OPTIONS] <command> runs a command with full instrumentation. On Linux, it captures syscall counts (strace), C library call counts (ltrace), and resource stats (/usr/bin/time -v). On macOS, SIP restricts dtrace so only resource stats from /usr/bin/time -l are available (context switches, page faults, block I/O, peak RSS, signals, IPC messages). All platforms show wall/user/sys time, exit code, memory delta, child process count, and a performance signal bar.<

more like this

vim-dap

Vim/Neovim debugger plugin providing a terminal interface to the Debug Adapter Protocol

Vim Script50

search

search projects, people, and tags