Skip to content

Instantly share code, notes, and snippets.

@ngocphamm
Created May 16, 2019 20:11
Show Gist options
  • Save ngocphamm/dd0af29ad2bb99a7846ca53385ca3804 to your computer and use it in GitHub Desktop.
Save ngocphamm/dd0af29ad2bb99a7846ca53385ca3804 to your computer and use it in GitHub Desktop.
ZSH start with -v. Crash.
Last login: Thu May 16 16:03:02 on ttys017
# zmodload zsh/zprof
# setopt SOURCE_TRACE
path=(
/usr/local/{bin,sbin}
$path,
$HOME/.composer/vendor/bin
)
setopt promptsubst
autoload -Uz promptinit && promptinit
# zstyle ':prezto:*:*' color 'yes'
# zstyle ':prezto:module:editor' key-bindings 'emacs'
# zstyle ':prezto:module:history-substring-search:color' found 'bg=green,fg=white,bold'
# zstyle ":prezto:module:enhancd" command "fzy:fzf:peco"
# zstyle ":prezto:module:enhancd" command "cd"
# # zstyle ':prezto:module:prompt' theme 'sorin'
# ##### Zplugin
source '/Users/ngoc/.zplugin/bin/zplugin.zsh'
autoload -Uz _zplugin
(( ${+_comps} )) && _comps[zplugin]=_zplugin
zplugin light mafredri/zsh-async
zplugin light zsh-users/zsh-completions
zplugin light zsh-users/zsh-history-substring-search
zplugin light zsh-users/zsh-autosuggestions
zplugin ice svn; zplugin snippet PZT::modules/git
#
# Defines Git aliases.
#
# Authors:
# Sorin Ionescu <[email protected]>
#
#
# Settings
#
#
# Log
zstyle -s ':prezto:module:git:log:medium' format '_git_log_medium_format' \
|| _git_log_medium_format='%C(bold)Commit:%C(reset) %C(green)%H%C(red)%d%n%C(bold)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B'
zstyle -s ':prezto:module:git:log:oneline' format '_git_log_oneline_format' \
|| _git_log_oneline_format='%C(green)%h%C(reset) %s%C(red)%d%C(reset)%n'
zstyle -s ':prezto:module:git:log:brief' format '_git_log_brief_format' \
|| _git_log_brief_format='%C(green)%h%C(reset) %s%n%C(blue)(%ar by %an)%C(red)%d%C(reset)%n'
# Status
zstyle -s ':prezto:module:git:status:ignore' submodules '_git_status_ignore_submodules' \
|| _git_status_ignore_submodules='none'
#
# Aliases
#
if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
# Git
alias g='git'
# Branch (b)
alias gb='git branch'
alias gba='git branch --all --verbose'
alias gbc='git checkout -b'
alias gbd='git branch --delete'
alias gbD='git branch --delete --force'
alias gbl='git branch --verbose'
alias gbL='git branch --all --verbose'
alias gbm='git branch --move'
alias gbM='git branch --move --force'
alias gbr='git branch --move'
alias gbR='git branch --move --force'
alias gbs='git show-branch'
alias gbS='git show-branch --all'
alias gbv='git branch --verbose'
alias gbV='git branch --verbose --verbose'
alias gbx='git branch --delete'
alias gbX='git branch --delete --force'
# Commit (c)
alias gc='git commit --verbose'
alias gca='git commit --verbose --all'
alias gcm='git commit --message'
alias gcS='git commit -S --verbose'
alias gcSa='git commit -S --verbose --all'
alias gcSm='git commit -S --message'
alias gcam='git commit --all --message'
alias gco='git checkout'
alias gcO='git checkout --patch'
alias gcf='git commit --amend --reuse-message HEAD'
alias gcSf='git commit -S --amend --reuse-message HEAD'
alias gcF='git commit --verbose --amend'
alias gcSF='git commit -S --verbose --amend'
alias gcp='git cherry-pick --ff'
alias gcP='git cherry-pick --no-commit'
alias gcr='git revert'
alias gcR='git reset "HEAD^"'
alias gcs='git show'
alias gcsS='git show --pretty=short --show-signature'
alias gcl='git-commit-lost'
alias gcy='git cherry -v --abbrev'
alias gcY='git cherry -v'
# Conflict (C)
alias gCl='git --no-pager diff --name-only --diff-filter=U'
alias gCa='git add $(gCl)'
alias gCe='git mergetool $(gCl)'
alias gCo='git checkout --ours --'
alias gCO='gCo $(gCl)'
alias gCt='git checkout --theirs --'
alias gCT='gCt $(gCl)'
# Data (d)
alias gd='git ls-files'
alias gdc='git ls-files --cached'
alias gdx='git ls-files --deleted'
alias gdm='git ls-files --modified'
alias gdu='git ls-files --other --exclude-standard'
alias gdk='git ls-files --killed'
alias gdi='git status --porcelain --short --ignored | sed -n "s/^!! //p"'
# Fetch (f)
alias gf='git fetch'
alias gfa='git fetch --all'
alias gfc='git clone'
alias gfcr='git clone --recurse-submodules'
alias gfm='git pull'
alias gfr='git pull --rebase'
# Flow (F)
alias gFi='git flow init'
alias gFf='git flow feature'
alias gFb='git flow bugfix'
alias gFl='git flow release'
alias gFh='git flow hotfix'
alias gFs='git flow support'
alias gFfl='git flow feature list'
alias gFfs='git flow feature start'
alias gFff='git flow feature finish'
alias gFfp='git flow feature publish'
alias gFft='git flow feature track'
alias gFfd='git flow feature diff'
alias gFfr='git flow feature rebase'
alias gFfc='git flow feature checkout'
alias gFfm='git flow feature pull'
alias gFfx='git flow feature delete'
alias gFbl='git flow bugfix list'
alias gFbs='git flow bugfix start'
alias gFbf='git flow bugfix finish'
alias gFbp='git flow bugfix publish'
alias gFbt='git flow bugfix track'
alias gFbd='git flow bugfix diff'
alias gFbr='git flow bugfix rebase'
alias gFbc='git flow bugfix checkout'
alias gFbm='git flow bugfix pull'
alias gFbx='git flow bugfix delete'
alias gFll='git flow release list'
alias gFls='git flow release start'
alias gFlf='git flow release finish'
alias gFlp='git flow release publish'
alias gFlt='git flow release track'
alias gFld='git flow release diff'
alias gFlr='git flow release rebase'
alias gFlc='git flow release checkout'
alias gFlm='git flow release pull'
alias gFlx='git flow release delete'
alias gFhl='git flow hotfix list'
alias gFhs='git flow hotfix start'
alias gFhf='git flow hotfix finish'
alias gFhp='git flow hotfix publish'
alias gFht='git flow hotfix track'
alias gFhd='git flow hotfix diff'
alias gFhr='git flow hotfix rebase'
alias gFhc='git flow hotfix checkout'
alias gFhm='git flow hotfix pull'
alias gFhx='git flow hotfix delete'
alias gFsl='git flow support list'
alias gFss='git flow support start'
alias gFsf='git flow support finish'
alias gFsp='git flow support publish'
alias gFst='git flow support track'
alias gFsd='git flow support diff'
alias gFsr='git flow support rebase'
alias gFsc='git flow support checkout'
alias gFsm='git flow support pull'
alias gFsx='git flow support delete'
# Grep (g)
alias gg='git grep'
alias ggi='git grep --ignore-case'
alias ggl='git grep --files-with-matches'
alias ggL='git grep --files-without-matches'
alias ggv='git grep --invert-match'
alias ggw='git grep --word-regexp'
# Index (i)
alias gia='git add'
alias giA='git add --patch'
alias giu='git add --update'
alias gid='git diff --no-ext-diff --cached'
alias giD='git diff --no-ext-diff --cached --word-diff'
alias gii='git update-index --assume-unchanged'
alias giI='git update-index --no-assume-unchanged'
alias gir='git reset'
alias giR='git reset --patch'
alias gix='git rm -r --cached'
alias giX='git rm -rf --cached'
# Log (l)
alias gl='git log --topo-order --pretty=format:"${_git_log_medium_format}"'
alias gls='git log --topo-order --stat --pretty=format:"${_git_log_medium_format}"'
alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:"${_git_log_medium_format}"'
alias glo='git log --topo-order --pretty=format:"${_git_log_oneline_format}"'
alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"'
alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"'
alias glc='git shortlog --summary --numbered'
alias glS='git log --show-signature'
# Merge (m)
alias gm='git merge'
alias gmC='git merge --no-commit'
alias gmF='git merge --no-ff'
alias gma='git merge --abort'
alias gmt='git mergetool'
# Push (p)
alias gp='git push'
alias gpf='git push --force-with-lease'
alias gpF='git push --force'
alias gpa='git push --all'
alias gpA='git push --all && git push --tags'
alias gpt='git push --tags'
alias gpc='git push --set-upstream origin "$(git-branch-current 2> /dev/null)"'
alias gpp='git pull origin "$(git-branch-current 2> /dev/null)" && git push origin "$(git-branch-current 2> /dev/null)"'
# Rebase (r)
alias gr='git rebase'
alias gra='git rebase --abort'
alias grc='git rebase --continue'
alias gri='git rebase --interactive'
alias grs='git rebase --skip'
# Remote (R)
alias gR='git remote'
alias gRl='git remote --verbose'
alias gRa='git remote add'
alias gRx='git remote rm'
alias gRm='git remote rename'
alias gRu='git remote update'
alias gRp='git remote prune'
alias gRs='git remote show'
alias gRb='git-hub-browse'
# Stash (s)
alias gs='git stash'
alias gsa='git stash apply'
alias gsx='git stash drop'
alias gsX='git-stash-clear-interactive'
alias gsl='git stash list'
alias gsL='git-stash-dropped'
alias gsd='git stash show --patch --stat'
alias gsp='git stash pop'
alias gsr='git-stash-recover'
alias gss='git stash save --include-untracked'
alias gsS='git stash save --patch --no-keep-index'
alias gsw='git stash save --include-untracked --keep-index'
# Submodule (S)
alias gS='git submodule'
alias gSa='git submodule add'
alias gSf='git submodule foreach'
alias gSi='git submodule init'
alias gSI='git submodule update --init --recursive'
alias gSl='git submodule status'
alias gSm='git-submodule-move'
alias gSs='git submodule sync'
alias gSu='git submodule foreach git pull origin master'
alias gSx='git-submodule-remove'
# Tag (t)
alias gt='git tag'
alias gtl='git tag -l'
alias gts='git tag -s'
alias gtv='git verify-tag'
# Working Copy (w)
alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short'
alias gwS='git status --ignore-submodules=${_git_status_ignore_submodules}'
alias gwd='git diff --no-ext-diff'
alias gwD='git diff --no-ext-diff --word-diff'
alias gwr='git reset --soft'
alias gwR='git reset --hard'
alias gwc='git clean -n'
alias gwC='git clean -f'
alias gwx='git rm -r'
alias gwX='git rm -rf'
fi
zplugin snippet PZT::modules/history/init.zsh
zplugin ice wait"0" pick"init.zsh" svn
zplugin snippet PZT::modules/fasd
# zplugin ice wait"0" blockf pick"init.zsh" svn \
# atclone'git clone https://github.com/zsh-users/zsh-completions.git external'
# zplugin snippet PZT::modules/completion
# zplugin ice wait"1" pick"init.zsh" svn \
# atclone'git clone https://github.com/zsh-users/zsh-history-substring-search.git external'
# zplugin snippet PZT::modules/history-substring-search
# zplugin ice wait"2" pick"init.zsh" svn \
# atclone'git clone https://github.com/zsh-users/zsh-autosuggestions.git external'
# zplugin snippet PZT::modules/autosuggestions
# # zplugin ice as"program" pick"prompt-pwd" silent svn; zplugin snippet PZT::modules/prompt
# # zplugin ice svn silent; zplugin snippet PZT::modules/prompt
zplugin ice wait"0" atinit"zpcompinit; zpcdreplay"
zplugin light zdharma/fast-syntax-highlighting
NMB% # add zsh hook
_fasd_preexec() {
{ eval "fasd --proc $(fasd --sanitize $1)"; } >> "/dev/null" 2>&1
}
autoload -Uz add-zsh-hook
add-zsh-hook preexec _fasd_preexec
# zsh command mode completion
_fasd_zsh_cmd_complete() {
local compl
read -c compl
(( $+compstate )) && compstate[insert]=menu # no expand if compsys loaded
reply=(${(f)"$(fasd --complete "$compl")"})
}
# enbale command mode completion
compctl -U -K _fasd_zsh_cmd_complete -V fasd -x 'C[-1,-*e],s[-]n[1,e]' -c - \
'c[-1,-A][-1,-D]' -f -- fasd fasd_cd
(( $+functions[compdef] )) && {
# zsh word mode completion
_fasd_zsh_word_complete() {
[ "$2" ] && local _fasd_cur="$2"
[ -z "$_fasd_cur" ] && local _fasd_cur="${words[CURRENT]}"
local fnd="${_fasd_cur//,/ }"
local typ=${1:-e}
fasd --query $typ "$fnd" 2>> "/dev/null" | \
sort -nr | sed 's/^[^ ]*[ ]*//' | while read -r line; do
compadd -U -V fasd "$line"
done
compstate[insert]=menu # no expand
}
_fasd_zsh_word_complete_f() { _fasd_zsh_word_complete f ; }
_fasd_zsh_word_complete_d() { _fasd_zsh_word_complete d ; }
_fasd_zsh_word_complete_trigger() {
local _fasd_cur="${words[CURRENT]}"
eval $(fasd --word-complete-trigger _fasd_zsh_word_complete $_fasd_cur)
}
# define zle widgets
zle -C fasd-complete complete-word _generic
zstyle ':completion:fasd-complete:*' completer _fasd_zsh_word_complete
zstyle ':completion:fasd-complete:*' menu-select
zle -C fasd-complete-f complete-word _generic
zstyle ':completion:fasd-complete-f:*' completer _fasd_zsh_word_complete_f
zstyle ':completion:fasd-complete-f:*' menu-select
zle -C fasd-complete-d complete-word _generic
zstyle ':completion:fasd-complete-d:*' completer _fasd_zsh_word_complete_d
zstyle ':completion:fasd-complete-d:*' menu-select
}
(( $+functions[compdef] )) && {
# enable word mode completion
orig_comp="$(zstyle -L ':completion:\*' completer 2>> "/dev/null")"
if [ "$orig_comp" ]; then
case $orig_comp in
*_fasd_zsh_word_complete_trigger*);;
*) eval "$orig_comp _fasd_zsh_word_complete_trigger";;
esac
else
zstyle ':completion:*' completer _complete _fasd_zsh_word_complete_trigger
fi
unset orig_comp
}
#files: 1198 version: 5.7.1
Loaded PZT::modules/fasd
_comps=(
'-' '_precommand'
'-array-value-' '_value'
'-assign-parameter-' '_assign'
'-brace-parameter-' '_brace_parameter'
'-command-' '_autocd'
'-command-line-' '_normal'
'-condition-' '_condition'
'-default-' '_default'
'-equal-' '_equal'
'-first-' '_first'
'-math-' '_math'
'-parameter-' '_parameter'
'-redirect-' '_redirect'
'-redirect-,-default-,-default-' '_files'
'-redirect-,<,bunzip2' '_bzip2'
'-redirect-,<,bzip2' '_bzip2'
'-redirect-,<,compress' '_compress'
'-redirect-,<,gunzip' '_gzip'
'-redirect-,<,gzip' '_gzip'
'-redirect-,<,uncompress' '_compress'
'-redirect-,<,unxz' '_xz'
'-redirect-,<,xz' '_xz'
'-redirect-,>,bzip2' '_bzip2'
'-redirect-,>,compress' '_compress'
'-redirect-,>,gzip' '_gzip'
'-redirect-,>,xz' '_xz'
'-subscript-' '_subscript'
'-tilde-' '_tilde'
'-value-' '_value'
'-value-,-default-,-command-' '_zargs'
'-value-,-default-,-default-' '_value'
'-value-,ADB_TRACE,-default-' '_adb'
'-value-,ANDROID_LOG_TAGS,-default-' '_adb'
'-value-,ANDROID_SERIAL,-default-' '_adb'
'-value-,ANT_ARGS,-default-' '_ant'
'-value-,CFLAGS,-default-' '_gcc'
'-value-,CPPFLAGS,-default-' '_gcc'
'-value-,CXXFLAGS,-default-' '_gcc'
'-value-,DISPLAY,-default-' '_x_display'
'-value-,GREP_OPTIONS,-default-' '_grep'
'-value-,GZIP,-default-' '_gzip'
'-value-,LANG,-default-' '_locales'
'-value-,LANGUAGE,-default-' '_locales'
'-value-,LDFLAGS,-default-' '_gcc'
'-value-,LD_DEBUG,-default-' '_ld_debug'
'-value-,LESS,-default-' '_less'
'-value-,LESSCHARSET,-default-' '_less'
'-value-,LPDEST,-default-' '_printers'
'-value-,MPD_HOST,-default' '_mpc'
'-value-,P4CLIENT,-default-' '_perforce'
'-value-,P4MERGE,-default-' '_perforce'
'-value-,P4PORT,-default-' '_perforce'
'-value-,P4USER,-default-' '_perforce'
'-value-,PERLDOC,-default-' '_perldoc'
'-value-,PRINTER,-default-' '_printers'
'-value-,PROMPT,-default-' '_ps1234'
'-value-,PROMPT2,-default-' '_ps1234'
'-value-,PROMPT3,-default-' '_ps1234'
'-value-,PROMPT4,-default-' '_ps1234'
'-value-,PS1,-default-' '_ps1234'
'-value-,PS2,-default-' '_ps1234'
'-value-,PS3,-default-' '_ps1234'
'-value-,PS4,-default-' '_ps1234'
'-value-,RPROMPT,-default-' '_ps1234'
'-value-,RPROMPT2,-default-' '_ps1234'
'-value-,RPS1,-default-' '_ps1234'
'-value-,RPS2,-default-' '_ps1234'
'-value-,SPROMPT,-default-' '_ps1234'
'-value-,TERM,-default-' '_terminals'
'-value-,TERMINFO_DIRS,-default-' '_dir_list'
'-value-,TZ,-default-' '_time_zone'
'-value-,VALGRIND_OPTS,-default-' '_valgrind'
'-value-,WWW_HOME,-default-' '_urls'
'-value-,XML_CATALOG_FILES,-default-' '_xmlsoft'
'-value-,XZ_DEFAULTS,-default-' '_xz'
'-value-,XZ_OPT,-default-' '_xz'
'-vared-' '_in_vared'
'-zcalc-line-' '_zcalc_line'
'.' '_source'
'5g' '_go'
'5l' '_go'
'6g' '_go'
'6l' '_go'
'8g' '_go'
'8l' '_go'
'Mail' '_mail'
'Mosaic' '_webbrowser'
'SuSEconfig' '_SUSEconfig'
'VBoxHeadless' '_virtualbox'
'VBoxManage' '_virtualbox'
'a2dismod' '_a2utils'
'a2dissite' '_a2utils'
'a2enmod' '_a2utils'
'a2ensite' '_a2utils'
'a2ps' '_a2ps'
'aaaa' '_hosts'
'aap' '_aap'
'ack' '_ack'
'ack-grep' '_ack'
'ack-standalone' '_ack'
'ack2' '_ack'
'acpi' '_acpi'
'acpitool' '_acpitool'
'acroread' '_acroread'
'adb' '_adb'
'add-zle-hook-widget' '_add-zle-hook-widget'
'add-zsh-hook' '_add-zsh-hook'
'admin' '_sccs'
'afew' '_afew'
'ag' '_the_silver_searcher'
'ali' '_mh'
'alias' '_alias'
'amaya' '_webbrowser'
'analyseplugin' '_analyseplugin'
'android' '_android'
'animate' '_imagemagick'
'anno' '_mh'
'ansible' '_ansible'
'ansible-config' '_ansible'
'ansible-console' '_ansible'
'ansible-doc' '_ansible'
'ansible-galaxy' '_ansible'
'ansible-inventory' '_ansible'
'ansible-playbook' '_ansible'
'ansible-pull' '_ansible'
'ansible-vault' '_ansible'
'ant' '_ant'
'antiword' '_antiword'
'aodh' '_openstack'
'aoss' '_precommand'
'apache2ctl' '_apachectl'
'apachectl' '_apachectl'
'apm' '_apm'
'appletviewer' '_java'
'apropos' '_man'
'apt' '_apt'
'apt-cache' '_apt'
'apt-cdrom' '_apt'
'apt-config' '_apt'
'apt-file' '_apt-file'
'apt-get' '_apt'
'apt-mark' '_apt'
'apt-move' '_apt-move'
'apt-show-versions' '_apt-show-versions'
'aptitude' '_aptitude'
'apvlv' '_pdf'
'archlinux-java' '_archlinux-java'
'arena' '_webbrowser'
'arp' '_arp'
'arping' '_arping'
'artisan' '_artisan'
'asciidoctor' '_asciidoctor'
'asciinema' '_asciinema'
'ash' '_sh'
'at' '_at'
'atach' '_atach'
'atq' '_at'
'atrm' '_at'
'attr' '_attr'
'augtool' '_augeas'
'auto-apt' '_auto-apt'
'autoload' '_typeset'
'awk' '_awk'
'axi-cache' '_axi-cache'
'b2sum' '_md5sum'
'barbican' '_openstack'
'base32' '_base64'
'base64' '_base64'
'basename' '_basename'
'bash' '_bash'
'batch' '_at'
'baz' '_baz'
'beadm' '_beadm'
'beep' '_beep'
'bg' '_jobs_bg'
'bibtex' '_bibtex'
'bindkey' '_bindkey'
'bison' '_bison'
'bitcoin-cli' '_bitcoin-cli'
'bmake' '_make'
'bogofilter' '_bogofilter'
'bogotune' '_bogofilter'
'bogoutil' '_bogofilter'
'bower' '_bower'
'bpython' '_bpython'
'bpython-gtk' '_bpython'
'bpython-urwid' '_bpython'
'bpython2' '_bpython'
'bpython2-gtk' '_bpython'
'bpython2-urwid' '_bpython'
'bpython3' '_bpython'
'bpython3-gtk' '_bpython'
'bpython3-urwid' '_bpython'
'brctl' '_brctl'
'brew' '_brew'
'brew-cask' '_brew_cask'
'bsdconfig' '_bsdconfig'
'bsdgrep' '_grep'
'bsdinstall' '_bsdinstall'
'bsdtar' '_tar'
'btdownloadcurses' '_bittorrent'
'btdownloadgui' '_bittorrent'
'btdownloadheadless' '_bittorrent'
'btlaunchmany' '_bittorrent'
'btlaunchmanycurses' '_bittorrent'
'btmakemetafile' '_bittorrent'
'btreannounce' '_bittorrent'
'btrename' '_bittorrent'
'btrfs' '_btrfs'
'bts' '_bts'
'btshowmetainfo' '_bittorrent'
'bttrack' '_bittorrent'
'bug' '_bug'
'buildhash' '_ispell'
'builtin' '_builtin'
'bundle' '_bundle'
'bunzip2' '_bzip2'
'burst' '_mh'
'bzcat' '_bzip2'
'bzegrep' '_grep'
'bzfgrep' '_grep'
'bzgrep' '_grep'
'bzip2' '_bzip2'
'bzip2recover' '_bzip2'
'bzr' '_bzr'
'c++' '_gcc'
'cabal' '_cabal'
'caffeinate' '_caffeinate'
'cal' '_cal'
'calendar' '_calendar'
'cap' '_cap'
'cask' '_cask'
'cat' '_cat'
'catchsegv' '_precommand'
'cc' '_gcc'
'ccache' '_ccache'
'ccal' '_ccal'
'cd' '_cd'
'cdbs-edit-patch' '_cdbs-edit-patch'
'cdc' '_sccs'
'cdcd' '_cdcd'
'cdls' '_cdls_popdls_pushdls'
'cdr' '_cdr'
'cdrdao' '_cdrdao'
'cdrecord' '_cdrecord'
'ceilometer' '_openstack'
'certtool' '_gnutls'
'cf' '_cf'
'cftp' '_twisted'
'chage' '_users'
'chattr' '_chattr'
'chdir' '_cd'
'cheat' '_cheat'
'chflags' '_chflags'
'chfn' '_users'
'chgrp' '_chown'
'chimera' '_webbrowser'
'chkconfig' '_chkconfig'
'chmod' '_chmod'
'choc' '_choc'
'chown' '_chown'
'chpass' '_chsh'
'chromium' '_chromium'
'chroot' '_chroot'
'chrt' '_chrt'
'chsh' '_chsh'
'ci' '_rcs'
'cifsiostat' '_sysstat'
'cinder' '_openstack'
'ckeygen' '_twisted'
'cksum' '_cksum'
'clang' '_gcc'
'clang++' '_gcc'
'clay' '_clay'
'clear' '_nothing'
'cloudkitty' '_openstack'
'cmake' '_cmake'
'cmp' '_cmp'
'co' '_rcs'
'code' '_code'
'coffee' '_coffee'
'column' '_column'
'comb' '_sccs'
'combine' '_imagemagick'
'combinediff' '_patchutils'
'comm' '_comm'
'command' '_command'
'comp' '_mh'
'compadd' '_compadd'
'compdef' '_compdef'
'composer' '_composer'
'composite' '_imagemagick'
'compress' '_compress'
'conan' '_conan'
'conch' '_twisted'
'config.status' '_configure'
'configure' '_configure'
'console' '_console'
'convert' '_imagemagick'
'coreadm' '_coreadm'
'cowsay' '_cowsay'
'cowthink' '_cowsay'
'cp' '_cp'
'cpio' '_cpio'
'cplay' '_cplay'
'cpupower' '_cpupower'
'createdb' '_pgsql_utils'
'createuser' '_pgsql_utils'
'crontab' '_crontab'
'crsh' '_cssh'
'cryptsetup' '_cryptsetup'
'cscope' '_cscope'
'csh' '_sh'
'cssh' '_cssh'
'csup' '_csup'
'cu' '_cu'
'curl' '_curl'
'cut' '_cut'
'cvs' '_cvs'
'cvsup' '_cvsup'
'cygcheck' '_cygcheck'
'cygcheck.exe' '_cygcheck'
'cygpath' '_cygpath'
'cygpath.exe' '_cygpath'
'cygrunsrv' '_cygrunsrv'
'cygrunsrv.exe' '_cygrunsrv'
'cygserver' '_cygserver'
'cygserver.exe' '_cygserver'
'cygstart' '_cygstart'
'cygstart.exe' '_cygstart'
'dad' '_dad'
'dak' '_dak'
'darcs' '_darcs'
'dash' '_sh'
'date' '_date'
'dbus-monitor' '_dbus'
'dbus-send' '_dbus'
'dch' '_debchange'
'dchroot' '_dchroot'
'dchroot-dsa' '_dchroot-dsa'
'dconf' '_dconf'
'dcop' '_dcop'
'dcopclient' '_dcop'
'dcopfind' '_dcop'
'dcopobject' '_dcop'
'dcopref' '_dcop'
'dcopstart' '_dcop'
'dcut' '_dcut'
'dd' '_dd'
'debchange' '_debchange'
'debcheckout' '_debcheckout'
'debdiff' '_debdiff'
'debfoster' '_debfoster'
'deborphan' '_deborphan'
'debsign' '_debsign'
'debuild' '_debuild'
'declare' '_typeset'
'defaults' '_defaults'
'delta' '_sccs'
'designate' '_openstack'
'devtodo' '_devtodo'
'df' '_df'
'dget' '_dget'
'dhclient' '_dhclient'
'dhclient3' '_dhclient'
'dhcpcd' '_dhcpcd'
'dhcpinfo' '_dhcpinfo'
'diana' '_diana'
'dict' '_dict'
'diff' '_diff'
'diff3' '_diff3'
'diffstat' '_diffstat'
'dig' '_dig'
'dillo' '_webbrowser'
'dircmp' '_directories'
'dirs' '_dirs'
'disable' '_disable'
'disown' '_jobs_fg'
'display' '_imagemagick'
'dist' '_mh'
'django-admin' '_django'
'django-admin.py' '_django'
'dkms' '_dkms'
'dladm' '_dladm'
'dlocate' '_dlocate'
'dmake' '_make'
'dmesg' '_dmesg'
'dmidecode' '_dmidecode'
'dnf' '_dnf'
'dnf-2' '_dnf'
'dnf-3' '_dnf'
'doas' '_doas'
'docker' '_docker'
'dockerd' '_docker'
'docpad' '_docpad'
'domainname' '_yp'
'dos2unix' '_dos2unix'
'dosdel' '_floppy'
'dosread' '_floppy'
'dpatch-edit-patch' '_dpatch-edit-patch'
'dpkg' '_dpkg'
'dpkg-buildpackage' '_dpkg-buildpackage'
'dpkg-cross' '_dpkg-cross'
'dpkg-deb' '_dpkg'
'dpkg-query' '_dpkg'
'dpkg-reconfigure' '_dpkg'
'dpkg-repack' '_dpkg-repack'
'dpkg-source' '_dpkg_source'
'dput' '_dput'
'drill' '_drill'
'dropdb' '_pgsql_utils'
'dropuser' '_pgsql_utils'
'drush' '_drush'
'dsh' '_dsh'
'dtrace' '_dtrace'
'dtruss' '_dtruss'
'du' '_du'
'dumpadm' '_dumpadm'
'dumper' '_dumper'
'dumper.exe' '_dumper'
'dupload' '_dupload'
'dut' '_dut'
'dvibook' '_dvi'
'dviconcat' '_dvi'
'dvicopy' '_dvi'
'dvidvi' '_dvi'
'dvipdf' '_dvi'
'dvips' '_dvi'
'dviselect' '_dvi'
'dvitodvi' '_dvi'
'dvitype' '_dvi'
'dwb' '_webbrowser'
'e2label' '_e2label'
'eatmydata' '_precommand'
'ecasound' '_ecasound'
'ecdsautil' '_ecdsautil'
'echotc' '_echotc'
'echoti' '_echoti'
'ed' '_ed'
'egrep' '_grep'
'elfdump' '_elfdump'
'elinks' '_elinks'
'elm' '_elm'
'emulate' '_emulate'
'emulator' '_emulator'
'enable' '_enable'
'enscript' '_enscript'
'entr' '_entr'
'env' '_env'
'envdir' '_envdir'
'eog' '_eog'
'epdfview' '_pdf'
'epsffit' '_psutils'
'erb' '_ruby'
'espeak' '_espeak'
'etags' '_etags'
'ethtool' '_ethtool'
'eu-nm' '_nm'
'eu-objdump' '_objdump'
'eu-readelf' '_readelf'
'eu-strings' '_strings'
'eval' '_precommand'
'eview' '_vim'
'evim' '_vim'
'evince' '_evince'
'exec' '_exec'
'expand' '_unexpand'
'explodepkg' '_pkgtool'
'export' '_typeset'
'exportfs' '_exportfs'
'express' '_webbrowser'
'extcheck' '_java'
'extractres' '_psutils'
'fab' '_fab'
'fakeroot' '_fakeroot'
'false' '_nothing'
'fast-theme' '_fast-theme'
'fc' '_fc'
'fc-list' '_xft_fonts'
'fc-match' '_xft_fonts'
'fd' '_fd'
'feh' '_feh'
'fetch' '_fetch'
'fetchmail' '_fetchmail'
'ffind' '_ffind'
'ffmpeg' '_ffmpeg'
'fg' '_jobs_fg'
'fgrep' '_grep'
'figlet' '_figlet'
'filterdiff' '_patchutils'
'find' '_find'
'findaffix' '_ispell'
'finger' '_finger'
'fink' '_fink'
'firefox' '_mozilla'
'fixdlsrps' '_psutils'
'fixfmps' '_psutils'
'fixmacps' '_psutils'
'fixpsditps' '_psutils'
'fixpspps' '_psutils'
'fixscribeps' '_psutils'
'fixtpps' '_psutils'
'fixwfwps' '_psutils'
'fixwpps' '_psutils'
'fixwwps' '_psutils'
'flac' '_flac'
'flasher' '_flasher'
'fleetctl' '_fleetctl'
'flex' '_flex'
'flex++' '_flex'
'flipdiff' '_patchutils'
'flist' '_mh'
'flists' '_mh'
'float' '_typeset'
'flowadm' '_flowadm'
'flutter' '_flutter'
'fmadm' '_fmadm'
'fmt' '_fmt'
'fmttest' '_mh'
'fned' '_zed'
'fnext' '_mh'
'fold' '_fold'
'folder' '_mh'
'folders' '_mh'
'force' '_force'
'fortune' '_fortune'
'forw' '_mh'
'fprev' '_mh'
'freebsd-make' '_make'
'freebsd-update' '_freebsd-update'
'freezer' '_openstack'
'fs_usage' '_fs_usage'
'fsh' '_fsh'
'fstat' '_fstat'
'ftp' '_hosts'
'functions' '_typeset'
'fuser' '_fuser'
'fusermount' '_fusermount'
'fw_update' '_fw_update'
'fwhois' '_whois'
'g++' '_gcc'
'galeon' '_webbrowser'
'gas' '_gas'
'gawk' '_awk'
'gb2sum' '_md5sum'
'gbase32' '_base64'
'gbase64' '_base64'
'gbasename' '_basename'
'gcat' '_cat'
'gcc' '_gcc'
'gccgo' '_go'
'gchgrp' '_chown'
'gchmod' '_chmod'
'gchown' '_chown'
'gchroot' '_chroot'
'gcksum' '_cksum'
'gcmp' '_cmp'
'gcomm' '_comm'
'gcore' '_gcore'
'gcp' '_cp'
'gcut' '_cut'
'gdate' '_date'
'gdb' '_gdb'
'gdd' '_dd'
'gdf' '_df'
'gdiff' '_diff'
'gdu' '_du'
'geany' '_geany'
'gegrep' '_grep'
'gem' '_gem'
'genisoimage' '_genisoimage'
'genv' '_env'
'get' '_sccs'
'getafm' '_psutils'
'getclip' '_getclip'
'getclip.exe' '_getclip'
'getconf' '_getconf'
'getent' '_getent'
'getfacl' '_getfacl'
'getfacl.exe' '_getfacl'
'getfattr' '_attr'
'getmail' '_getmail'
'getopt' '_getopt'
'getopts' '_vars'
'gex' '_vim'
'gexpand' '_unexpand'
'gfgrep' '_grep'
'gfind' '_find'
'gfmt' '_fmt'
'gfold' '_fold'
'ggetopt' '_getopt'
'ggrep' '_grep'
'ggv' '_gnome-gv'
'ghc' '_ghc'
'ghc-pkg' '_ghc'
'ghci' '_ghc'
'ghead' '_head'
'ghostscript' '_ghostscript'
'ghostview' '_pspdf'
'gid' '_id'
'ginstall' '_install'
'gist' '_gist'
'git' '_git'
'git-buildpackage' '_git-buildpackage'
'git-cvsserver' '_git'
'git-flow' '_git-flow'
'git-hub-browse' '_git-hub-browse'
'git-hub-shorten-url' '_git-hub-shorten-url'
'git-info' '_git-info'
'git-journal' '_git-journal'
'git-pulls' '_git-pulls'
'git-receive-pack' '_git'
'git-shell' '_git'
'git-submodule-move' '_git-submodule-move'
'git-submodule-remove' '_git-submodule-remove'
'git-upload-archive' '_git'
'git-upload-pack' '_git'
'git-wtf' '_git-wtf'
'gitk' '_git'
'gjoin' '_join'
'glance' '_openstack'
'glances' '_glances'
'gln' '_ln'
'global' '_global'
'glocate' '_locate'
'gls' '_ls'
'gm' '_graphicsmagick'
'gmake' '_make'
'gmd5sum' '_md5sum'
'gmkdir' '_mkdir'
'gmkfifo' '_mkfifo'
'gmknod' '_mknod'
'gmktemp' '_mktemp'
'gmplayer' '_mplayer'
'gmv' '_mv'
'gnl' '_nl'
'gnocchi' '_openstack'
'gnome-gv' '_gnome-gv'
'gnumfmt' '_numfmt'
'gnupod_INIT' '_gnupod'
'gnupod_INIT.pl' '_gnupod'
'gnupod_addsong' '_gnupod'
'gnupod_addsong.pl' '_gnupod'
'gnupod_check' '_gnupod'
'gnupod_check.pl' '_gnupod'
'gnupod_search' '_gnupod'
'gnupod_search.pl' '_gnupod'
'gnutls-cli' '_gnutls'
'gnutls-cli-debug' '_gnutls'
'gnutls-serv' '_gnutls'
'go' '_golang'
'god' '_od'
'gofmt' '_go'
'google' '_google'
'gpasswd' '_gpasswd'
'gpaste' '_paste'
'gpatch' '_patch'
'gpg' '_gpg'
'gpg-zip' '_gpg'
'gpg2' '_gpg'
'gpgv' '_gpg'
'gphoto2' '_gphoto2'
'gprintenv' '_printenv'
'gprof' '_gprof'
'gqview' '_gqview'
'gradle' '_gradle'
'gradlew' '_gradle'
'grail' '_webbrowser'
'greadlink' '_readlink'
'grep' '_grep'
'grep-excuses' '_grep-excuses'
'grepdiff' '_patchutils'
'grm' '_rm'
'grmdir' '_rmdir'
'groff' '_groff'
'groupadd' '_user_admin'
'groupdel' '_groups'
'groupmod' '_user_admin'
'groups' '_users'
'growisofs' '_growisofs'
'gs' '_ghostscript'
'gsbj' '_pspdf'
'gsdj' '_pspdf'
'gsdj500' '_pspdf'
'gsed' '_sed'
'gseq' '_seq'
'gsettings' '_gsettings'
'gsha1sum' '_md5sum'
'gsha224sum' '_md5sum'
'gsha256sum' '_md5sum'
'gsha384sum' '_md5sum'
'gsha512sum' '_md5sum'
'gshred' '_shred'
'gshuf' '_shuf'
'gslj' '_pspdf'
'gslp' '_pspdf'
'gsnd' '_pspdf'
'gsort' '_sort'
'gsplit' '_split'
'gstat' '_gstat'
'gstdbuf' '_stdbuf'
'gstrings' '_strings'
'gstty' '_stty'
'gsum' '_cksum'
'gtac' '_tac'
'gtail' '_tail'
'gtar' '_tar'
'gtee' '_tee'
'gtimeout' '_timeout'
'gtk-launch' '_gtk-launch'
'gtouch' '_touch'
'gtr' '_tr'
'gtty' '_tty'
'guilt' '_guilt'
'guilt-add' '_guilt'
'guilt-applied' '_guilt'
'guilt-delete' '_guilt'
'guilt-files' '_guilt'
'guilt-fold' '_guilt'
'guilt-fork' '_guilt'
'guilt-header' '_guilt'
'guilt-help' '_guilt'
'guilt-import' '_guilt'
'guilt-import-commit' '_guilt'
'guilt-init' '_guilt'
'guilt-new' '_guilt'
'guilt-next' '_guilt'
'guilt-patchbomb' '_guilt'
'guilt-pop' '_guilt'
'guilt-prev' '_guilt'
'guilt-push' '_guilt'
'guilt-rebase' '_guilt'
'guilt-refresh' '_guilt'
'guilt-rm' '_guilt'
'guilt-series' '_guilt'
'guilt-status' '_guilt'
'guilt-top' '_guilt'
'guilt-unapplied' '_guilt'
'guname' '_uname'
'gunexpand' '_unexpand'
'guniq' '_uniq'
'gunzip' '_gzip'
'guptime' '_uptime'
'gv' '_gv'
'gview' '_vim'
'gvim' '_vim'
'gvimdiff' '_vim'
'gwc' '_wc'
'gwho' '_who'
'gxargs' '_xargs'
'gzcat' '_gzip'
'gzegrep' '_grep'
'gzfgrep' '_grep'
'gzgrep' '_grep'
'gzilla' '_webbrowser'
'gzip' '_gzip'
'hash' '_hash'
'hd' '_hexdump'
'hdiutil' '_hdiutil'
'head' '_head'
'heat' '_openstack'
'help' '_sccs'
'hexdump' '_hexdump'
'hg' '_hg'
'hilite' '_precommand'
'history' '_fc'
'hledger' '_hledger'
'homestead' '_homestead'
'host' '_host'
'hostname' '_hostname'
'hotjava' '_webbrowser'
'htop' '_htop'
'http' '_httpie'
'hwinfo' '_hwinfo'
'ibus' '_ibus'
'iceweasel' '_mozilla'
'icombine' '_ispell'
'iconv' '_iconv'
'iconvconfig' '_iconvconfig'
'id' '_id'
'identify' '_imagemagick'
'ifconfig' '_ifconfig'
'ifdown' '_net_interfaces'
'iftop' '_iftop'
'ifup' '_net_interfaces'
'ijoin' '_ispell'
'import' '_imagemagick'
'inc' '_mh'
'include-what-you-use' '_include-what-you-use'
'includeres' '_psutils'
'inetadm' '_inetadm'
'info' '_texinfo'
'infocmp' '_terminals'
'initctl' '_initctl'
'initdb' '_pgsql_utils'
'insmod' '_modutils'
'install' '_install'
'install-info' '_texinfo'
'installpkg' '_pkgtool'
'integer' '_typeset'
'interdiff' '_patchutils'
'invoke-rc.d' '_invoke-rc.d'
'ionice' '_ionice'
'iostat' '_iostat'
'ip' '_ip'
'ip6tables' '_iptables'
'ip6tables-restore' '_iptables'
'ip6tables-save' '_iptables'
'ipadm' '_ipadm'
'ipkg' '_opkg'
'ipsec' '_ipsec'
'ipset' '_ipset'
'iptables' '_iptables'
'iptables-restore' '_iptables'
'iptables-save' '_iptables'
'irb' '_ruby'
'ironic' '_openstack'
'irssi' '_irssi'
'isag' '_sysstat'
'ispell' '_ispell'
'iwconfig' '_iwconfig'
'jadetex' '_tex'
'jail' '_jail'
'jar' '_java'
'jarsigner' '_java'
'java' '_java'
'javac' '_java'
'javadoc' '_java'
'javah' '_java'
'javap' '_java'
'jdb' '_java'
'jexec' '_jexec'
'jls' '_jls'
'jmeter' '_jmeter'
'jmeter-plugins' '_jmeter-plugins'
'jobs' '_jobs_builtin'
'joe' '_joe'
'join' '_join'
'jonas' '_jonas'
'jot' '_jot'
'jq' '_jq'
'jrnl' '_jrnl'
'kak' '_kak'
'kdeconnect-cli' '_kdeconnect'
'keystone' '_openstack'
'keytool' '_java'
'kfmclient' '_kfmclient'
'kill' '_kill'
'killall' '_killall'
'killall5' '_killall'
'kioclient' '_kfmclient'
'kitchen' '_kitchen'
'kldload' '_kld'
'kldunload' '_kld'
'knife' '_knife'
'knock' '_knock'
'konqueror' '_webbrowser'
'kpartx' '_kpartx'
'kpdf' '_pdf'
'ksh' '_sh'
'ksh88' '_sh'
'ksh93' '_sh'
'kvno' '_kvno'
'last' '_last'
'lastb' '_last'
'latex' '_tex'
'latexmk' '_tex'
'ldap' '_ldap'
'ldconfig' '_ldconfig'
'ldconfig.real' '_ldconfig'
'ldd' '_ldd'
'less' '_less'
'let' '_math'
'lftp' '_ncftp'
'lha' '_lha'
'light' '_webbrowser'
'lighty-disable-mod' '_lighttpd'
'lighty-enable-mod' '_lighttpd'
'limit' '_limit'
'links' '_links'
'links2' '_links'
'lintian' '_lintian'
'lintian-info' '_lintian'
'linux' '_uml'
'lldb' '_lldb'
'llvm-g++' '_gcc'
'llvm-gcc' '_gcc'
'llvm-objdump' '_objdump'
'llvm-otool' '_otool'
'ln' '_ln'
'loadkeys' '_loadkeys'
'local' '_typeset'
'locale' '_locale'
'localedef' '_localedef'
'locate' '_locate'
'log' '_nothing'
'logname' '_nothing'
'look' '_look'
'lp' '_lp'
'lpadmin' '_lp'
'lpinfo' '_lp'
'lpoptions' '_lp'
'lpq' '_lp'
'lpr' '_lp'
'lprm' '_lp'
'lpstat' '_lp'
'ls' '_ls'
'lsattr' '_lsattr'
'lsblk' '_lsblk'
'lscfg' '_lscfg'
'lsdev' '_lsdev'
'lsdiff' '_patchutils'
'lslv' '_lslv'
'lsmod' '_modutils'
'lsof' '_lsof'
'lspv' '_lspv'
'lsusb' '_lsusb'
'lsvg' '_lsvg'
'ltrace' '_ltrace'
'lua' '_lua'
'luarocks' '_luarocks'
'lunchy' '_lunchy'
'lynx' '_lynx'
'lz4' '_lz4'
'lz4c' '_lz4'
'lz4c32' '_lz4'
'lz4cat' '_lz4'
'lzcat' '_xz'
'lzma' '_xz'
'lzop' '_lzop'
'm-a' '_module-assistant'
'mac2unix' '_dos2unix'
'madison' '_madison'
'magnum' '_openstack'
'mail' '_mail'
'mailx' '_mail'
'make' '_make'
'make-kpkg' '_make-kpkg'
'makeinfo' '_texinfo'
'makepkg' '_pkgtool'
'man' '_man'
'manage.py' '_django'
'mand' '_mand_manp'
'manila' '_openstack'
'manp' '_mand_manp'
'mark' '_mh'
'matlab' '_matlab'
'mattrib' '_mtools'
'mcd' '_mtools'
'mcopy' '_mtools'
'md2' '_cksum'
'md4' '_cksum'
'md5' '_cksum'
'md5sum' '_md5sum'
'mdadm' '_mdadm'
'mdel' '_mtools'
'mdeltree' '_mtools'
'mdfind' '_mdfind'
'mdir' '_mtools'
'mdls' '_mdls'
'mdu' '_mtools'
'mdutil' '_mdutil'
'members' '_members'
'mencal' '_mencal'
'mere' '_mere'
'merge' '_rcs'
'mergechanges' '_mergechanges'
'metaflac' '_flac'
'mformat' '_mtools'
'mgv' '_pspdf'
'mhfixmsg' '_mh'
'mhlist' '_mh'
'mhmail' '_mh'
'mhn' '_mh'
'mhparam' '_mh'
'mhpath' '_mh'
'mhshow' '_mh'
'mhstore' '_mh'
'middleman' '_middleman'
'mii-tool' '_mii-tool'
'mina' '_mina'
'mistral' '_openstack'
'mix' '_mix'
'mixerctl' '_mixerctl'
'mkdcd' '_mkdcd'
'mkdir' '_mkdir'
'mkfifo' '_mkfifo'
'mkisofs' '_growisofs'
'mknod' '_mknod'
'mksh' '_sh'
'mkshortcut' '_mkshortcut'
'mkshortcut.exe' '_mkshortcut'
'mktemp' '_mktemp'
'mktunes' '_gnupod'
'mktunes.pl' '_gnupod'
'mkzsh' '_mkzsh'
'mkzsh.exe' '_mkzsh'
'mlabel' '_mtools'
'mlocate' '_locate'
'mmd' '_mtools'
'mmm' '_webbrowser'
'mmount' '_mtools'
'mmove' '_mtools'
'modinfo' '_modutils'
'modprobe' '_modutils'
'module' '_module'
'module-assistant' '_module-assistant'
'mogrify' '_imagemagick'
'monasca' '_openstack'
'mondoarchive' '_mondo'
'montage' '_imagemagick'
'moosic' '_moosic'
'mosh' '_mosh'
'mount' '_mount'
'mozilla' '_mozilla'
'mozilla-firefox' '_mozilla'
'mozilla-xremote-client' '_mozilla'
'mpc' '_mpc'
'mplayer' '_mplayer'
'mpstat' '_sysstat'
'mrd' '_mtools'
'mread' '_mtools'
'mren' '_mtools'
'msgchk' '_mh'
'mt' '_mt'
'mtn' '_monotone'
'mtoolstest' '_mtools'
'mtr' '_mtr'
'mtype' '_mtools'
'multirust' '_multirust'
'munchlist' '_ispell'
'mupdf' '_mupdf'
'murano' '_openstack'
'mush' '_mail'
'mussh' '_mussh'
'mutt' '_mutt'
'mux' '_tmuxinator'
'mv' '_mv'
'mvim' '_vim'
'mvn' '_mvn'
'mvnDebug' '_mvn'
'mx' '_hosts'
'mysql' '_mysql_utils'
'mysqladmin' '_mysql_utils'
'mysqldiff' '_mysqldiff'
'mysqldump' '_mysql_utils'
'mysqlimport' '_mysql_utils'
'mysqlshow' '_mysql_utils'
'nail' '_mail'
'native2ascii' '_java'
'nautilus' '_nautilus'
'nawk' '_awk'
'nc' '_netcat'
'ncal' '_cal'
'ncftp' '_ncftp'
'ncl' '_nedit'
'nedit' '_nedit'
'nedit-nc' '_nedit'
'netcat' '_netcat'
'netrik' '_webbrowser'
'netscape' '_netscape'
'netstat' '_netstat'
'networksetup' '_networksetup'
'neutron' '_openstack'
'new' '_mh'
'newgrp' '_groups'
'next' '_mh'
'nft' '_nftables'
'nginx' '_nginx'
'ngrep' '_ngrep'
'nice' '_nice'
'nkf' '_nkf'
'nl' '_nl'
'nm' '_nm'
'nmap' '_nmap'
'nmblookup' '_samba'
'nmcli' '_networkmanager'
'nnn' '_nnn'
'nocorrect' '_precommand'
'node' '_node'
'noglob' '_precommand'
'nohup' '_precommand'
'noremoteglob' '_noremoteglob'
'notmuch' '_notmuch'
'nova' '_openstack'
'npm' '_npm'
'ns' '_hosts'
'nslookup' '_nslookup'
'ntalk' '_other_accounts'
'numfmt' '_numfmt'
'nvim' '_vim'
'nvm' '_nvm'
'nvram' '_nvram'
'objdump' '_objdump'
'od' '_od'
'odme' '_object_classes'
'odmget' '_object_classes'
'odmshow' '_object_classes'
'ogg123' '_vorbis'
'oggdec' '_vorbis'
'oggenc' '_vorbis'
'ogginfo' '_vorbis'
'oksh' '_sh'
'okular' '_okular'
'open' '_open'
'openssl' '_openssl'
'openstack' '_openstack'
'opera' '_webbrowser'
'opera-next' '_webbrowser'
'opkg' '_opkg'
'optirun' '_optirun'
'osascript' '_osascript'
'osc' '_osc'
'otool' '_otool'
'p4' '_perforce'
'p4d' '_perforce'
'pack' '_pack'
'packf' '_mh'
'parsehdlist' '_urpmi'
'passwd' '_users'
'paste' '_paste'
'patch' '_patch'
'patool' '_patool'
'pax' '_pax'
'pbcopy' '_pbcopy'
'pbpaste' '_pbcopy'
'pbuilder' '_pbuilder'
'pcat' '_pack'
'pcred' '_pids'
'pdf2dsc' '_pdf'
'pdf2ps' '_pdf'
'pdffonts' '_pdf'
'pdfimages' '_pdf'
'pdfinfo' '_pdf'
'pdfjadetex' '_tex'
'pdflatex' '_tex'
'pdfopt' '_pdf'
'pdftex' '_tex'
'pdftexi2dvi' '_texinfo'
'pdftk' '_pdftk'
'pdftopbm' '_pdf'
'pdftops' '_pdf'
'pdftotext' '_pdf'
'pdksh' '_sh'
'perf' '_perf'
'periscope' '_periscope'
'perl' '_perl'
'perldoc' '_perldoc'
'pfctl' '_pfctl'
'pfexec' '_pfexec'
'pfiles' '_pids'
'pflags' '_pids'
'pg_dump' '_pgsql_utils'
'pg_dumpall' '_pgsql_utils'
'pg_restore' '_pgsql_utils'
'pgrep' '_pgrep'
'phing' '_phing'
'php' '_php'
'pick' '_mh'
'picocom' '_picocom'
'pidof' '_pidof'
'pidstat' '_sysstat'
'pigz' '_gzip'
'pine' '_pine'
'pinef' '_pine'
'pinfo' '_texinfo'
'ping' '_ping'
'ping6' '_ping'
'piuparts' '_piuparts'
'pixz' '_pixz'
'pkcon' '_pkcon'
'pkg' '_pkg5'
'pkg-config' '_pkg-config'
'pkg_add' '_bsd_pkg'
'pkg_create' '_bsd_pkg'
'pkg_delete' '_bsd_pkg'
'pkg_info' '_bsd_pkg'
'pkgadd' '_pkgadd'
'pkginfo' '_pkginfo'
'pkgrm' '_pkgrm'
'pkgtool' '_pkgtool'
'pkill' '_pgrep'
'play' '_play'
'pldd' '_pids'
'plutil' '_plutil'
'pmake' '_make'
'pman' '_perl_modules'
'pmap' '_pids'
'pmcat' '_perl_modules'
'pmdesc' '_perl_modules'
'pmeth' '_perl_modules'
'pmexp' '_perl_modules'
'pmfunc' '_perl_modules'
'pmload' '_perl_modules'
'pmls' '_perl_modules'
'pmpath' '_perl_modules'
'pmvers' '_perl_modules'
'podgrep' '_perl_modules'
'podpath' '_perl_modules'
'podtoc' '_perl_modules'
'poff' '_pon'
'policytool' '_java'
'pon' '_pon'
'popd' '_directory_stack'
'popdls' '_cdls_popdls_pushdls'
'port' '_port'
'portaudit' '_portaudit'
'portlint' '_portlint'
'portmaster' '_portmaster'
'portsnap' '_portsnap'
'postconf' '_postfix'
'postqueue' '_postfix'
'postsuper' '_postfix'
'powerd' '_powerd'
'prcs' '_prcs'
'prep' '_prep'
'prev' '_mh'
'print' '_print'
'printenv' '_printenv'
'printf' '_print'
'procstat' '_procstat'
'prompt' '_prompt'
'prove' '_prove'
'prs' '_sccs'
'prstat' '_prstat'
'prt' '_sccs'
'prun' '_pids'
'ps' '_ps'
'ps2ascii' '_pspdf'
'ps2epsi' '_postscript'
'ps2pdf' '_postscript'
'ps2pdf12' '_postscript'
'ps2pdf13' '_postscript'
'ps2pdf14' '_postscript'
'ps2pdfwr' '_postscript'
'ps2ps' '_postscript'
'psbook' '_psutils'
'pscp' '_pscp'
'pscp.exe' '_pscp'
'psed' '_sed'
'psig' '_pids'
'psmerge' '_psutils'
'psmulti' '_postscript'
'psnup' '_psutils'
'psql' '_pgsql_utils'
'psresize' '_psutils'
'psselect' '_psutils'
'pstack' '_pids'
'pstoedit' '_pspdf'
'pstop' '_pids'
'pstops' '_psutils'
'pstotgif' '_pspdf'
'psub' '_psub'
'pswrap' '_postscript'
'ptree' '_ptree'
'pump' '_pump'
'pushd' '_cd'
'pushdls' '_cdls_popdls_pushdls'
'putclip' '_putclip'
'putclip.exe' '_putclip'
'pwait' '_pids'
'pwdx' '_pids'
'pwgen' '_pwgen'
'pygmentize' '_pygmentize'
'pyhtmlizer' '_twisted'
'qdbus' '_qdbus'
'qiv' '_qiv'
'qtplay' '_qtplay'
'querybts' '_bug'
'quilt' '_quilt'
'r' '_fc'
'raggle' '_raggle'
'rails' '_rails'
'rake' '_rake'
'ralio' '_ralio'
'ranlib' '_ranlib'
'rar' '_rar'
'rc' '_sh'
'rcctl' '_rcctl'
'rcp' '_rlogin'
'rcs' '_rcs'
'rcsdiff' '_rcs'
'rdesktop' '_rdesktop'
'read' '_read'
'readelf' '_readelf'
'readlink' '_readlink'
'readonly' '_typeset'
'readshortcut' '_readshortcut'
'readshortcut.exe' '_readshortcut'
'rebootin' '_rebootin'
'rec' '_redis-cli'
'redis-cli' '_redis-cli'
'refile' '_mh'
'rehash' '_hash'
'reload' '_initctl'
'removepkg' '_pkgtool'
'remsh' '_rlogin'
'renice' '_renice'
'repl' '_mh'
'reportbug' '_bug'
'reprepro' '_reprepro'
'restart' '_initctl'
'retawq' '_webbrowser'
'rfkill' '_rfkill'
'rg' '_rg'
'rgview' '_vim'
'rgvim' '_vim'
'ri' '_ri'
'rkt' '_rkt'
'rlogin' '_rlogin'
'rm' '_rm'
'rmadison' '_madison'
'rmd160' '_cksum'
'rmdel' '_sccs'
'rmdir' '_rmdir'
'rmf' '_mh'
'rmic' '_java'
'rmid' '_java'
'rmiregistry' '_java'
'rmm' '_mh'
'rmmod' '_modutils'
'route' '_route'
'rpm' '_rpm'
'rpmbuild' '_rpmbuild'
'rrdtool' '_rrdtool'
'rsh' '_rlogin'
'rslsync' '_rslsync'
'rspec' '_rspec'
'rsvm' '_rsvm'
'rsync' '_rsync'
'rtin' '_tin'
'rubber' '_rubber'
'rubber-info' '_rubber'
'rubber-pipe' '_rubber'
'rubocop' '_rubocop'
'ruby' '_ruby'
'ruby-mri' '_ruby'
'run-help' '_run-help'
'rup' '_hosts'
'rusage' '_precommand'
'rview' '_vim'
'rvim' '_vim'
'rvm' '_rvm'
'rwho' '_hosts'
'rxvt' '_urxvt'
's2p' '_sed'
'sabcmd' '_sablotron'
'sact' '_sccs'
'sadf' '_sysstat'
'sahara' '_openstack'
'sar' '_sysstat'
'savecore' '_savecore'
'say' '_say'
'sbt' '_sbt'
'sc_usage' '_sc_usage'
'scala' '_scala'
'scalac' '_scala'
'scan' '_mh'
'sccs' '_sccs'
'sccsdiff' '_sccs'
'sched' '_sched'
'schedtool' '_schedtool'
'schroot' '_schroot'
'scl' '_scl'
'scons' '_scons'
'scp' '_ssh'
'screen' '_screen'
'script' '_script'
'scriptreplay' '_script'
'scrub' '_scrub'
'scselect' '_scselect'
'scutil' '_scutil'
'sdd' '_sdd'
'sed' '_sed'
'senlin' '_openstack'
'seq' '_seq'
'serialver' '_java'
'service' '_service'
'set' '_set'
'setcap' '_setcap'
'setfacl' '_setfacl'
'setfacl.exe' '_setfacl'
'setfattr' '_attr'
'setopt' '_setopt'
'setsid' '_setsid'
'setup.py' '_setup.py'
'setxkbmap' '_setxkbmap'
'sfdx' '_sfdx'
'sftp' '_ssh'
'sh' '_sh'
'sha1' '_cksum'
'sha1sum' '_md5sum'
'sha224sum' '_md5sum'
'sha256' '_cksum'
'sha256sum' '_md5sum'
'sha384' '_cksum'
'sha384sum' '_md5sum'
'sha512' '_cksum'
'sha512sum' '_md5sum'
'sha512t256' '_cksum'
'shasum' '_shasum'
'shift' '_arrays'
'show' '_mh'
'showchar' '_psutils'
'showmount' '_showmount'
'showoff' '_showoff'
'shred' '_shred'
'shuf' '_shuf'
'shutdown' '_shutdown'
'signify' '_signify'
'sisu' '_sisu'
'skein1024' '_cksum'
'skein256' '_cksum'
'skein512' '_cksum'
'skipstone' '_webbrowser'
'slitex' '_tex'
'slocate' '_locate'
'slogin' '_ssh'
'slrn' '_slrn'
'smartctl' '_smartmontools'
'smbclient' '_samba'
'smbcontrol' '_samba'
'smbstatus' '_samba'
'smit' '_smit'
'smitty' '_smit'
'snoop' '_snoop'
'soa' '_hosts'
'socket' '_socket'
'sockstat' '_sockstat'
'softwareupdate' '_softwareupdate'
'sort' '_sort'
'sortm' '_mh'
'source' '_source'
'spamassassin' '_spamassassin'
'split' '_split'
'splitdiff' '_patchutils'
'sqlite' '_sqlite'
'sqlite3' '_sqlite'
'sqsh' '_sqsh'
'sr' '_surfraw'
'srm' '_srm'
'srptool' '_gnutls'
'ss' '_ss'
'ssh' '_ssh'
'ssh-add' '_ssh'
'ssh-agent' '_ssh'
'ssh-copy-id' '_ssh'
'ssh-keygen' '_ssh'
'ssh-keyscan' '_ssh'
'sshfs' '_sshfs'
'stack' '_stack'
'star' '_tar'
'start' '_initctl'
'stat' '_stat'
'status' '_initctl'
'stdbuf' '_stdbuf'
'stg' '_stgit'
'stop' '_initctl'
'strace' '_strace'
'strace64' '_strace'
'strftime' '_strftime'
'strings' '_strings'
'strip' '_strip'
'strongswan' '_ipsec'
'stty' '_stty'
'su' '_su'
'subl' '_subl'
'subliminal' '_subliminal'
'sudo' '_sudo'
'sudoedit' '_sudo'
'sum' '_cksum'
'supervisorctl' '_supervisorctl'
'surfraw' '_surfraw'
'sv' '_runit'
'svcadm' '_svcadm'
'svccfg' '_svccfg'
'svcprop' '_svcprop'
'svcs' '_svcs'
'svm' '_svm'
'svn' '_subversion'
'svn-buildpackage' '_svn-buildpackage'
'svnadmin' '_subversion'
'svnadmin-static' '_subversion'
'svnlite' '_subversion'
'sw_vers' '_sw_vers'
'swaks' '_swaks'
'swanctl' '_swanctl'
'swift' '_swift'
'swiftc' '_swift'
'sync' '_nothing'
'sysctl' '_sysctl'
'sysrc' '_sysrc'
'systat' '_systat'
'system_profiler' '_system_profiler'
'tac' '_tac'
'tacker' '_openstack'
'tail' '_tail'
'talk' '_other_accounts'
'tar' '_tar'
'tardy' '_tardy'
'tarsnap' '_tarsnap'
'tcp_open' '_tcpsys'
'tcpdump' '_tcpdump'
'tcptraceroute' '_tcptraceroute'
'tcsh' '_sh'
'tda' '_devtodo'
'tdd' '_devtodo'
'tde' '_devtodo'
'tdr' '_devtodo'
'teamocil' '_teamocil'
'tee' '_tee'
'telnet' '_telnet'
'tex' '_tex'
'texi2any' '_texinfo'
'texi2dvi' '_texinfo'
'texi2pdf' '_texinfo'
'texindex' '_texinfo'
'tg' '_topgit'
'thor' '_thor'
'tidy' '_tidy'
'tig' '_git'
'time' '_precommand'
'timeout' '_timeout'
'times' '_nothing'
'tin' '_tin'
'tkconch' '_twisted'
'tkinfo' '_texinfo'
'tla' '_tla'
'tmux' '_tmux'
'tmuxinator' '_tmuxinator'
'tmuxp' '_tmuxp'
'todo' '_devtodo'
'todo.sh' '_todo.sh'
'toilet' '_toilet'
'top' '_top'
'totdconfig' '_totd'
'touch' '_touch'
'tox' '_tox'
'tpb' '_tpb'
'tpconfig' '_tpconfig'
'tpkg-debarch' '_toolchain-source'
'tpkg-install' '_toolchain-source'
'tpkg-install-libc' '_toolchain-source'
'tpkg-make' '_toolchain-source'
'tpkg-update' '_toolchain-source'
'tput' '_tput'
'tr' '_tr'
'tracepath' '_tracepath'
'tracepath6' '_tracepath'
'traceroute' '_hosts'
'trap' '_trap'
'trash' '_trash-put'
'trash-empty' '_trash-empty'
'trash-list' '_trash-list'
'trash-put' '_trash-put'
'trash-restore' '_trash-restore'
'tree' '_tree'
'trial' '_twisted'
'trove' '_openstack'
'true' '_nothing'
'truss' '_truss'
'tryaffix' '_ispell'
'tty' '_tty'
'ttyctl' '_ttyctl'
'tunctl' '_uml'
'tune2fs' '_tune2fs'
'tunes2pod' '_gnupod'
'tunes2pod.pl' '_gnupod'
'twidge' '_twidge'
'twist' '_twisted'
'twistd' '_twisted'
'txt' '_hosts'
'type' '_which'
'typeset' '_typeset'
'udisksctl' '_udisksctl'
'ufw' '_ufw'
'ulimit' '_ulimit'
'uml_mconsole' '_uml'
'uml_moo' '_uml'
'uml_switch' '_uml'
'umount' '_mount'
'unace' '_unace'
'unalias' '_aliases'
'uname' '_uname'
'uncompress' '_compress'
'unexpand' '_unexpand'
'unfunction' '_functions'
'unget' '_sccs'
'unhash' '_unhash'
'uniq' '_uniq'
'unison' '_unison'
'units' '_units'
'unix2dos' '_dos2unix'
'unix2mac' '_dos2unix'
'unlimit' '_limits'
'unlz4' '_lz4'
'unlzma' '_xz'
'unpack' '_pack'
'unpigz' '_gzip'
'unrar' '_rar'
'unset' '_vars'
'unsetopt' '_setopt'
'unwrapdiff' '_patchutils'
'unxz' '_xz'
'unzip' '_zip'
'update-alternatives' '_update-alternatives'
'update-rc.d' '_update-rc.d'
'upgradepkg' '_pkgtool'
'uptime' '_uptime'
'urpme' '_urpmi'
'urpmf' '_urpmi'
'urpmi' '_urpmi'
'urpmi.addmedia' '_urpmi'
'urpmi.removemedia' '_urpmi'
'urpmi.update' '_urpmi'
'urpmq' '_urpmi'
'urxvt' '_urxvt'
'urxvt256c' '_urxvt'
'urxvt256c-ml' '_urxvt'
'urxvt256c-mlc' '_urxvt'
'urxvt256cc' '_urxvt'
'urxvtc' '_urxvt'
'uscan' '_uscan'
'useradd' '_user_admin'
'userdel' '_users'
'usermod' '_user_admin'
'uzbl' '_uzbl'
'uzbl-browser' '_uzbl'
'uzbl-tabbed' '_uzbl'
'vacuumdb' '_pgsql_utils'
'vagrant' '_vagrant'
'val' '_sccs'
'valgrind' '_valgrind'
'vared' '_vared'
'vcsh' '_vcsh'
'vim' '_vim'
'vim-addons' '_vim-addons'
'vimdiff' '_vim'
'virsh' '_libvirt'
'virt-admin' '_libvirt'
'virt-host-validate' '_libvirt'
'virt-pki-validate' '_libvirt'
'virt-xml-validate' '_libvirt'
'visudo' '_visudo'
'vitrage' '_openstack'
'vmctl' '_vmctl'
'vmstat' '_vmstat'
'vncserver' '_vnc'
'vncviewer' '_vnc'
'vnstat' '_vnstat'
'vorbiscomment' '_vorbis'
'vpnc' '_vpnc'
'vpnc-connect' '_vpnc'
'vserver' '_vserver'
'vux' '_vux'
'vuxctl' '_vux'
'w' '_w'
'w3m' '_w3m'
'wait' '_wait'
'wajig' '_wajig'
'wanna-build' '_wanna-build'
'watch' '_watch'
'watcher' '_openstack'
'wc' '_wc'
'wemux' '_wemux'
'wg-quick' '_wg-quick'
'wget' '_wget'
'what' '_sccs'
'whatis' '_man'
'whence' '_which'
'where' '_which'
'whereis' '_whereis'
'which' '_which'
'who' '_who'
'whoami' '_nothing'
'whois' '_whois'
'whom' '_mh'
'wiggle' '_wiggle'
'wipefs' '_wipefs'
'wodim' '_cdrecord'
'wpa_cli' '_wpa_cli'
'write' '_users_on'
'www' '_webbrowser'
'xargs' '_xargs'
'xattr' '_attr'
'xauth' '_xauth'
'xautolock' '_xautolock'
'xclip' '_xclip'
'xcode-select' '_xcode-select'
'xdpyinfo' '_x_utils'
'xdvi' '_xdvi'
'xelatex' '_tex'
'xetex' '_tex'
'xev' '_x_utils'
'xfd' '_x_utils'
'xfig' '_xfig'
'xfontsel' '_x_utils'
'xfreerdp' '_rdesktop'
'xhost' '_x_utils'
'xinput' '_xinput'
'xkill' '_x_utils'
'xli' '_xloadimage'
'xloadimage' '_xloadimage'
'xlsatoms' '_x_utils'
'xlsclients' '_x_utils'
'xml' '_xmlstarlet'
'xmllint' '_xmlsoft'
'xmlstarlet' '_xmlstarlet'
'xmms2' '_xmms2'
'xmodmap' '_xmodmap'
'xmosaic' '_webbrowser'
'xon' '_x_utils'
'xournal' '_xournal'
'xpdf' '_xpdf'
'xping' '_hosts'
'xprop' '_x_utils'
'xrandr' '_xrandr'
'xrdb' '_x_utils'
'xscreensaver-command' '_xscreensaver'
'xsel' '_xsel'
'xset' '_xset'
'xsetbg' '_xloadimage'
'xsetroot' '_x_utils'
'xsltproc' '_xmlsoft'
'xterm' '_xterm'
'xtightvncviewer' '_vnc'
'xtp' '_imagemagick'
'xv' '_xv'
'xview' '_xloadimage'
'xvnc4viewer' '_vnc'
'xvncviewer' '_vnc'
'xwd' '_x_utils'
'xwininfo' '_x_utils'
'xwit' '_xwit'
'xwud' '_x_utils'
'xxd' '_xxd'
'xz' '_xz'
'xzcat' '_xz'
'yafc' '_yafc'
'yaourt' '_yaourt'
'yaourt.static' '_yaourt'
'yarn' '_yarn'
'yash' '_sh'
'yast' '_yast'
'yast2' '_yast'
'youtube-dl' '_youtube-dl'
'ypbind' '_yp'
'ypcat' '_yp'
'ypmatch' '_yp'
'yppasswd' '_yp'
'yppoll' '_yp'
'yppush' '_yp'
'ypserv' '_yp'
'ypset' '_yp'
'ypwhich' '_yp'
'ypxfr' '_yp'
'ytalk' '_other_accounts'
'yum' '_yum'
'yumdb' '_yum'
'zargs' '_zargs'
'zathura' '_zathura'
'zcalc' '_zcalc'
'zcash-cli' '_zcash-cli'
'zcat' '_zcat'
'zcompile' '_zcompile'
'zcp' '_zmv'
'zdelattr' '_zattr'
'zdump' '_zdump'
'zeal' '_zeal'
'zed' '_zed'
'zegrep' '_grep'
'zen' '_webbrowser'
'zf_chgrp' '_chown'
'zf_chown' '_chown'
'zf_ln' '_ln'
'zf_mkdir' '_mkdir'
'zf_rm' '_rm'
'zf_rmdir' '_directories'
'zfgrep' '_grep'
'zfs' '_zfs'
'zgetattr' '_zattr'
'zgrep' '_grep'
'zip' '_zip'
'zipinfo' '_zip'
'zle' '_zle'
'zlistattr' '_zattr'
'zln' '_zmv'
'zlogin' '_zlogin'
'zmail' '_mail'
'zmodload' '_zmodload'
'zmv' '_zmv'
'zone' '_hosts'
'zoneadm' '_zoneadm'
'zplugin' '_zplugin'
'zpool' '_zpool'
'zpty' '_zpty'
'zsetattr' '_zattr'
'zsh' '_zsh'
'zsh-mime-handler' '_zsh-mime-handler'
'zsocket' '_zsocket'
'zstat' '_stat'
'zstyle' '_zstyle'
'ztodo' '_ztodo'
'zun' '_openstack'
'zxpdf' '_xpdf'
'zypper' '_zypper'
)
_services=(
'-redirect-,<,bunzip2' 'bunzip2'
'-redirect-,<,bzip2' 'bzip2'
'-redirect-,<,compress' 'compress'
'-redirect-,<,gunzip' 'gunzip'
'-redirect-,<,gzip' 'gzip'
'-redirect-,<,uncompress' 'uncompress'
'-redirect-,<,unxz' 'unxz'
'-redirect-,<,xz' 'xz'
'-redirect-,>,bzip2' 'bunzip2'
'-redirect-,>,compress' 'uncompress'
'-redirect-,>,gzip' 'gunzip'
'-redirect-,>,xz' 'unxz'
'Mail' 'mail'
'VBoxHeadless' 'vboxheadless'
'VBoxManage' 'vboxmanage'
'bzcat' 'bunzip2'
'dch' 'debchange'
'gchgrp' 'chgrp'
'gchown' 'chown'
'gnupod_INIT.pl' 'gnupod_INIT'
'gnupod_addsong.pl' 'gnupod_addsong'
'gnupod_check.pl' 'gnupod_check'
'gnupod_search.pl' 'gnupod_search'
'gpg2' 'gpg'
'gzcat' 'gunzip'
'iceweasel' 'firefox'
'lzcat' 'unxz'
'lzma' 'xz'
'mailx' 'mail'
'mktunes.pl' 'mktunes'
'nail' 'mail'
'ncl' 'nc'
'nedit-nc' 'nc'
'pcat' 'unpack'
'remsh' 'rsh'
'slogin' 'ssh'
'svnadmin-static' 'svnadmin'
'svnlite' 'svn'
'tunes2pod.pl' 'tunes2pod'
'unlzma' 'unxz'
'xelatex' 'latex'
'xetex' 'tex'
'xzcat' 'unxz'
'yaourt.static' 'yaourt'
'zf_chgrp' 'chgrp'
'zf_chown' 'chown'
)
_patcomps=(
'*/(init|rc[0-9S]#).d/*' '_init_d'
'zf*' '_zftp'
)
_postpatcomps=(
'(p[bgpn]m*|*top[bgpn]m)' '_pbm'
'(ruby|[ei]rb)[0-9.]#' '_ruby'
'(texi(2*|ndex))' '_texi'
'(tiff*|*2tiff|pal2rgb)' '_tiff'
'*/X11(|R<4->)/*' '_x_arguments'
'-value-,(ftp|http(|s))_proxy,-default-' '_urls'
'-value-,*PATH,-default-' '_dir_list'
'-value-,*path,-default-' '_directories'
'-value-,CCACHE_*,-default-' '_ccache'
'-value-,LC_*,-default-' '_locales'
'-value-,RUBY(LIB|OPT|PATH),-default-' '_ruby'
'c++-*' '_gcc'
'g++-*' '_gcc'
'gcc-*' '_gcc'
'gem[0-9.]#' '_gem'
'lua[0-9.-]##' '_lua'
'php[0-9.-]' '_php'
'pydoc[0-9.]#' '_pydoc'
'python[0-9.]#' '_python'
'qemu(|-system-*)' '_qemu'
'shasum(|5).*' '_shasum'
'yodl(|2*)' '_yodl'
)
_compautos=(
'_call_program' '+X'
)
zle -C _bash_complete-word .complete-word _bash_completions
zle -C _bash_list-choices .list-choices _bash_completions
zle -C _complete_debug .complete-word _complete_debug
zle -C _complete_help .complete-word _complete_help
zle -C _complete_tag .complete-word _complete_tag
zle -C _correct_filename .complete-word _correct_filename
zle -C _correct_word .complete-word _correct_word
zle -C _expand_alias .complete-word _expand_alias
zle -C _expand_word .complete-word _expand_word
zle -C _history-complete-newer .complete-word _history_complete_word
zle -C _history-complete-older .complete-word _history_complete_word
zle -C _list_expansions .list-choices _expand_word
zle -C _most_recent_file .complete-word _most_recent_file
zle -C _next_tags .list-choices _next_tags
zle -C _read_comp .complete-word _read_comp
bindkey '^X^R' _read_comp
bindkey '^X?' _complete_debug
bindkey '^XC' _correct_filename
bindkey '^Xa' _expand_alias
bindkey '^Xc' _correct_word
bindkey '^Xd' _list_expansions
bindkey '^Xe' _expand_word
bindkey '^Xh' _complete_help
bindkey '^Xm' _most_recent_file
bindkey '^Xn' _next_tags
bindkey '^Xt' _complete_tag
bindkey '^X~' _bash_list-choices
bindkey '^[,' _history-complete-newer
bindkey '^[/' _history-complete-older
bindkey '^[~' _bash_complete-word
autoload -Uz _afew _android _archlinux-java _artisan _atach \
_bitcoin-cli _bower _bundle _caffeinate _cap \
_cask _ccache _cdls_popdls_pushdls _cf _cheat \
_choc _chromium _cmake _coffee _composer \
_conan _console _dad _debuild _dget \
_dhcpcd _diana _docpad _drush _dut \
_ecdsautil _emulator _envdir _exportfs _fab \
_fast-theme _ffind _fleetctl _flutter _force \
_gas _ghc _gist _git-flow _git-hub-browse \
_git-hub-shorten-url _git-info _git-journal _git-pulls _git-submodule-move \
_git-submodule-remove _git-wtf _glances _golang _google \
_gtk-launch _hledger _homestead _httpie _ibus \
_include-what-you-use _jmeter _jmeter-plugins _jonas _jrnl \
_kak _kitchen _knife _language_codes _lunchy \
_mand_manp _middleman _mina _mix _mkdcd \
_multirust _mussh _mvn _nftables _node \
_noremoteglob _nvm _openssl _optirun _patool \
_perf _periscope _pgsql_utils _phing _pixz \
_pkcon _play _port _prep _psub \
_pygmentize _rails _ralio _redis-cli _rfkill \
_rkt _rslsync _rspec _rsvm _rubocop \
_rvm _sbt _scala _scrub _sdd \
_setcap _sfdx _showoff _srm _stack \
_subl _subliminal _supervisorctl _svm _tarsnap \
_teamocil _thor _tmuxinator _tmuxp _tox \
_trash-empty _trash-list _trash-put _trash-restore _udisksctl \
_ufw _vagrant _virtualbox _vnstat _wemux \
_wg-quick _xinput _xsel _yaourt _yarn \
_zcash-cli _zplugin _brew _brew_cask _brew_services \
_docker _fd _nnn _rg _the_silver_searcher \
_youtube-dl _SUSEconfig _a2ps _a2utils _aap \
_absolute_command_paths _ack _acpi _acpitool _acroread \
_adb _add-zle-hook-widget _add-zsh-hook _alias _aliases \
_all_labels _all_matches _alternative _analyseplugin _ansible \
_ant _antiword _apachectl _apm _approximate \
_apt _apt-file _apt-move _apt-show-versions _aptitude \
_arch_archives _arch_namespace _arg_compile _arguments _arp \
_arping _arrays _asciidoctor _asciinema _assign \
_at _attr _augeas _auto-apt _autocd \
_awk _axi-cache _base64 _basename _bash \
_bash_completions _baudrates _baz _be_name _beadm \
_beep _bibtex _bind_addresses _bindkey _bison \
_bittorrent _bogofilter _bpf_filters _bpython _brace_parameter \
_brctl _bsd_pkg _bsdconfig _bsdinstall _btrfs \
_bts _bug _builtin _bzip2 _bzr \
_cabal _cache_invalid _caffeinate _cal _calendar \
_call_function _canonical_paths _cat _ccal _cd \
_cdbs-edit-patch _cdcd _cdr _cdrdao _cdrecord \
_chattr _chflags _chkconfig _chmod _chown \
_chroot _chrt _chsh _cksum _clay \
_cmdambivalent _cmdstring _cmp _code _column \
_combination _comm _command _command_names _comp_locale \
_compadd _compdef _complete _complete_debug _complete_help \
_complete_help_generic _complete_tag _completers _composer _compress \
_condition _configure _coreadm _correct _correct_filename \
_correct_word _cowsay _cp _cpio _cplay \
_cpupower _crontab _cryptsetup _cscope _cssh \
_csup _ctags_tags _cu _curl _cut \
_cvs _cvsup _cygcheck _cygpath _cygrunsrv \
_cygserver _cygstart _dak _darcs _date \
_date_formats _dates _dbus _dchroot _dchroot-dsa \
_dconf _dcop _dcut _dd _deb_architectures \
_deb_codenames _deb_packages _debbugs_bugnumber _debchange _debcheckout \
_debdiff _debfoster _deborphan _debsign _debuild \
_default _defaults _delimiters _describe _description \
_devtodo _df _dhclient _dhcpinfo _dict \
_dict_words _diff _diff3 _diff_options _diffstat \
_dig _dir_list _directories _directory_stack _dirs \
_disable _dispatch _django _dkms _dladm \
_dlocate _dmesg _dmidecode _dnf _dns_types \
_doas _domains _dos2unix _dpatch-edit-patch _dpkg \
_dpkg-buildpackage _dpkg-cross _dpkg-repack _dpkg_source _dput \
_drill _dsh _dtrace _dtruss _du \
_dumpadm _dumper _dupload _dvi _dynamic_directory_name \
_e2label _ecasound _echotc _echoti _ed \
_elfdump _elinks _elm _email_addresses _emulate \
_enable _enscript _entr _env _eog \
_equal _espeak _etags _ethtool _evince \
_exec _expand _expand_alias _expand_word _extensions \
_external_pwds _fakeroot _fbsd_architectures _fc _feh \
_fetch _fetchmail _ffmpeg _figlet _file_descriptors \
_file_flags _file_modes _file_systems _files _find \
_find_net_interfaces _finger _fink _first _flac \
_flasher _flex _floppy _flowadm _fmadm \
_fmt _fold _fortune _freebsd-update _fs_usage \
_fsh _fstat _functions _fuse_arguments _fuse_values \
_fuser _fusermount _fw_update _gcc _gcore \
_gdb _geany _gem _generic _genisoimage \
_getclip _getconf _getent _getfacl _getmail \
_getopt _ghostscript _git _git-buildpackage _global \
_global_tags _globflags _globqual_delims _globquals _gnome-gv \
_gnu_generic _gnupod _gnutls _go _gpasswd \
_gpg _gphoto2 _gprof _gqview _gradle \
_graphicsmagick _grep _grep-excuses _groff _groups \
_growisofs _gsettings _gstat _guard _guilt \
_gv _gzip _hash _have_glob_qual _hdiutil \
_head _hexdump _hg _history _history_complete_word \
_history_modifiers _host _hostname _hosts _htop \
_hwinfo _iconv _iconvconfig _id _ifconfig \
_iftop _ignored _imagemagick _in_vared _inetadm \
_init_d _initctl _install _invoke-rc.d _ionice \
_iostat _ip _ipadm _ipsec _ipset \
_iptables _irssi _ispell _iwconfig _jail \
_jails _java _java_class _jexec _jls \
_jobs _jobs_bg _jobs_builtin _jobs_fg _joe \
_join _jot _jq _kdeconnect _kfmclient \
_kill _killall _kld _knock _kpartx \
_kvno _last _ld_debug _ldap _ldconfig \
_ldd _less _lha _libvirt _lighttpd \
_limit _limits _links _lintian _list \
_list_files _lldb _ln _loadkeys _locale \
_localedef _locales _locate _logical_volumes _look \
_lp _ls _lsattr _lsblk _lscfg \
_lsdev _lslv _lsof _lspv _lsusb \
_lsvg _ltrace _lua _luarocks _lynx \
_lz4 _lzop _mac_applications _mac_files_for_application _madison \
_mail _mailboxes _main_complete _make _make-kpkg \
_man _match _math _math_params _matlab \
_md5sum _mdadm _mdfind _mdls _mdutil \
_members _mencal _menu _mere _mergechanges \
_message _mh _mii-tool _mime_types _mixerctl \
_mkdir _mkfifo _mknod _mkshortcut _mktemp \
_mkzsh _module _module-assistant _module_math_func _modutils \
_mondo _monotone _moosic _mosh _most_recent_file \
_mount _mozilla _mpc _mplayer _mt \
_mtools _mtr _multi_parts _mupdf _mutt \
_mv _my_accounts _mysql_utils _mysqldiff _nautilus \
_nbsd_architectures _ncftp _nedit _net_interfaces _netcat \
_netscape _netstat _networkmanager _networksetup _newsgroups \
_next_label _next_tags _nginx _ngrep _nice \
_nkf _nl _nm _nmap _normal \
_nothing _notmuch _npm _nslookup _numfmt \
_nvram _objdump _object_classes _object_files _obsd_architectures \
_od _okular _oldlist _open _openstack \
_opkg _options _options_set _options_unset _osascript \
_osc _other_accounts _otool _pack _parameter \
_parameters _paste _patch _patchutils _path_commands \
_path_files _pax _pbcopy _pbm _pbuilder \
_pdf _pdftk _perforce _perl _perl_basepods \
_perl_modules _perldoc _pfctl _pfexec _pgrep \
_php _physical_volumes _pick_variant _picocom _pidof \
_pids _pine _ping _piuparts _pkg-config \
_pkg5 _pkg_instance _pkgadd _pkginfo _pkgrm \
_pkgtool _plutil _pon _portaudit _portlint \
_portmaster _ports _portsnap _postfix _postscript \
_powerd _prcs _precommand _prefix _print \
_printenv _printers _process_names _procstat _prompt \
_prove _prstat _ps _ps1234 _pscp \
_pspdf _psutils _ptree _pump _putclip \
_pwgen _pydoc _python _python_modules _qdbus \
_qemu _qiv _qtplay _quilt _raggle \
_rake _ranlib _rar _rcctl _rcs \
_rdesktop _read _read_comp _readelf _readlink \
_readshortcut _rebootin _redirect _regex_arguments _regex_words \
_remote_files _renice _reprepro _requested _retrieve_cache \
_retrieve_mac_apps _ri _rlogin _rm _rmdir \
_route _rpm _rpmbuild _rrdtool _rsync \
_rubber _ruby _run-help _runit _sablotron \
_samba _savecore _say _sc_usage _sccs \
_sched _schedtool _schroot _scl _scons \
_screen _script _scselect _scutil _sed \
_sep_parts _seq _sequence _service _services \
_set _set_command _setfacl _setopt _setsid \
_setup _setxkbmap _sh _shasum _showmount \
_shred _shuf _shutdown _signals _signify \
_sisu _slrn _smartmontools _smit _snoop \
_socket _sockstat _softwareupdate _sort _source \
_spamassassin _split _sqlite _sqsh _ss \
_ssh _ssh_hosts _sshfs _stat _stdbuf \
_stgit _store_cache _strace _strftime _strings \
_strip _stty _su _sub_commands _sublimetext \
_subscript _subversion _sudo _suffix_alias_files _surfraw \
_svcadm _svccfg _svcprop _svcs _svcs_fmri \
_svn-buildpackage _sw_vers _swaks _swanctl _swift \
_sys_calls _sysctl _sysrc _sysstat _systat \
_system_profiler _tac _tags _tail _tar \
_tar_archive _tardy _tcpdump _tcpsys _tcptraceroute \
_tee _telnet _terminals _tex _texi \
_texinfo _tidy _tiff _tilde _tilde_files \
_time_zone _timeout _tin _tla _tmux \
_todo.sh _toilet _toolchain-source _top _topgit \
_totd _touch _tpb _tpconfig _tput \
_tr _tracepath _trap _tree _truss \
_tty _ttyctl _ttys _tune2fs _twidge \
_twisted _typeset _ulimit _uml _umountable \
_unace _uname _unexpand _unhash _uniq \
_unison _units _update-alternatives _update-rc.d _uptime \
_urls _urpmi _urxvt _uscan _user_admin \
_user_at_host _user_expand _user_math_func _users _users_on \
_uzbl _valgrind _value _values _vared \
_vars _vcsh _vim _vim-addons _visudo \
_vmctl _vmstat _vnc _volume_groups _vorbis \
_vpnc _vserver _vux _w _w3m \
_wait _wajig _wakeup_capable_devices _wanna-build _wanted \
_watch _watch-snoop _wc _webbrowser _wget \
_whereis _which _who _whois _widgets \
_wiggle _wipefs _wpa_cli _x_arguments _x_borderwidth \
_x_color _x_colormapid _x_cursor _x_display _x_extension \
_x_font _x_geometry _x_keysym _x_locale _x_modifier \
_x_name _x_resource _x_selection_timeout _x_title _x_utils \
_x_visual _x_window _xargs _xauth _xautolock \
_xclip _xcode-select _xdvi _xfig _xft_fonts \
_xloadimage _xmlsoft _xmlstarlet _xmms2 _xmodmap \
_xournal _xpdf _xrandr _xscreensaver _xset \
_xt_arguments _xt_session_id _xterm _xv _xwit \
_xxd _xz _yafc _yast _yodl \
_yp _yum _zargs _zathura _zattr \
_zcalc _zcalc_line _zcat _zcompile _zdump \
_zeal _zed _zfs _zfs_dataset _zfs_keysource_props \
_zfs_pool _zftp _zip _zle _zlogin \
_zmodload _zmv _zoneadm _zones _zpool \
_zpty _zsh _zsh-mime-handler _zsocket _zstyle \
_ztodo _zypper _afew _android _archlinux-java \
_artisan _atach _bitcoin-cli _bower _bundle \
_caffeinate _cap _cask _ccache _cf \
_cheat _choc _chromium _cmake _coffee \
_composer _conan _console _dad _debuild \
_dget _dhcpcd _diana _docpad _drush \
_ecdsautil _emulator _envdir _exportfs _fab \
_ffind _fleetctl _flutter _force _gas \
_ghc _gist _git-flow _git-journal _git-pulls \
_git-wtf _glances _golang _google _gtk-launch \
_hledger _homestead _httpie _ibus _include-what-you-use \
_jmeter _jmeter-plugins _jonas _jrnl _kak \
_kitchen _knife _language_codes _lunchy _middleman \
_mina _mix _multirust _mussh _mvn \
_nftables _node _nvm _openssl _optirun \
_patool _perf _periscope _pgsql_utils _phing \
_pixz _pkcon _play _port _pygmentize \
_rails _ralio _redis-cli _rfkill _rkt \
_rslsync _rspec _rsvm _rubocop _rvm \
_sbt _scala _scrub _sdd _setcap \
_setup.py _sfdx _showoff _srm _stack \
_subl _subliminal _supervisorctl _svm _tarsnap \
_teamocil _thor _tmuxinator _tmuxp _tox \
_trash-empty _trash-list _trash-put _trash-restore _udisksctl \
_ufw _vagrant _virtualbox _vnstat _wemux \
_wg-quick _xinput _xsel _yaourt _yarn \
_zcash-cli _git-hub-browse _git-hub-shorten-url _git-info _git-submodule-move \
_git-submodule-remove
autoload -Uz +X _call_program
typeset -gUa _comp_assocs
_comp_assocs=( '' )
# -*- mode: sh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# -------------------------------------------------------------------------------------------------
# Copyright (c) 2010-2016 zsh-syntax-highlighting contributors
# Copyright (c) 2016-2018 Sebastian Gniazdowski (modifications)
# All rights reserved.
#
# The only licensing for this file follows.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this list of conditions
# and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice, this list of
# conditions and the following disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
# may be used to endorse or promote products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# -------------------------------------------------------------------------------------------------
typeset -gA __fast_highlight_main__command_type_cache FAST_BLIST_PATTERNS
typeset -g FAST_WORK_DIR
: ${FAST_WORK_DIR:=$FAST_BASE_DIR}
FAST_WORK_DIR=${~FAST_WORK_DIR}
() {
setopt localoptions extendedglob
local -A map
map=( "XDG:" "${XDG_CONFIG_HOME:-$HOME/.config}/fsh/"
"LOCAL:" "/usr/local/share/fsh/"
"HOME:" "$HOME/.fsh/"
"OPT:" "/opt/local/share/fsh/"
)
FAST_WORK_DIR=${${FAST_WORK_DIR/(#m)(#s)(XDG|LOCAL|HOME|OPT):(#c0,1)/${map[${MATCH%:}:]}}%/}
}
# Define default styles. You can set this after loading the plugin in
# Zshrc and use 256 colors via numbers, like: fg=150
typeset -gA FAST_HIGHLIGHT_STYLES
if [[ -e $FAST_WORK_DIR/current_theme.zsh ]]; then
source $FAST_WORK_DIR/current_theme.zsh
else
# built-in theme
zstyle :plugin:fast-syntax-highlighting theme default
: ${FAST_HIGHLIGHT_STYLES[default]:=none}
: ${FAST_HIGHLIGHT_STYLES[unknown-token]:=fg=red,bold}
: ${FAST_HIGHLIGHT_STYLES[reserved-word]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[subcommand]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[alias]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[suffix-alias]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[global-alias]:=bg=blue}
: ${FAST_HIGHLIGHT_STYLES[builtin]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[function]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[command]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[precommand]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[commandseparator]:=none}
: ${FAST_HIGHLIGHT_STYLES[hashed-command]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[path]:=fg=magenta}
: ${FAST_HIGHLIGHT_STYLES[path-to-dir]:=fg=magenta,underline}
: ${FAST_HIGHLIGHT_STYLES[path_pathseparator]:=}
: ${FAST_HIGHLIGHT_STYLES[globbing]:=fg=blue,bold}
: ${FAST_HIGHLIGHT_STYLES[globbing-ext]:=fg=13}
: ${FAST_HIGHLIGHT_STYLES[history-expansion]:=fg=blue,bold}
: ${FAST_HIGHLIGHT_STYLES[single-hyphen-option]:=fg=cyan}
: ${FAST_HIGHLIGHT_STYLES[double-hyphen-option]:=fg=cyan}
: ${FAST_HIGHLIGHT_STYLES[back-quoted-argument]:=none}
: ${FAST_HIGHLIGHT_STYLES[single-quoted-argument]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[double-quoted-argument]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[dollar-quoted-argument]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[back-or-dollar-double-quoted-argument]:=fg=cyan}
: ${FAST_HIGHLIGHT_STYLES[back-dollar-quoted-argument]:=fg=cyan}
: ${FAST_HIGHLIGHT_STYLES[assign]:=none}
: ${FAST_HIGHLIGHT_STYLES[redirection]:=none}
: ${FAST_HIGHLIGHT_STYLES[comment]:=fg=black,bold}
: ${FAST_HIGHLIGHT_STYLES[variable]:=fg=113}
: ${FAST_HIGHLIGHT_STYLES[mathvar]:=fg=blue,bold}
: ${FAST_HIGHLIGHT_STYLES[mathnum]:=fg=magenta}
: ${FAST_HIGHLIGHT_STYLES[matherr]:=fg=red}
: ${FAST_HIGHLIGHT_STYLES[assign-array-bracket]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[for-loop-variable]:=none}
: ${FAST_HIGHLIGHT_STYLES[for-loop-operator]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[for-loop-number]:=fg=magenta}
: ${FAST_HIGHLIGHT_STYLES[for-loop-separator]:=fg=yellow,bold}
: ${FAST_HIGHLIGHT_STYLES[here-string-tri]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[here-string-text]:=bg=18}
: ${FAST_HIGHLIGHT_STYLES[here-string-var]:=fg=cyan,bg=18}
: ${FAST_HIGHLIGHT_STYLES[case-input]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[case-parentheses]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[case-condition]:=bg=blue}
: ${FAST_HIGHLIGHT_STYLES[paired-bracket]:=bg=blue}
: ${FAST_HIGHLIGHT_STYLES[bracket-level-1]:=fg=green,bold}
: ${FAST_HIGHLIGHT_STYLES[bracket-level-2]:=fg=yellow,bold}
: ${FAST_HIGHLIGHT_STYLES[bracket-level-3]:=fg=cyan,bold}
: ${FAST_HIGHLIGHT_STYLES[single-sq-bracket]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[double-sq-bracket]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[double-paren]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[correct-subtle]:=fg=12}
: ${FAST_HIGHLIGHT_STYLES[incorrect-subtle]:=fg=red}
: ${FAST_HIGHLIGHT_STYLES[subtle-bg]:=bg=18}
: ${FAST_HIGHLIGHT_STYLES[secondary]:=}
fi
# This can overwrite some of *_STYLES fields
[[ -r $FAST_WORK_DIR/theme_overlay.zsh ]] && source $FAST_WORK_DIR/theme_overlay.zsh
typeset -gA __FAST_HIGHLIGHT_TOKEN_TYPES
__FAST_HIGHLIGHT_TOKEN_TYPES=(
# Precommand
'builtin' 1
'command' 1
'exec' 1
'nocorrect' 1
'noglob' 1
'pkexec' 1 # immune to #121 because it's usually not passed --option flags
# Control flow
# Tokens that, at (naively-determined) "command position", are followed by
# a de jure command position. All of these are reserved words.
$'\x7b' 2 # block '{'
$'\x28' 2 # subshell '('
'()' 2 # anonymous function
'while' 2
'until' 2
'if' 2
'then' 2
'elif' 2
'else' 2
'do' 2
'time' 2
'coproc' 2
'!' 2 # reserved word; unrelated to $histchars[1]
# Command separators
'|' 3
'||' 3
';' 3
'&' 3
'&&' 3
'|&' 3
'&!' 3
'&|' 3
# ### 'case' syntax, but followed by a pattern, not by a command
# ';;' ';&' ';|'
)
# A hash instead of multiple globals
typeset -gA FAST_HIGHLIGHT
# Brackets highlighter active by default
: ${FAST_HIGHLIGHT[use_brackets]:=1}
FAST_HIGHLIGHT+=(
chroma-fast-theme chroma/-fast-theme.ch
chroma-alias chroma/-alias.ch
chroma-autoload chroma/-autoload.ch
chroma-autorandr chroma/-autorandr.ch
chroma-docker chroma/-docker.ch
chroma-example chroma/-example.ch
chroma-ionice chroma/-ionice.ch
chroma-make chroma/-make.ch
chroma-nice chroma/-nice.ch
chroma-nmcli chroma/-nmcli.ch
chroma-node chroma/-node.ch
chroma-perl chroma/-perl.ch
chroma-printf chroma/-printf.ch
chroma-ruby chroma/-ruby.ch
chroma-scp chroma/-scp.ch
chroma-ssh chroma/-ssh.ch
chroma-git chroma/-git.ch
chroma-hub chroma/-hub.ch
chroma-lab chroma/-lab.ch
chroma-svn chroma/-subversion.ch
chroma-svnadmin chroma/-subversion.ch
chroma-svndumpfilter chroma/-subversion.ch
chroma-egrep chroma/-grep.ch
chroma-fgrep chroma/-grep.ch
chroma-grep chroma/-grep.ch
chroma-awk chroma/-awk.ch
chroma-gawk chroma/-awk.ch
chroma-mawk chroma/-awk.ch
chroma-source chroma/-source.ch
chroma-. chroma/-source.ch
chroma-bash chroma/-sh.ch
chroma-fish chroma/-sh.ch
chroma-sh chroma/-sh.ch
chroma-zsh chroma/-sh.ch
chroma-whatis chroma/-whatis.ch
chroma-man chroma/-whatis.ch
chroma-- chroma/-precommand.ch
chroma-xargs chroma/-precommand.ch
chroma-nohup chroma/-precommand.ch
chroma-hg chroma/-subcommand.ch
chroma-cvs chroma/-subcommand.ch
chroma-pip chroma/-subcommand.ch
chroma-pip2 chroma/-subcommand.ch
chroma-pip3 chroma/-subcommand.ch
chroma-gem chroma/-subcommand.ch
chroma-bundle chroma/-subcommand.ch
chroma-yard chroma/-subcommand.ch
chroma-cabal chroma/-subcommand.ch
chroma-npm chroma/-subcommand.ch
chroma-nvm chroma/-subcommand.ch
chroma-yarn chroma/-subcommand.ch
chroma-brew chroma/-subcommand.ch
chroma-port chroma/-subcommand.ch
chroma-yum chroma/-subcommand.ch
chroma-dnf chroma/-subcommand.ch
chroma-tmux chroma/-subcommand.ch
chroma-pass chroma/-subcommand.ch
chroma-aws chroma/-subcommand.ch
chroma-apt chroma/-subcommand.ch
chroma-apt-get chroma/-subcommand.ch
chroma-apt-cache chroma/-subcommand.ch
chroma-aptitude chroma/-subcommand.ch
chroma-keyctl chroma/-subcommand.ch
chroma-systemctl chroma/-subcommand.ch
chroma-asciinema chroma/-subcommand.ch
chroma-ipfs chroma/-subcommand.ch
chroma-zplugin chroma/-subcommand.ch
chroma-aspell chroma/-subcommand.ch
chroma-bspc chroma/-subcommand.ch
chroma-cryptsetup chroma/-subcommand.ch
chroma-diskutil chroma/-subcommand.ch
chroma-exercism chroma/-subcommand.ch
chroma-gulp chroma/-subcommand.ch
chroma-i3-msg chroma/-subcommand.ch
chroma-openssl chroma/-subcommand.ch
chroma-solargraph chroma/-subcommand.ch
chroma-subliminal chroma/-subcommand.ch
chroma-svnadmin chroma/-subcommand.ch
chroma-travis chroma/-subcommand.ch
chroma-udisksctl chroma/-subcommand.ch
chroma-xdotool chroma/-subcommand.ch
chroma-zmanage chroma/-subcommand.ch
chroma-zsystem chroma/-subcommand.ch
chroma-zypper chroma/-subcommand.ch
chroma-fpath+=\( chroma/-fpath_peq.ch
chroma-fpath=\( chroma/-fpath_peq.ch
chroma-FPATH+= chroma/-fpath_peq.ch
chroma-FPATH= chroma/-fpath_peq.ch
#chroma-which chroma/-which.ch
#chroma-vim chroma/-vim.ch
)
# Assignments seen, to know if math parameter exists
typeset -gA FAST_ASSIGNS_SEEN
# Exposing tokens found on command position,
# for other scripts to process
typeset -ga ZLAST_COMMANDS
# Get the type of a command.
#
# Uses the zsh/parameter module if available to avoid forks, and a
# wrapper around 'type -w' as fallback.
#
# Takes a single argument.
#
# The result will be stored in REPLY.
-fast-highlight-main-type() {
REPLY=$__fast_highlight_main__command_type_cache[(e)$1]
[[ -z $REPLY ]] && {
if zmodload -e zsh/parameter; then
if (( $+aliases[(e)$1] )); then
REPLY=alias
elif (( ${+galiases[(e)$1]} )); then
REPLY="global alias"
elif (( $+functions[(e)$1] )); then
REPLY=function
elif (( $+builtins[(e)$1] )); then
REPLY=builtin
elif (( $+commands[(e)$1] )); then
REPLY=command
elif (( $+saliases[(e)${1##*.}] )); then
REPLY='suffix alias'
elif (( $reswords[(Ie)$1] )); then
REPLY=reserved
# zsh 5.2 and older have a bug whereby running 'type -w ./sudo' implicitly
# runs 'hash ./sudo=/usr/local/bin/./sudo' (assuming /usr/local/bin/sudo
# exists and is in $PATH). Avoid triggering the bug, at the expense of
# falling through to the $() below, incurring a fork. (Issue #354.)
#
# The second disjunct mimics the isrelative() C call from the zsh bug.
elif [[ $1 != */* || ${+ZSH_ARGZERO} = "1" ]] && ! builtin type -w -- $1 >/dev/null 2>&1; then
REPLY=none
fi
fi
[[ -z $REPLY ]] && REPLY="${$(LC_ALL=C builtin type -w -- $1 2>/dev/null)##*: }"
[[ $REPLY = "none" ]] && {
[[ -n ${FAST_BLIST_PATTERNS[(k)${${(M)1:#/*}:-$PWD/$1}]} ]] || {
[[ -d $1 ]] && REPLY="dirpath" || {
for cdpath_dir in $cdpath; do
[[ -d $cdpath_dir/$1 ]] && { REPLY="dirpath"; break; }
done
}
}
}
__fast_highlight_main__command_type_cache[(e)$1]=$REPLY
}
}
# Below are variables that must be defined in outer
# scope so that they are reachable in *-process()
-fast-highlight-fill-option-variables() {
if [[ -o ignore_braces ]] || eval '[[ -o ignore_close_braces ]] 2>/dev/null'; then
FAST_HIGHLIGHT[right_brace_is_recognised_everywhere]=0
else
FAST_HIGHLIGHT[right_brace_is_recognised_everywhere]=1
fi
if [[ -o path_dirs ]]; then
FAST_HIGHLIGHT[path_dirs_was_set]=1
else
FAST_HIGHLIGHT[path_dirs_was_set]=0
fi
if [[ -o multi_func_def ]]; then
FAST_HIGHLIGHT[multi_func_def]=1
else
FAST_HIGHLIGHT[multi_func_def]=0
fi
if [[ -o interactive_comments ]]; then
FAST_HIGHLIGHT[ointeractive_comments]=1
else
FAST_HIGHLIGHT[ointeractive_comments]=0
fi
}
# Main syntax highlighting function.
-fast-highlight-process()
{
emulate -L zsh
setopt extendedglob bareglobqual nonomatch noksharrays
[[ $CONTEXT == "select" ]] && return 0
(( FAST_HIGHLIGHT[path_dirs_was_set] )) && setopt PATH_DIRS
(( FAST_HIGHLIGHT[ointeractive_comments] )) && local interactive_comments= # _set_ to empty
# Variable declarations and initializations
# in_array_assignment true between 'a=(' and the matching ')'
# braces_stack: "R" for round, "Q" for square, "Y" for curly
# _mybuf, cdpath_dir are used in sub-functions
local _start_pos=$3 _end_pos __start __end highlight_glob=1 __arg __style in_array_assignment=0 MATCH expanded_path braces_stack __buf=$1$2 _mybuf __workbuf cdpath_dir active_command alias_target _was_double_hyphen=0 __nul=$'\0' __tmp
# __arg_type can be 0, 1, 2 or 3, i.e. precommand, control flow, command separator
# __idx and _end_idx are used in sub-functions
# for this_word and next_word look below at commented integers and at state machine description
integer __arg_type=0 MBEGIN MEND in_redirection __len=${#__buf} __PBUFLEN=${#1} already_added offset __idx _end_idx this_word=1 next_word=0 __pos __asize __delimited=0 itmp iitmp
local -a match mbegin mend __inputs __list
# This comment explains the numbers:
# BIT_for - word after reserved-word-recognized `for'
# BIT_afpcmd - word after a precommand that can take options, like `command' and `exec'
# integer BIT_start=1 BIT_regular=2 BIT_sudo_opt=4 BIT_sudo_arg=8 BIT_always=16 BIT_for=32 BIT_afpcmd=64
# integer BIT_chroma=8192
integer BIT_case_preamble=512 BIT_case_item=1024 BIT_case_nempty_item=2048 BIT_case_code=4096
# Braces stack
# T - typeset, local, etc.
# State machine
#
# The states are:
# - :__start: Command word
# - :sudo_opt: A leading-dash option to sudo (such as "-u" or "-i")
# - :sudo_arg: The argument to a sudo leading-dash option that takes one,
# when given as a separate word; i.e., "foo" in "-u foo" (two
# words) but not in "-ufoo" (one word).
# - :regular: "Not a command word", and command delimiters are permitted.
# Mainly used to detect premature termination of commands.
# - :always: The word 'always' in the «{ foo } always { bar }» syntax.
#
# When the kind of a word is not yet known, $this_word / $next_word may contain
# multiple states. For example, after "sudo -i", the next word may be either
# another --flag or a command name, hence the state would include both :__start:
# and :sudo_opt:.
#
# The tokens are always added with both leading and trailing colons to serve as
# word delimiters (an improvised array); [[ $x == *:foo:* ]] and x=${x//:foo:/}
# will DTRT regardless of how many elements or repetitions $x has..
#
# Handling of redirections: upon seeing a redirection token, we must stall
# the current state --- that is, the value of $this_word --- for two iterations
# (one for the redirection operator, one for the word following it representing
# the redirection target). Therefore, we set $in_redirection to 2 upon seeing a
# redirection operator, decrement it each iteration, and stall the current state
# when it is non-zero. Thus, upon reaching the next word (the one that follows
# the redirection operator and target), $this_word will still contain values
# appropriate for the word immediately following the word that preceded the
# redirection operator.
#
# The "the previous word was a redirection operator" state is not communicated
# to the next iteration via $next_word/$this_word as usual, but via
# $in_redirection. The value of $next_word from the iteration that processed
# the operator is discarded.
#
# Command exposure for other scripts
ZLAST_COMMANDS=()
# Restart observing of assigns
FAST_ASSIGNS_SEEN=()
# Restart function's gathering
FAST_HIGHLIGHT[chroma-autoload-elements]=""
# Restart FPATH elements gathering
FAST_HIGHLIGHT[chroma-fpath_peq-elements]=""
[[ -n $ZCALC_ACTIVE ]] && {
_start_pos=0; _end_pos=__len; __arg=$__buf
-fast-highlight-math-string
return 0
}
# Processing buffer
local proc_buf=$__buf needle
for __arg in ${interactive_comments-${(z)__buf}} \
${interactive_comments+${(zZ+c+)__buf}}; do
# Initialize $next_word to its default value?
(( in_redirection = in_redirection > 0 ? in_redirection - 1 : in_redirection ));
(( next_word = (in_redirection == 0) ? 2 : next_word )) # else Stall $next_word.
(( next_word = next_word | (this_word & (BIT_case_code|8192)) ))
# If we have a good delimiting construct just ending, and '{'
# occurs, then respect this and go for alternate syntax, i.e.
# treat '{' (\x7b) as if it's on command position
[[ $__arg = '{' && $__delimited = 2 ]] && { (( this_word = (this_word & ~2) | 1 )); __delimited=0; }
__asize=${#__arg}
# Reset state of working variables
already_added=0
__style=${FAST_THEME_NAME}unknown-token
(( this_word & 1 )) && { in_array_assignment=0; [[ $__arg == 'noglob' ]] && highlight_glob=0; }
# Compute the new $_start_pos and $_end_pos, skipping over whitespace in $__buf.
if [[ $__arg == ';' ]] ; then
braces_stack=${braces_stack#T}
__delimited=0
# Both ; and \n are rendered as a ";" (SEPER) by the ${(z)..} flag.
needle=$';\n'
[[ $proc_buf = (#b)[^$needle]#([$needle]##)* ]] && offset=${mbegin[1]}-1
(( _start_pos += offset ))
(( _end_pos = _start_pos + __asize ))
# Prepare next loop cycle
(( this_word & BIT_case_item )) || { (( in_array_assignment )) && (( this_word = 2 | (this_word & BIT_case_code) )) || { (( this_word = 1 | (this_word & BIT_case_code) )); highlight_glob=1; }; }
in_redirection=0
# Chance to highlight ';'
[[ ${proc_buf[offset+1]} != $'\n' ]] && {
[[ ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}commandseparator]} != "none" ]] && \
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}commandseparator]}")
}
proc_buf=${proc_buf[offset + __asize + 1,__len]}
_start_pos=$_end_pos
continue
else
offset=0
if [[ $proc_buf = (#b)(#s)(([[:space:]]|\\[[:space:]])##)* ]]; then
# The first, outer parenthesis
offset=${mend[1]}
fi
(( _start_pos += offset ))
(( _end_pos = _start_pos + __asize ))
# No-hit will result in value 0
__arg_type=${__FAST_HIGHLIGHT_TOKEN_TYPES[$__arg]}
fi
(( this_word & 1 )) && ZLAST_COMMANDS+=( $__arg );
proc_buf=${proc_buf[offset + __asize + 1,__len]}
# Handle the INTERACTIVE_COMMENTS option.
#
# We use the (Z+c+) flag so the entire comment is presented as one token in $__arg.
if [[ -n ${interactive_comments+'set'} && $__arg == ${histchars[3]}* ]]; then
if (( this_word & 3 )); then
__style=${FAST_THEME_NAME}comment
else
__style=${FAST_THEME_NAME}unknown-token # prematurely terminated
fi
# ADD
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
_start_pos=$_end_pos
continue
fi
# Redirection?
[[ $__arg == (<0-9>|)(\<|\>)* && $__arg != (\<|\>)$'\x28'* && $__arg != "<<<" ]] && \
in_redirection=2
# Special-case the first word after 'sudo'.
if (( ! in_redirection )); then
(( this_word & 4 )) && [[ $__arg != -* ]] && (( this_word = this_word ^ 4 ))
# Parse the sudo command line
if (( this_word & 4 )); then
case $__arg in
# Flag that requires an argument
'-'[Cgprtu])
(( this_word = this_word & ~1 ))
(( next_word = 8 | (this_word & BIT_case_code) ))
;;
# This prevents misbehavior with sudo -u -otherargument
'-'*)
(( this_word = this_word & ~1 ))
(( next_word = next_word | 1 | 4 ))
;;
esac
elif (( this_word & 8 )); then
(( next_word = next_word | 4 | 1 ))
elif (( this_word & 64 )); then
[[ $__arg = -[pvV-]## && $active_command = "command" ]] && (( this_word = (this_word & ~1) | 2, next_word = (next_word | 65) & ~2 ))
[[ $__arg = -[cla-]## && $active_command = "exec" ]] && (( this_word = (this_word & ~1) | 2, next_word = (next_word | 65) & ~2 ))
[[ $__arg = \{[a-zA-Z][a-zA-Z0-9]#\} && $active_command = "exec" ]] && {
# Highlight {descriptor} passed to exec
(( this_word = (this_word & ~1) | 2, next_word = (next_word | 65) & ~2 ))
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}exec-descriptor]}")
already_added=1
}
fi
fi
(( this_word & 8192 )) && {
__list=( ${(z@)${aliases[$active_command]:-${active_command##*/}}##[[:space:]]#(command|builtin|exec|noglob|nocorrect|pkexec)[[:space:]]#} )
${FAST_HIGHLIGHT[chroma-${__list[1]}]} 0 "$__arg" $_start_pos $_end_pos 2>/dev/null && continue
}
(( this_word & 1 )) && {
# !in_redirection needed particularly for exec {A}>b {C}>d
(( !in_redirection )) && active_command=$__arg
_mybuf=${${aliases[$active_command]:-${active_command##*/}}##[[:space:]]#(command|builtin|exec|noglob|nocorrect|pkexec)[[:space:]]#}
[[ "$_mybuf" = (#b)(FPATH+(#c0,1)=)* ]] && _mybuf="${match[1]} ${(j: :)${(s,:,)${_mybuf#FPATH+(#c0,1)=}}}"
[[ -n ${FAST_HIGHLIGHT[chroma-${_mybuf%% *}]} ]] && {
__list=( ${(z@)_mybuf} )
if (( ${#__list} > 1 )) || [[ $active_command != $_mybuf ]]; then
__style=${FAST_THEME_NAME}alias
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
${FAST_HIGHLIGHT[chroma-${__list[1]}]} 1 "${__list[1]}" "-100000" $_end_pos 2>/dev/null || \
(( this_word = next_word, next_word = 2 ))
for _mybuf in "${(@)__list[2,-1]}"; do
(( next_word = next_word | (this_word & (BIT_case_code|8192)) ))
${FAST_HIGHLIGHT[chroma-${__list[1]}]} 0 "$_mybuf" "-100000" $_end_pos 2>/dev/null || \
(( this_word = next_word, next_word = 2 ))
done
# This might have been done multiple times in chroma, but
# as _end_pos doesn't change, it can be done one more time
_start_pos=$_end_pos
continue
else
${FAST_HIGHLIGHT[chroma-$active_command]} 1 "$__arg" $_start_pos $_end_pos 2>/dev/null && continue
fi
} || (( 1 ))
}
expanded_path=""
# The Great Fork: is this a command word? Is this a non-command word?
if (( this_word & 16 )) && [[ $__arg == 'always' ]]; then
# try-always construct
__style=${FAST_THEME_NAME}reserved-word # de facto a reserved word, although not de jure
(( next_word = 1 | (this_word & BIT_case_code) ))
elif (( (this_word & 1) && (in_redirection == 0) )) || [[ $braces_stack = T* ]]; then # T - typedef, etc.
if (( __arg_type == 1 )); then
__style=${FAST_THEME_NAME}precommand
[[ $__arg = "command" || $__arg = "exec" ]] && (( next_word = next_word | 64 ))
elif [[ $__arg = "sudo" ]]; then
__style=${FAST_THEME_NAME}precommand
(( next_word = (next_word & ~2) | 4 | 1 ))
else
_mybuf=${${(Q)__arg}#\"}
if [[ $_mybuf == \$* ]] && (( ${+parameters} )) && \
[[ $_mybuf = (#b)\$([a-zA-Z_][a-zA-Z0-9_]#|[0-9]##)(/*|) || $_mybuf = (#b)\$\{([a-zA-Z_][a-zA-Z0-9_]#|[0-9]##)\}(/*|) ]] && \
(( ${+parameters[${match[1]}]} )); then
-fast-highlight-main-type ${(P)match[1]}${match[2]}
elif [[ $braces_stack = T* ]]; then # T - typedef, etc.
REPLY=none
else
: ${expanded_path::=${~_mybuf}}
-fast-highlight-main-type $expanded_path
fi
case $REPLY in
reserved) # reserved word
[[ $__arg = "[[" ]] && __style=${FAST_THEME_NAME}double-sq-bracket || __style=${FAST_THEME_NAME}reserved-word
if [[ $__arg == $'\x7b' ]]; then # Y - '{'
braces_stack='Y'$braces_stack
elif [[ $__arg == $'\x7d' && $braces_stack = Y* ]]; then # Y - '}'
# We're at command word, so no need to check right_brace_is_recognised_everywhere
braces_stack=${braces_stack#Y}
__style=${FAST_THEME_NAME}reserved-word
(( next_word = next_word | 16 ))
elif [[ $__arg == "[[" ]]; then # A - [[
braces_stack='A'$braces_stack
# Counting complex brackets (for brackets-highlighter): 1. [[ as command
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) $(( _start_pos-__PBUFLEN + 1 )) )
elif [[ $__arg == "for" ]]; then
(( next_word = next_word | 32 )) # BIT_for
elif [[ $__arg == "case" ]]; then
(( next_word = BIT_case_preamble ))
elif [[ $__arg = (typeset|declare|local|float|integer|export|readonly) ]]; then
braces_stack='T'$braces_stack
fi
;;
'suffix alias') __style=${FAST_THEME_NAME}suffix-alias;;
'global alias') __style=${FAST_THEME_NAME}global-alias;;
alias)
if [[ $__arg = ?*'='* ]]; then
# The so called (by old code) "insane_alias"
__style=${FAST_THEME_NAME}unknown-token
else
__style=${FAST_THEME_NAME}alias
(( ${+aliases} )) && alias_target=${aliases[$__arg]} || alias_target="${"$(alias -- $__arg)"#*=}"
[[ ${__FAST_HIGHLIGHT_TOKEN_TYPES[$alias_target]} = "1" && $__arg_type != "1" ]] && __FAST_HIGHLIGHT_TOKEN_TYPES[$__arg]="1"
fi
;;
builtin) [[ $__arg = "[" ]] && {
__style=${FAST_THEME_NAME}single-sq-bracket
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) )
} || __style=${FAST_THEME_NAME}builtin
# T - typeset, etc. mode
[[ $__arg = (typeset|declare|local|float|integer|export|readonly) ]] && braces_stack='T'$braces_stack
[[ $__arg = eval ]] && (( next_word = next_word | 256 ))
;;
function) __style=${FAST_THEME_NAME}function;;
command) __style=${FAST_THEME_NAME}command;;
hashed) __style=${FAST_THEME_NAME}hashed-command;;
dirpath) __style=${FAST_THEME_NAME}path-to-dir;;
none) # Assign?
if [[ $__arg == [a-zA-Z_][a-zA-Z0-9_]#(|\[[^\]]#\])(|[^\]]#\])(|[+])=* || $__arg == [0-9]##(|[+])=* || ( $braces_stack = T* && ${__arg_type} != 3 ) ]]; then
__style=${FAST_THEME_NAME}assign
[[ $__arg = ?*[=]* ]] && FAST_ASSIGNS_SEEN[${__arg%%=*}]=1
# Handle array assignment
[[ $__arg = (#b)*=(\()*(\))* || $__arg = (#b)*=(\()* ]] && {
(( __start=_start_pos-__PBUFLEN+${mbegin[1]}-1, __end=__start+1, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}assign-array-bracket]}")
# Counting complex brackets (for brackets-highlighter): 2. ( in array assign
_FAST_COMPLEX_BRACKETS+=( $__start )
(( mbegin[2] >= 1 )) && {
(( __start=_start_pos-__PBUFLEN+${mbegin[2]}-1, __end=__start+1, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}assign-array-bracket]}")
# Counting complex brackets (for brackets-highlighter): 3a. ) in array assign
_FAST_COMPLEX_BRACKETS+=( $__start )
} || in_array_assignment=1
} || { [[ ${braces_stack[1]} != 'T' ]] && (( next_word = (next_word | 1) & ~2 )); }
# Handle no-string highlight, string "/' highlight, math mode highlight
local ctmp="\"" dtmp="'"
itmp=${__arg[(i)$ctmp]}-1 iitmp=${__arg[(i)$dtmp]}-1
integer jtmp=${__arg[(b:itmp+2:i)$ctmp]} jjtmp=${__arg[(b:iitmp+2:i)$dtmp]}
(( itmp < iitmp && itmp <= __asize - 1 )) && (( jtmp > __asize && (jtmp = __asize), 1 > 0 )) && \
(( __start=_start_pos-__PBUFLEN+itmp, __end=_start_pos-__PBUFLEN+jtmp, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-quoted-argument]}") && \
{ itmp=${__arg[(i)=]}; __arg=${__arg[itmp,__asize]}; (( _start_pos += itmp - 1 ));
-fast-highlight-string; (( _start_pos = _start_pos - itmp + 1, 1 > 0 )); } || \
{
(( iitmp <= __asize - 1 )) && (( jjtmp > __asize && (jjtmp = __asize), 1 > 0 )) && \
(( __start=_start_pos-__PBUFLEN+iitmp, __end=_start_pos-__PBUFLEN+jjtmp, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}single-quoted-argument]}")
} || \
{
itmp=${__arg[(i)=]}; __arg=${__arg[itmp,__asize]}; (( _start_pos += itmp - 1 ));
[[ ${__arg[2,4]} = '$((' ]] && { -fast-highlight-math-string;
(( __start=_start_pos-__PBUFLEN+2, __end=__start+2, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-paren]}")
# Counting complex brackets (for brackets-highlighter): 4. $(( in assign argument
_FAST_COMPLEX_BRACKETS+=( $__start $(( __start + 1 )) )
(( jtmp = ${__arg[(I)\)\)]}-1, jtmp > 0 )) && {
(( __start=_start_pos-__PBUFLEN+jtmp, __end=__start+2, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-paren]}")
# Counting complex brackets (for brackets-highlighter): 5. )) in assign argument
_FAST_COMPLEX_BRACKETS+=( $__start $(( __start + 1 )) )
}
} || -fast-highlight-string;
(( _start_pos = _start_pos - itmp + 1, 1 > 0 ))
}
elif [[ $__arg = ${histchars[1]}* && -n ${__arg[2]} ]]; then
__style=${FAST_THEME_NAME}history-expansion
elif [[ $__arg == ${histchars[2]}* ]]; then
__style=${FAST_THEME_NAME}history-expansion
elif (( __arg_type == 3 )); then
# This highlights empty commands (semicolon follows nothing) as an error.
# Zsh accepts them, though.
(( this_word & 3 )) && __style=${FAST_THEME_NAME}commandseparator
elif [[ $__arg[1,2] == '((' ]]; then
# Arithmetic evaluation.
#
# Note: prior to zsh-5.1.1-52-g4bed2cf (workers/36669), the ${(z)...}
# splitter would only output the '((' token if the matching '))' had
# been typed. Therefore, under those versions of zsh, BUFFER="(( 42"
# would be highlighted as an error until the matching "))" are typed.
#
# We highlight just the opening parentheses, as a reserved word; this
# is how [[ ... ]] is highlighted, too.
# ADD
(( __start=_start_pos-__PBUFLEN, __end=__start+2, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-paren]}")
already_added=1
# Counting complex brackets (for brackets-highlighter): 6. (( as command
_FAST_COMPLEX_BRACKETS+=( $__start $(( __start + 1 )) )
-fast-highlight-math-string
# ADD
[[ $__arg[-2,-1] == '))' ]] && {
(( __start=_end_pos-__PBUFLEN-2, __end=__start+2, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-paren]}")
(( __delimited = __delimited ? 2 : __delimited ))
# Counting complex brackets (for brackets-highlighter): 7. )) for as-command ((
_FAST_COMPLEX_BRACKETS+=( $__start $(( __start + 1 )) )
}
elif [[ $__arg == '()' ]]; then
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) $(( _start_pos-__PBUFLEN + 1 )) )
# anonymous function
__style=${FAST_THEME_NAME}reserved-word
elif [[ $__arg == $'\x28' ]]; then
# subshell '(', stack: letter 'R'
__style=${FAST_THEME_NAME}reserved-word
braces_stack='R'$braces_stack
elif [[ $__arg == $'\x29' ]]; then
# ')', stack: letter 'R' for subshell
[[ $braces_stack = R* ]] && { braces_stack=${braces_stack#R}; __style=${FAST_THEME_NAME}reserved-word; }
elif (( this_word & 14 )); then
__style=${FAST_THEME_NAME}default
elif [[ $__arg = (';;'|';&'|';|') ]] && (( this_word & BIT_case_code )); then
(( next_word = (next_word | BIT_case_item) & ~(BIT_case_code+3) ))
__style=${FAST_THEME_NAME}default
elif [[ $__arg = \$\([^\(]* ]]; then
already_added=1
fi
;;
*)
# ADD
# (( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end commandtypefromthefuture-$REPLY")
already_added=1
;;
esac
fi
# in_redirection || BIT_regular || BIT_sudo_opt || BIT_sudo_arg
elif (( in_redirection + this_word & 14 ))
then # $__arg is a non-command word
case $__arg in
']]')
# A - [[
[[ $braces_stack = A* ]] && {
__style=${FAST_THEME_NAME}double-sq-bracket
(( __delimited = __delimited ? 2 : __delimited ))
# Counting complex brackets (for brackets-highlighter): 8a. ]] for as-command [[
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) $(( _start_pos-__PBUFLEN+1 )) )
} || {
[[ $braces_stack = *A* ]] && {
__style=${FAST_THEME_NAME}unknown-token
# Counting complex brackets (for brackets-highlighter): 8b. ]] for as-command [[
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) $(( _start_pos-__PBUFLEN+1 )) )
} || __style=${FAST_THEME_NAME}default
}
braces_stack=${braces_stack#A}
;;
']')
__style=${FAST_THEME_NAME}single-sq-bracket
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) )
;;
$'\x28')
# '(' inside [[
__style=${FAST_THEME_NAME}reserved-word
braces_stack='R'$braces_stack
;;
$'\x29') # ')' - subshell or end of array assignment
if (( in_array_assignment )); then
in_array_assignment=0
(( next_word = next_word | 1 ))
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}assign-array-bracket]}")
already_added=1
# Counting complex brackets (for brackets-highlighter): 3b. ) in array assign
_FAST_COMPLEX_BRACKETS+=( $__start )
elif [[ $braces_stack = R* ]]; then
braces_stack=${braces_stack#R}
__style=${FAST_THEME_NAME}reserved-word
# Zsh doesn't tokenize final ) if it's just single ')',
# but logically what's below is correct, so it is kept
# in case Zsh will be changed / fixed, etc.
elif [[ $braces_stack = F* ]]; then
__style=${FAST_THEME_NAME}builtin
fi
;;
$'\x28\x29') # '()' - possibly a function definition
# || false # TODO: or if the previous word was a command word
(( FAST_HIGHLIGHT[multi_func_def] )) && (( next_word = next_word | 1 ))
__style=${FAST_THEME_NAME}reserved-word
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) $(( _start_pos-__PBUFLEN + 1 )) )
# Remove possible annoying unknown-token __style, or misleading function __style
reply[-1]=()
__fast_highlight_main__command_type_cache[$active_command]="function"
;;
'--'*) [[ $__arg == "--" ]] && { _was_double_hyphen=1; __style=${FAST_THEME_NAME}double-hyphen-option; } || {
(( !_was_double_hyphen )) && {
[[ "$__arg" = (#b)(--[a-zA-Z0-9_]##)=(*) ]] && {
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-hyphen-option]}")
(( __start=_start_pos-__PBUFLEN+1+mend[1], __end=_end_pos-__PBUFLEN, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}optarg-${${${(M)match[2]:#<->}:+number}:-string}]}")
already_added=1
} || __style=${FAST_THEME_NAME}double-hyphen-option
} || __style=${FAST_THEME_NAME}default
}
;;
'-'*) (( !_was_double_hyphen )) && __style=${FAST_THEME_NAME}single-hyphen-option || __style=${FAST_THEME_NAME}default;;
\$\'*)
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}dollar-quoted-argument]}")
-fast-highlight-dollar-string
already_added=1
;;
[\"\']*|[^\"\\]##([\\][\\])#\"*|[^\'\\]##([\\][\\])#\'*)
if (( this_word & 256 )) && [[ $__arg = [\'\"]* ]]; then
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}recursive-base]}")
if [[ -n ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}secondary]} ]]; then
__idx=1
_mybuf=$FAST_THEME_NAME
FAST_THEME_NAME=${${${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}secondary]}:t:r}#(XDG|LOCAL|HOME|OPT):}
(( ${+FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}default]} )) || source $FAST_WORK_DIR/secondary_theme.zsh
else
__idx=0
fi
-fast-highlight-process "$PREBUFFER" ${${__arg%[\'\"]}#[\'\"]} $(( _start_pos + 1 ))
(( __idx )) && FAST_THEME_NAME=$_mybuf
already_added=1
else
[[ $__arg = *([^\\][\#][\#]|"(#b)"|"(#B)"|"(#m)"|"(#c")* && $highlight_glob -ne 0 ]] && \
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}globbing-ext]}")
# Reusing existing vars, treat this code like C++ STL
# header, full of underscores and unhelpful var names
itmp=0 __workbuf=$__arg __tmp="" cdpath_dir=$__arg
while [[ $__workbuf = (#b)[^\"\'\\]#(([\"\'])|[\\](*))(*) ]]; do
[[ -n ${match[3]} ]] && {
itmp+=${mbegin[1]}
# Optionally skip 1 quoted char
[[ $__tmp = \' ]] && __workbuf=${match[3]} || { itmp+=1; __workbuf=${match[3]:1}; }
} || {
itmp+=${mbegin[1]}
__workbuf=${match[4]}
# Toggle quoting
[[ ( ${match[1]} = \" && $__tmp != \' ) || ( ${match[1]} = \' && $__tmp != \" ) ]] && {
[[ $__tmp = [\"\'] ]] && {
# End of quoting
(( __start=_start_pos-__PBUFLEN+iitmp-1, __end=_start_pos-__PBUFLEN+itmp, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}${${${__tmp#\'}:+double-quoted-argument}:-single-quoted-argument}]}")
already_added=1
[[ $__tmp = \" ]] && {
__arg=${cdpath_dir[iitmp+1,itmp-1]}
(( _start_pos += iitmp - 1 + 1 ))
-fast-highlight-string
(( _start_pos = _start_pos - iitmp + 1 - 1 ))
}
# The end-of-quoting proper algorithm action
__tmp=
} || {
# Beginning of quoting
iitmp=itmp
# The beginning-of-quoting proper algorithm action
__tmp=${match[1]}
}
}
}
done
[[ $__tmp = [\"\'] ]] && {
(( __start=_start_pos-__PBUFLEN+iitmp-1, __end=_start_pos-__PBUFLEN+__asize, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}${${${__tmp#\'}:+double-quoted-argument}:-single-quoted-argument}]}")
already_added=1
[[ $__tmp = \" ]] && {
__arg=${cdpath_dir[iitmp+1,__asize]}
(( _start_pos += iitmp - 1 + 1 ))
-fast-highlight-string
(( _start_pos = _start_pos - iitmp + 1 - 1 ))
}
}
fi
;;
\$\(\(*)
already_added=1
-fast-highlight-math-string
# ADD
(( __start=_start_pos-__PBUFLEN+1, __end=__start+2, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-paren]}")
# Counting complex brackets (for brackets-highlighter): 9. $(( as argument
_FAST_COMPLEX_BRACKETS+=( $__start $(( __start + 1 )) )
# ADD
[[ $__arg[-2,-1] == '))' ]] && (( __start=_end_pos-__PBUFLEN-2, __end=__start+2, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-paren]}")
# Counting complex brackets (for brackets-highlighter): 10. )) for as-argument $((
_FAST_COMPLEX_BRACKETS+=( $__start $(( __start + 1 )) )
;;
'`'*) __style=${FAST_THEME_NAME}back-quoted-argument;;
'((') # 'F' - (( after for
(( this_word & 32 )) && {
braces_stack='F'$braces_stack
__style=${FAST_THEME_NAME}double-paren
# Counting complex brackets (for brackets-highlighter): 11. (( as for-syntax
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) $(( _start_pos-__PBUFLEN+1 )) )
# This is set after __arg_type == 2, and also here,
# when another alternate-syntax capable command occurs
__delimited=1
}
;;
'))') # 'F' - (( after for
[[ $braces_stack = F* ]] && {
braces_stack=${braces_stack#F}
__style=${FAST_THEME_NAME}double-paren
# Counting complex brackets (for brackets-highlighter): 12. )) as for-syntax
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) $(( _start_pos-__PBUFLEN+1 )) )
(( __delimited = __delimited ? 2 : __delimited ))
}
;;
'<<<')
(( next_word = (next_word | 128) & ~3 ))
[[ ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}here-string-tri]} != "none" ]] && (( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}here-string-tri]}")
already_added=1
;;
*) # F - (( after for
if [[ $braces_stack = F* ]]; then
-fast-highlight-string
_mybuf=$__arg
__idx=_start_pos
while [[ $_mybuf = (#b)[^a-zA-Z\{\$]#([a-zA-Z][a-zA-Z0-9]#)(*) ]]; do
(( __start=__idx-__PBUFLEN+${mbegin[1]}-1, __end=__idx-__PBUFLEN+${mend[1]}+1-1, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}for-loop-variable]}")
__idx+=${mend[1]}
_mybuf=${match[2]}
done
_mybuf=$__arg
__idx=_start_pos
while [[ $_mybuf = (#b)[^+\<\>=:\*\|\&\^\~-]#([+\<\>=:\*\|\&\^\~-]##)(*) ]]; do
(( __start=__idx-__PBUFLEN+${mbegin[1]}-1, __end=__idx-__PBUFLEN+${mend[1]}+1-1, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}for-loop-operator]}")
__idx+=${mend[1]}
_mybuf=${match[2]}
done
_mybuf=$__arg
__idx=_start_pos
while [[ $_mybuf = (#b)[^0-9]#([0-9]##)(*) ]]; do
(( __start=__idx-__PBUFLEN+${mbegin[1]}-1, __end=__idx-__PBUFLEN+${mend[1]}+1-1, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}for-loop-number]}")
__idx+=${mend[1]}
_mybuf=${match[2]}
done
if [[ $__arg = (#b)[^\;]#(\;)[\ ]# ]]; then
(( __start=_start_pos-__PBUFLEN+${mbegin[1]}-1, __end=_start_pos-__PBUFLEN+${mend[1]}+1-1, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}for-loop-separator]}")
fi
already_added=1
elif [[ $__arg = *([^\\][\#][\#]|"(#b)"|"(#B)"|"(#m)"|"(#c")* ]]; then
(( highlight_glob )) && __style=${FAST_THEME_NAME}globbing-ext || __style=${FAST_THEME_NAME}default
elif [[ $__arg = ([*?]*|*[^\\][*?]*) ]]; then
(( highlight_glob )) && __style=${FAST_THEME_NAME}globbing || __style=${FAST_THEME_NAME}default
elif [[ $__arg = \$* ]]; then
__style=${FAST_THEME_NAME}variable
elif [[ $__arg = $'\x7d' && $braces_stack = Y* && ${FAST_HIGHLIGHT[right_brace_is_recognised_everywhere]} = "1" ]]; then
# right brace, i.e. $'\x7d' == '}'
# Parsing rule: # {
#
# Additionally, `tt(})' is recognized in any position if neither the
# tt(IGNORE_BRACES) option nor the tt(IGNORE_CLOSE_BRACES) option is set."""
braces_stack=${braces_stack#Y}
__style=${FAST_THEME_NAME}reserved-word
(( next_word = next_word | 16 ))
elif [[ $__arg = (';;'|';&'|';|') ]] && (( this_word & BIT_case_code )); then
(( next_word = (next_word | BIT_case_item) & ~(BIT_case_code+3) ))
__style=${FAST_THEME_NAME}default
elif [[ $__arg = ${histchars[1]}* && -n ${__arg[2]} ]]; then
__style=${FAST_THEME_NAME}history-expansion
elif (( __arg_type == 3 )); then
__style=${FAST_THEME_NAME}commandseparator
elif (( in_redirection == 2 )); then
__style=${FAST_THEME_NAME}redirection
elif (( ${+galiases[(e)$__arg]} )); then
__style=${FAST_THEME_NAME}global-alias
else
if [[ ${FAST_HIGHLIGHT[no_check_paths]} != 1 ]]; then
if [[ ${FAST_HIGHLIGHT[use_async]} != 1 ]]; then
if -fast-highlight-check-path noasync; then
# ADD
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
already_added=1
# TODO: path separators, optimize and add to async code-path
[[ -n ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]} && ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path]} != ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]} ]] && {
for (( __pos = _start_pos; __pos <= _end_pos; __pos++ )) ; do
# ADD
[[ ${__buf[__pos]} == "/" ]] && (( __start=__pos-__PBUFLEN, __start >= 0 )) && reply+=("$(( __start - 1 )) $__start ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]}")
done
}
else
__style=${FAST_THEME_NAME}default
fi
else
if [[ -z ${FAST_HIGHLIGHT[cache-path-${(q)__arg}-${_start_pos}]} || $(( EPOCHSECONDS - FAST_HIGHLIGHT[cache-path-${(q)__arg}-${_start_pos}-born-at] )) -gt 8 ]]; then
if [[ $LASTWIDGET != *-or-beginning-search ]]; then
exec {PCFD}< <(-fast-highlight-check-path; sleep 5)
command sleep 0
FAST_HIGHLIGHT[path-queue]+=";$_start_pos $_end_pos;"
is-at-least 5.0.6 && __pos=1 || __pos=0
zle -F ${${__pos:#0}:+-w} $PCFD fast-highlight-check-path-handler
already_added=1
else
__style=${FAST_THEME_NAME}default
fi
elif [[ ${FAST_HIGHLIGHT[cache-path-${(q)__arg}-${_start_pos}]%D} -eq 1 ]]; then
(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path${${(M)FAST_HIGHLIGHT[cache-path-${(q)__arg}-${_start_pos}]%D}:+-to-dir}]}")
already_added=1
else
__style=${FAST_THEME_NAME}default
fi
fi
else
__style=${FAST_THEME_NAME}default
fi
fi
;;
esac
elif (( this_word & 128 ))
then
(( next_word = (next_word | 2) & ~129 ))
[[ ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}here-string-text]} != "none" ]] && (( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}here-string-text]}")
-fast-highlight-string ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}here-string-var]:#none}
already_added=1
elif (( this_word & (BIT_case_preamble + BIT_case_item) ))
then
if (( this_word & BIT_case_preamble )); then
[[ $__arg = "in" ]] && {
__style=${FAST_THEME_NAME}reserved-word
(( next_word = BIT_case_item ))
} || {
__style=${FAST_THEME_NAME}case-input
(( next_word = BIT_case_preamble ))
}
else
if (( this_word & BIT_case_nempty_item == 0 )) && [[ $__arg = "esac" ]]; then
(( next_word = 1 ))
__style=${FAST_THEME_NAME}reserved-word
elif [[ $__arg = [\)\(] ]]; then
__style=${FAST_THEME_NAME}case-parentheses
[[ $__arg = \) ]] && (( next_word = BIT_case_code | 1 )) || (( next_word = BIT_case_item | BIT_case_nempty_item ))
_FAST_COMPLEX_BRACKETS+=( $(( _start_pos-__PBUFLEN )) )
else
(( next_word = BIT_case_item | BIT_case_nempty_item ))
__style=${FAST_THEME_NAME}case-condition
fi
fi
fi
# ADD
(( already_added == 0 )) && [[ ${FAST_HIGHLIGHT_STYLES[$__style]} != "none" ]] && (( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
if (( (__arg_type == 3) && ((this_word & (BIT_case_preamble|BIT_case_item)) == 0) )); then
if [[ $__arg == ';' ]] && (( in_array_assignment )); then
# literal newline inside an array assignment
(( next_word = 2 | (next_word & BIT_case_code) ))
elif [[ -n ${braces_stack[(r)A]} ]]; then
# 'A' in stack -> inside [[ ... ]]
(( next_word = 2 | (next_word & BIT_case_code) ))
else
braces_stack=${braces_stack#T}
(( next_word = 1 | (next_word & BIT_case_code) ))
highlight_glob=1
# A new command means that we should not expect that alternate
# syntax will occur (this is also in the ';' short-path), but
# || and && mean going down just 1 step, not all the way to 0
[[ $__arg != ("||"|"&&") ]] && __delimited=0 || (( __delimited = __delimited == 2 ? 1 : __delimited ))
fi
elif (( ( (__arg_type == 1) || (__arg_type == 2) ) && (this_word & 1) )); then # (( __arg_type == 1 || __arg_type == 2 )) && (( this_word & 1 ))
__delimited=1
(( next_word = 1 | (next_word & (64 | BIT_case_code)) ))
elif [[ $__arg == "repeat" ]] && (( this_word & 1 )); then
__delimited=1
# skip the repeat-count word
in_redirection=2
# The redirection mechanism assumes $this_word describes the word
# following the redirection. Make it so.
#
# That word can be a command word with shortloops (`repeat 2 ls`)
# or a command separator (`repeat 2; ls` or `repeat 2; do ls; done`).
#
# The repeat-count word will be handled like a redirection target.
(( this_word = 3 ))
fi
_start_pos=$_end_pos
# This is the default/common codepath.
(( this_word = in_redirection == 0 ? next_word : this_word )) #else # Stall $this_word.
done
# Do we have whole buffer? I.e. start at zero
[[ $3 != 0 ]] && return 0
# The loop overwrites ")" with "x", except those from $( ) substitution
#
# __pos: current nest level, starts from 0
# __workbuf: copy of __buf, with limit on 250 characters
# __idx: index in whole command line buffer
# __list: list of coordinates of ) which shouldn't be ovewritten
_mybuf=${__buf[1,250]} __workbuf=$_mybuf __idx=0 __pos=0 __list=()
while [[ $__workbuf = (#b)[^\(\)]#([\(\)])(*) ]]; do
if [[ ${match[1]} == \( ]]; then
__arg=${_mybuf[__idx+${mbegin[1]}-1,__idx+${mbegin[1]}-1+2]}
[[ $__arg = '$('[^\(] ]] && __list+=( $__pos )
[[ $__arg = '$((' ]] && _mybuf[__idx+${mbegin[1]}-1]=x
# Increase parenthesis level
__pos+=1
else
# Decrease parenthesis level
__pos=__pos-1
[[ -z ${__list[(r)$__pos]} ]] && [[ $__pos -gt 0 ]] && _mybuf[__idx+${mbegin[1]}]=x
fi
__idx+=${mbegin[2]}-1
__workbuf=${match[2]}
done
# Run on fake buffer with replaced parentheses: ")" into "x"
__inputs=( ${(0)${(S)_mybuf//(#b)*\$\(([^\)]#)(\)|(#e))/${mbegin[1]};${mend[1]}${__nul}}%$__nul*} )
if [[ ${__inputs[1]} != $_mybuf ]]; then
if [[ -n ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}secondary]} ]]; then
__idx=1
__tmp=$FAST_THEME_NAME
FAST_THEME_NAME=${${${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}secondary]}:t:r}#(XDG|LOCAL|HOME|OPT):}
(( ${+FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}default]} )) || source $FAST_WORK_DIR/secondary_theme.zsh
else
__idx=0
fi
for _mybuf in $__inputs; do
(( __start=${_mybuf%%;*}-__PBUFLEN-1, __end=${_mybuf##*;}-__PBUFLEN, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${__tmp}recursive-base]}")
# Pass authentic buffer for recursive analysis
-fast-highlight-process "$PREBUFFER" "${__buf[${_mybuf%%;*},${_mybuf##*;}]}" $(( ${_mybuf%%;*} - 1 ))
done
# Restore theme
(( __idx )) && FAST_THEME_NAME=$__tmp
fi
return 0
}
-fast-highlight-check-path()
{
[[ $1 != "noasync" ]] && {
print -r -- ${sysparams[pid]}
# This is to fill cache
print -r -- $__arg
}
: ${expanded_path:=${(Q)~__arg}}
[[ -n ${FAST_BLIST_PATTERNS[(k)${${(M)expanded_path:#/*}:-$PWD/$expanded_path}]} ]] && { [[ $1 != "noasync" ]] && print -r -- "- $_start_pos $_end_pos"; return 1; }
[[ -z $expanded_path ]] && { [[ $1 != "noasync" ]] && print -r -- "- $_start_pos $_end_pos"; return 1; }
[[ -d $expanded_path ]] && { [[ $1 != "noasync" ]] && print -r -- "$_start_pos ${_end_pos}D" || __style=${FAST_THEME_NAME}path-to-dir; return 0; }
[[ -e $expanded_path ]] && { [[ $1 != "noasync" ]] && print -r -- "$_start_pos $_end_pos" || __style=${FAST_THEME_NAME}path; return 0; }
# Search the path in CDPATH, only for CD command
[[ $active_command = "cd" ]] && for cdpath_dir in $cdpath; do
[[ -d $cdpath_dir/$expanded_path ]] && { [[ $1 != "noasync" ]] && print -r -- "$_start_pos ${_end_pos}D" || __style=${FAST_THEME_NAME}path-to-dir; return 0; }
[[ -e $cdpath_dir/$expanded_path ]] && { [[ $1 != "noasync" ]] && print -r -- "$_start_pos $_end_pos" || __style=${FAST_THEME_NAME}path; return 0; }
done
# It's not a path.
[[ $1 != "noasync" ]] && print -r -- "- $_start_pos $_end_pos"
return 1
}
-fast-highlight-check-path-handler() {
local IFS=$'\n' pid PCFD=$1 line stripped val
integer idx
if read -r -u $PCFD pid; then
if read -r -u $PCFD val; then
if read -r -u $PCFD line; then
stripped=${${line#- }%D}
FAST_HIGHLIGHT[cache-path-${(q)val}-${stripped%% *}-born-at]=$EPOCHSECONDS
idx=${${FAST_HIGHLIGHT[path-queue]}[(I)$stripped]}
(( idx > 0 )) && {
if [[ $line != -* ]]; then
FAST_HIGHLIGHT[cache-path-${(q)val}-${stripped%% *}]="1${(M)line%D}"
region_highlight+=("${line%% *} ${${line##* }%D} ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path${${(M)line%D}:+-to-dir}]}")
else
FAST_HIGHLIGHT[cache-path-${(q)val}-${stripped%% *}]=0
fi
val=${FAST_HIGHLIGHT[path-queue]}
val[idx-1,idx+${#stripped}]=""
FAST_HIGHLIGHT[path-queue]=$val
[[ ${FAST_HIGHLIGHT[cache-path-${(q)val}-${stripped%% *}]%D} = 1 && ${#val} -le 27 ]] && zle .redisplay
}
fi
fi
kill -9 $pid 2>/dev/null
fi
zle -F -w ${PCFD}
exec {PCFD}<&-
}
zle -N -- fast-highlight-check-path-handler -fast-highlight-check-path-handler
# Highlight special blocks inside double-quoted strings
#
# The while [[ ... ]] pattern is logically ((A)|(B)|(C)|(D)|(E))(*), where:
# - A matches $var[abc]
# - B matches ${(...)var[abc]}
# - C matches $
# - D matches \$ or \" or \'
# - E matches \*
#
# and the first condition -n ${match[7] uses D to continue searching when
# backslash-something (not ['"$]) is occured.
#
# $1 - additional style to glue-in to added style
-fast-highlight-string()
{
_mybuf=$__arg
__idx=_start_pos
# 7 8
while [[ $_mybuf = (#b)[^\$\\]#((\$(#B)([#+^=~](#c1,2))(#c0,1)(#B)([a-zA-Z_:][a-zA-Z0-9_:]#|[0-9]##)(#b)(\[[^\]]#\])(#c0,1))|(\$[{](#B)([#+^=~](#c1,2))(#c0,1)(#b)(\([a-zA-Z0-9_:@%#]##\))(#c0,1)[a-zA-Z0-9_:#]##(\[[^\]]#\])(#c0,1)[}])|\$|[\\][\'\"\$]|[\\](*))(*) ]]; do
[[ -n ${match[7]} ]] && {
# Skip following char – it is quoted. Choice is
# made to not highlight such quoting
__idx+=${mbegin[1]}+1
_mybuf=${match[7]:1}
} || {
__idx+=${mbegin[1]}-1
_end_idx=__idx+${mend[1]}-${mbegin[1]}+1
_mybuf=${match[8]}
# ADD
(( __start=__idx-__PBUFLEN, __end=_end_idx-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${${1:+$1}:-${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}back-or-dollar-double-quoted-argument]}}")
__idx=_end_idx
}
done
return 0
}
# Highlight math and non-math context variables inside $(( )) and (( ))
#
# The while [[ ... ]] pattern is logically ((A)|(B)|(C)|(D))(*), where:
# - A matches $var[abc]
# - B matches ${(...)var[abc]}
# - C matches $
# - D matches words [a-zA-Z]## (variables)
#
# Parameters used: _mybuf, __idx, _end_idx, __style
-fast-highlight-math-string()
{
_mybuf=$__arg
__idx=_start_pos
# 7
while [[ $_mybuf = (#b)[^\$_a-zA-Z0-9]#((\$(#B)(+|)(#B)([a-zA-Z_:][a-zA-Z0-9_:]#|[0-9]##)(#b)(\[[^\]]##\])(#c0,1))|(\$[{](#B)(+|)(#b)(\([a-zA-Z0-9_:@%#]##\))(#c0,1)[a-zA-Z0-9_:#]##(\[[^\]]##\])(#c0,1)[}])|\$|[a-zA-Z_][a-zA-Z0-9_]#|[0-9]##)(*) ]]; do
__idx+=${mbegin[1]}-1
_end_idx=__idx+${mend[1]}-${mbegin[1]}+1
_mybuf=${match[7]}
[[ ${match[1]} = [0-9]* ]] && __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}mathnum]} || {
[[ ${match[1]} = [a-zA-Z_]* ]] && {
[[ -n ${(P)match[1]} || ${FAST_ASSIGNS_SEEN[${match[1]}]} = 1 ]] && __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}mathvar]} || __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}matherr]}
} || {
[[ ${match[1]} = "$"* ]] && {
match[1]=${match[1]//[\{\}\+]/}
[[ ${match[1]} = "$" || -n ${(P)${match[1]:1}} || ${FAST_ASSIGNS_SEEN[${match[1]:1}]} = 1 ]] && __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}back-or-dollar-double-quoted-argument]} || __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}matherr]}
}
}
}
# ADD
[[ $__style != "none" && -n $__style ]] && (( __start=__idx-__PBUFLEN, __end=_end_idx-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end $__style")
__idx=_end_idx
done
}
# Highlight special chars inside dollar-quoted strings
-fast-highlight-dollar-string()
{
local i j k __style
local AA
integer c
# Starting dollar-quote is at 1:2, so __start parsing at offset 3 in the string.
for (( i = 3 ; i < _end_pos - _start_pos ; i += 1 )) ; do
(( j = i + _start_pos - 1 ))
(( k = j + 1 ))
case ${__arg[$i]} in
"\\") __style=${FAST_THEME_NAME}back-dollar-quoted-argument
for (( c = i + 1 ; c <= _end_pos - _start_pos ; c += 1 )); do
[[ ${__arg[$c]} != ([0-9xXuUa-fA-F]) ]] && break
done
AA=$__arg[$i+1,$c-1]
# Matching for HEX and OCT values like \0xA6, \xA6 or \012
if [[ "$AA" =~ "^(x|X)[0-9a-fA-F]{1,2}"
|| "$AA" =~ "^[0-7]{1,3}"
|| "$AA" =~ "^u[0-9a-fA-F]{1,4}"
|| "$AA" =~ "^U[0-9a-fA-F]{1,8}"
]]; then
(( k += $#MATCH ))
(( i += $#MATCH ))
else
if (( __asize > i+1 )) && [[ $__arg[i+1] == [xXuU] ]]; then
# \x not followed by hex digits is probably an error
__style=${FAST_THEME_NAME}unknown-token
fi
(( k += 1 )) # Color following char too.
(( i += 1 )) # Skip parsing the escaped char.
fi
;;
*) continue ;;
esac
# ADD
(( __start=j-__PBUFLEN, __end=k-__PBUFLEN, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
done
}
-fast-highlight-init() {
_FAST_COMPLEX_BRACKETS=()
__fast_highlight_main__command_type_cache=()
}
typeset -ga FSH_LIST
-fsh_sy_h_shappend() {
FSH_LIST+=( "$(( $1 - 1 ));;$(( $2 ))" )
}
functions -M fsh_sy_h_append 2 2 -fsh_sy_h_shappend 2>/dev/null
# vim:ft=zsh:sw=2:sts=2
# vim:ft=zsh:sw=4:sts=4
#
# $1 - PREBUFFER
# $2 - BUFFER
#
function -fast-highlight-string-process {
emulate -LR zsh
setopt extendedglob warncreateglobal typesetsilent
local -A pos_to_level level_to_pos pair_map final_pairs
local input=$1$2 _mybuf=$1$2 __style __quoting
integer __idx=0 __pair_idx __level=0 __start __end
local -a match mbegin mend
pair_map=( "(" ")" "{" "}" "[" "]" )
while [[ $_mybuf = (#b)[^"{}()[]\\\"'"]#((["({[]})\"'"])|[\\](*))(*) ]]; do
[[ -n ${match[3]} ]] && {
__idx+=${mbegin[1]}
[[ $__quoting = \' ]] && _mybuf=${match[3]} || { _mybuf=${match[3]:1}; (( ++ __idx )); }
} || {
__idx+=${mbegin[1]}
[[ -z $__quoting && -z ${_FAST_COMPLEX_BRACKETS[(r)$((__idx-${#PREBUFFER}-1))]} ]] && {
if [[ ${match[1]} = ["({["] ]]; then
pos_to_level[$__idx]=$(( ++__level ))
level_to_pos[$__level]=$__idx
elif [[ ${match[1]} = ["]})"] ]]; then
if (( __level > 0 )); then
__pair_idx=${level_to_pos[$__level]}
pos_to_level[$__idx]=$(( __level -- ))
[[ ${pair_map[${input[__pair_idx]}]} = ${input[__idx]} ]] && {
final_pairs[$__idx]=$__pair_idx
final_pairs[$__pair_idx]=$__idx
}
else
pos_to_level[$__idx]=-1
fi
fi
}
[[ ${match[1]} = \" && $__quoting != \' ]] && { [[ $__quoting = '"' ]] && __quoting="" || __quoting='"'; }
[[ ${match[1]} = \' && $__quoting != \" ]] && { [[ $__quoting = "'" ]] && __quoting="" || __quoting="'"; }
_mybuf=${match[4]}
}
done
for __idx in ${(k)pos_to_level}; do
(( ${+final_pairs[$__idx]} )) && __style=${FAST_THEME_NAME}bracket-level-$(( ( (pos_to_level[$__idx]-1) % 3 ) + 1 )) || __style=${FAST_THEME_NAME}unknown-token
(( __start=__idx-${#PREBUFFER}-1, __end=__idx-${#PREBUFFER}, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
done
# If cursor is on a bracket, then highlight corresponding bracket, if any.
if [[ $WIDGET != zle-line-finish ]]; then
__idx=$(( CURSOR + 1 ))
if (( ${+pos_to_level[$__idx]} )) && (( ${+final_pairs[$__idx]} )); then
(( __start=final_pairs[$__idx]-${#PREBUFFER}-1, __end=final_pairs[$__idx]-${#PREBUFFER}, __start >= 0 )) && \
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}paired-bracket]}") && \
reply+=("$CURSOR $__idx ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}paired-bracket]}")
fi
fi
return 0
}
Broken Pipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment