├── .gitignore ├── .github ├── CODEOWNERS ├── workflows │ ├── sync-labels.yml │ ├── trunk_check.yml │ └── run.yml ├── dependabot.yml └── ISSUE_TEMPLATE │ ├── request-to-add-zshrc.md │ ├── config.yml │ └── 01_bug_report.yml ├── docs ├── zi_playground.gif └── README.md ├── profiles ├── NICHOLAS85 │ ├── .zi │ │ └── plugins │ │ │ └── _local---config-files │ │ │ ├── functions │ │ │ ├── kate │ │ │ ├── chpwd_ls │ │ │ ├── history-stat │ │ │ ├── apt-history │ │ │ ├── whichedit │ │ │ ├── autoenv-files │ │ │ ├── mcsvr │ │ │ ├── dotscheck │ │ │ ├── zicompinit_fast │ │ │ └── sudo │ │ │ ├── completions │ │ │ ├── err_ggrep │ │ │ ├── _gebaard │ │ │ ├── _tlp-stat │ │ │ ├── _dynamicwall │ │ │ ├── _nl │ │ │ ├── _colorls │ │ │ ├── _clight │ │ │ └── _groff │ │ │ ├── README.md │ │ │ ├── patches │ │ │ ├── zsh-dircycle.patch │ │ │ ├── LS_COLORS.patch │ │ │ ├── rm-trash.patch │ │ │ └── fz.patch │ │ │ ├── LICENSE │ │ │ ├── config-files.plugin.zsh │ │ │ └── themes │ │ │ └── dolphin-post.zsh │ ├── .zshenv │ ├── bootstrap.sh │ └── .zshrc ├── psprint │ ├── .zshenv │ ├── functions │ │ ├── f1rechg │ │ ├── optlbin_on │ │ ├── t1uncolor │ │ ├── f1rechg_x_min │ │ ├── is_macports │ │ ├── x1iso2dmg │ │ ├── localbin_on │ │ ├── zman │ │ ├── n1ling │ │ ├── localbin_off │ │ ├── n1dict │ │ ├── optlbin_off │ │ ├── setopt │ │ ├── n1ggw3m │ │ ├── n1gglinks │ │ ├── n1diki │ │ ├── g1zip │ │ ├── psffconv │ │ ├── exchange │ │ ├── pscopy_xauth │ │ ├── psfind │ │ ├── .gitignore │ │ ├── g1all │ │ ├── psrecompile │ │ ├── t1fromhex │ │ ├── psls │ │ ├── f1biggest │ │ ├── mandelbrot │ │ ├── psprobe_host │ │ ├── pngimage │ │ ├── t1countdown │ │ ├── LICENSE │ │ ├── deploy-code │ │ ├── pssetup_ssl_cert │ │ ├── n1ssl_rtunnel │ │ ├── n1ssl_tunnel │ │ ├── pslist │ │ ├── README.md │ │ └── acc_print │ ├── bootstrap.sh │ └── zshrc.zsh ├── lainiwa │ ├── 1st_config │ │ ├── .zshenv │ │ ├── .zsh │ │ │ ├── prompts.zsh │ │ │ ├── set_history.zsh │ │ │ ├── other │ │ │ │ └── command-not-found.zsh │ │ │ ├── completions.zsh │ │ │ ├── aliases.zsh │ │ │ ├── completions │ │ │ │ └── _my │ │ │ └── zi.zsh │ │ └── .zshrc │ └── 2nd_config │ │ ├── .zshenv │ │ ├── .zsh │ │ ├── prompts.zsh │ │ ├── set_history.zsh │ │ ├── other │ │ │ └── command-not-found.zsh │ │ ├── completions.zsh │ │ ├── aliases.zsh │ │ ├── completions │ │ │ └── _my │ │ └── zinit.zsh │ │ └── .zshrc ├── z-shell │ ├── meta-loader │ │ ├── .zshenv │ │ ├── bootstrap.sh │ │ └── .zshrc │ └── kickstart │ │ └── .zshrc ├── agkozak │ ├── .zprofile │ ├── .zshenv │ ├── .profile │ └── .shrc ├── jubi │ ├── bootstrap.sh │ └── .zshrc ├── brucebentley │ ├── .zshenv │ └── zshrc.zsh ├── jwdevelab │ └── .zshrc ├── dominik-schwabe │ └── .zshrc ├── numToStr │ └── zshrc.zsh └── colerar │ └── zshrc.zsh ├── .trunk ├── .gitignore ├── configs │ ├── .hadolint.yaml │ ├── .shellcheckrc │ ├── .yamllint.yaml │ └── .markdownlint.yaml └── trunk.yaml ├── playground.plugin.zsh ├── .vscode └── settings.json ├── run.sh ├── LICENSE └── Dockerfile /.gitignore: -------------------------------------------------------------------------------- 1 | *.zwc 2 | ._zi* -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @z-shell/zplugin -------------------------------------------------------------------------------- /docs/zi_playground.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/z-shell/playground/HEAD/docs/zi_playground.gif -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/kate: -------------------------------------------------------------------------------- 1 | command kate "${@}" &! 2 | -------------------------------------------------------------------------------- /profiles/psprint/.zshenv: -------------------------------------------------------------------------------- 1 | # Skip the not really helping Ubuntu global compinit 2 | skip_global_compinit=1 3 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zshenv: -------------------------------------------------------------------------------- 1 | # Skip the not really helping Ubuntu global compinit 2 | skip_global_compinit=1 3 | -------------------------------------------------------------------------------- /.trunk/.gitignore: -------------------------------------------------------------------------------- 1 | *out 2 | *logs 3 | *actions 4 | *notifications 5 | plugins 6 | user_trunk.yaml 7 | user.yaml 8 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/chpwd_ls: -------------------------------------------------------------------------------- 1 | emulate -L zsh 2 | lsd --group-dirs=first 3 | -------------------------------------------------------------------------------- /profiles/lainiwa/1st_config/.zshenv: -------------------------------------------------------------------------------- 1 | # Skip the not really helping Ubuntu global compinit 2 | skip_global_compinit=1 3 | -------------------------------------------------------------------------------- /profiles/lainiwa/2nd_config/.zshenv: -------------------------------------------------------------------------------- 1 | # Skip the not really helping Ubuntu global compinit 2 | skip_global_compinit=1 3 | -------------------------------------------------------------------------------- /profiles/z-shell/meta-loader/.zshenv: -------------------------------------------------------------------------------- 1 | # Skip the not really helping Ubuntu global compinit 2 | skip_global_compinit=1 3 | -------------------------------------------------------------------------------- /.trunk/configs/.hadolint.yaml: -------------------------------------------------------------------------------- 1 | # Following source doesn't work in most setups 2 | ignored: 3 | - SC1090 4 | - SC1091 5 | - DL3008 6 | -------------------------------------------------------------------------------- /playground.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Directory of the script 2 | CURRENT_DIR=${0:a:h} 3 | 4 | playground() { 5 | "${CURRENT_DIR}"/run.sh 6 | } 7 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/history-stat: -------------------------------------------------------------------------------- 1 | fc -ln 0 | awk '{print $1}' | sort | uniq -c | sort -nr | head 2 | -------------------------------------------------------------------------------- /profiles/agkozak/.zprofile: -------------------------------------------------------------------------------- 1 | # ~/.zprofile 2 | # 3 | # https://github.com/agkozak/dotfiles 4 | 5 | [[ -f ${HOME}/.profile ]] && source "${HOME}/.profile" 6 | -------------------------------------------------------------------------------- /profiles/psprint/functions/f1rechg: -------------------------------------------------------------------------------- 1 | # DESC: Finds files changed in last 15 minutes 2 | 3 | find . -newerct "15 minute ago" -print 4 | 5 | # vim:ft=zsh:et 6 | -------------------------------------------------------------------------------- /profiles/psprint/functions/optlbin_on: -------------------------------------------------------------------------------- 1 | # DESC: Adds /opt/local/bin to $PATH 2 | 3 | optlbin_off 4 | PATH=/opt/local/bin:$PATH 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /profiles/psprint/functions/t1uncolor: -------------------------------------------------------------------------------- 1 | # DESC: Perl invocation to strip color codes (use in pipe) 2 | 3 | perl -pe 's/\e\[?.*?[\@-~]//g' 4 | 5 | # vim:ft=zsh 6 | -------------------------------------------------------------------------------- /profiles/psprint/functions/f1rechg_x_min: -------------------------------------------------------------------------------- 1 | # DESC: Finds files changed in last "$1" minutes 2 | 3 | find . -newerct "$1 minute ago" -print 4 | 5 | # vim:ft=zsh:et 6 | -------------------------------------------------------------------------------- /profiles/psprint/functions/is_macports: -------------------------------------------------------------------------------- 1 | # DESC: Tests if $PATH contains /opt/local/bin 2 | 3 | [[ -n "${(j::)${(M)path[@]:#/opt/local/bin}}" ]] 4 | 5 | # vim:ft=zsh:et 6 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/apt-history: -------------------------------------------------------------------------------- 1 | zcat -qf /var/log/apt/history.log* | grep -Po '^Commandline: apt install (?!.*--reinstall)\K.*' 2 | -------------------------------------------------------------------------------- /profiles/psprint/functions/x1iso2dmg: -------------------------------------------------------------------------------- 1 | # DESC: Converts file $1 (iso) to ${1:r}.dmg 2 | 3 | hdiutil convert -format UDRW -o "${1%.iso}".dmg "${1}" 4 | 5 | # vim:ft=zsh:et 6 | -------------------------------------------------------------------------------- /profiles/psprint/functions/localbin_on: -------------------------------------------------------------------------------- 1 | # DESC: Adds /usr/local/{bin,sbin} to $PATH 2 | 3 | localbin_off 4 | PATH=$PATH:/usr/local/bin:/usr/local/sbin 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /profiles/psprint/functions/zman: -------------------------------------------------------------------------------- 1 | # DESC: Searches zshall with special keyword ($1) matching 2 | 3 | PAGER="less -g -s '+/^ "$1"'" command man zshall 4 | 5 | # vim:ft=zsh:et 6 | -------------------------------------------------------------------------------- /profiles/psprint/functions/n1ling: -------------------------------------------------------------------------------- 1 | # DESC: Queries ling.pl with $@ (w3m) 2 | 3 | search=`echo "$1+$2+$3+$4+$5+$6+$7+$8+$9" | sed 's:\+*$::'` 4 | w3m ling.pl/"$search" 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /profiles/z-shell/meta-loader/bootstrap.sh: -------------------------------------------------------------------------------- 1 | zi_config="${XDG_CONFIG_HOME:-${HOME}/.config}/zi" 2 | command mkdir -p "${zi_config}" 3 | curl -fsSL https://git.io/zi-loader -o "${zi_config}/init.zsh" 4 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/completions/err_ggrep: -------------------------------------------------------------------------------- 1 | No options found for ggrep. Was fetching from following invocation: `ggrep --help'. 2 | Program reacted with exit code: 127. 3 | -------------------------------------------------------------------------------- /profiles/psprint/functions/localbin_off: -------------------------------------------------------------------------------- 1 | # DESC: Removes /usr/local/{bin,sbin} from $PATH 2 | 3 | path=( "${path[@]:#/usr/local/bin}" ) 4 | path=( "${path[@]:#/usr/local/sbin}" ) 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /profiles/psprint/functions/n1dict: -------------------------------------------------------------------------------- 1 | # DESC: Queries dict.pl with $@ (w3m) 2 | 3 | search=`echo "$1+$2+$3+$4+$5+$6+$7+$8+$9" | sed 's:\+*$::'` 4 | w3m dict.pl/dict"?word=$search" 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /profiles/psprint/functions/optlbin_off: -------------------------------------------------------------------------------- 1 | # DESC: Removes /opt/local/{bin,sbin} from $PATH 2 | 3 | path=( "${path[@]:#/opt/local/bin}" ) 4 | path=( "${path[@]:#/opt/local/sbin}" ) 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /profiles/psprint/functions/setopt: -------------------------------------------------------------------------------- 1 | # DESC: A setopt wrapper with tracing to /tmp/setopt.log 2 | print -r - "$funcfiletrace[1]: $0 ${(q-)@}" >>! /tmp/setopt.log 3 | builtin $0 "$@" 4 | 5 | # vim:ft=zsh:et 6 | -------------------------------------------------------------------------------- /profiles/psprint/functions/n1ggw3m: -------------------------------------------------------------------------------- 1 | # DESC: Queries google.com with $@ (w3m) 2 | 3 | search=`echo "$1+$2+$3+$4+$5+$6+$7+$8+$9" | sed 's:\+*$::'` 4 | w3m google.com/search\?q="$search" 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /profiles/psprint/functions/n1gglinks: -------------------------------------------------------------------------------- 1 | # DESC: Queries google.com with $@ (links) 2 | 3 | search=`echo "$1+$2+$3+$4+$5+$6+$7+$8+$9" | sed 's:\+*$::'` 4 | links google.com/search\?q="$search" 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /profiles/psprint/functions/n1diki: -------------------------------------------------------------------------------- 1 | # DESC: Queries diki.pl with $@ (w3m) 2 | 3 | search=`echo "$1+$2+$3+$4+$5+$6+$7+$8+$9" | sed 's:\+*$::'` 4 | w3m www.diki.pl/slownik-angielskiego/"?q=$search" 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /profiles/jubi/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | case $(uname) in 4 | Darwin) 5 | brew install fzf 6 | ;; 7 | Linux) 8 | # No such package 9 | # sudo apt install fzf 10 | : 11 | ;; 12 | *) 13 | : 14 | ;; 15 | esac 16 | -------------------------------------------------------------------------------- /.trunk/configs/.shellcheckrc: -------------------------------------------------------------------------------- 1 | enable=all 2 | source-path=SCRIPTDIR 3 | disable=SC2154 4 | 5 | # If you're having issues with shellcheck following source, disable the errors via: 6 | disable=SC1090 7 | disable=SC1091 8 | disable=SC1071 9 | disable=SC2148 10 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/whichedit: -------------------------------------------------------------------------------- 1 | local fulldir="$(which ${1})" 2 | 3 | if file -b -L --mime-type "${fulldir}" | grep -q "text/"; then 4 | "${EDITOR}" "${fulldir}" 5 | else 6 | echo "Not a text file, not editing..." 7 | fi 8 | -------------------------------------------------------------------------------- /profiles/psprint/functions/g1zip: -------------------------------------------------------------------------------- 1 | # DESC: Creates `basename $(pwd)`-$(date ...) archive 2 | 3 | local f=`basename $(pwd)`-`date +%Y%m%d` 4 | command rm -vf "$f".zip 5 | command git archive --output "$f".zip --prefix "$f/" master 6 | command du "$f".zip 7 | 8 | # vim:ft=zsh:et 9 | -------------------------------------------------------------------------------- /profiles/psprint/functions/psffconv: -------------------------------------------------------------------------------- 1 | # DESC: Converts (ffmpeg) file $1 to $2, or $1 to ${1:r}.mp4 2 | 3 | if [[ "$2" != "" ]]; then 4 | command ffmpeg -i "$1" -qscale 0 "$2" 5 | else 6 | command ffmpeg -i "$1" -qscale 0 "${1:r}.mp4" 7 | fi 8 | 9 | # vim:ft=zsh:et 10 | -------------------------------------------------------------------------------- /.github/workflows/sync-labels.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "♻️ Sync Labels" 3 | 4 | on: 5 | schedule: 6 | - cron: "22 2 * * 2" 7 | workflow_dispatch: 8 | 9 | jobs: 10 | labels: 11 | name: "♻️ Sync labels" 12 | uses: z-shell/.github/.github/workflows/sync-labels.yml@main 13 | -------------------------------------------------------------------------------- /profiles/psprint/functions/exchange: -------------------------------------------------------------------------------- 1 | [[ ! -e "$1" || ! -e "$2" ]] && { print -r -- "The args do not exist"; return 1; } 2 | 3 | local suffix=$(( RANDOM % 10000 )) 4 | mv -vf "$1" "$1"_"$suffix" 5 | mv -vf "$2" "$1" 6 | mv -vf "$1"_"$suffix" "$2" 7 | 8 | # vim:ft=zsh:et:sts=4:sw=4:wrap 9 | -------------------------------------------------------------------------------- /profiles/psprint/functions/pscopy_xauth: -------------------------------------------------------------------------------- 1 | # DESC: Copies xauth data to "$1" at "$2" 2 | 3 | local idx 4 | 5 | for idx in 0 1; do 6 | builtin print -- 'mac:'$idx to "$1"@"$2".. 7 | command xauth nextract - 'mac:'$idx | command ssh "$1"@"$2" xauth nmerge - 8 | done 9 | 10 | # vim:ft=zsh:et 11 | -------------------------------------------------------------------------------- /profiles/psprint/functions/psfind: -------------------------------------------------------------------------------- 1 | # DESC: Queries mdfind by kMDItemDisplayName; supports -i (case insensitive search) 2 | # vim:ft=zsh:et:sw=4:sts=4 3 | 4 | if [ $1 = "-i" ]; then 5 | shift 6 | mdfind "kMDItemDisplayName == '$@'c" 7 | else 8 | mdfind "kMDItemDisplayName == $@" 9 | fi 10 | -------------------------------------------------------------------------------- /.trunk/configs/.yamllint.yaml: -------------------------------------------------------------------------------- 1 | rules: 2 | quoted-strings: 3 | required: only-when-needed 4 | extra-allowed: ["{|}"] 5 | empty-values: 6 | forbid-in-block-mappings: true 7 | forbid-in-flow-mappings: true 8 | key-duplicates: {} 9 | octal-values: 10 | forbid-implicit-octal: true 11 | -------------------------------------------------------------------------------- /.trunk/configs/.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # Autoformatter friendly markdownlint config (all formatting rules disabled) 2 | default: true 3 | blank_lines: false 4 | bullet: false 5 | html: false 6 | indentation: false 7 | line_length: false 8 | spaces: false 9 | url: false 10 | whitespace: false 11 | MD041: false 12 | -------------------------------------------------------------------------------- /profiles/psprint/functions/.gitignore: -------------------------------------------------------------------------------- 1 | # Local functions, not to be commited 2 | lps* 3 | 4 | ### Zsh 5 | 6 | *.zwc 7 | *zcompdump* 8 | 9 | ### Vim 10 | # Swap 11 | [._]*.s[a-v][a-z] 12 | [._]*.sw[a-p] 13 | [._]s[a-v][a-z] 14 | [._]sw[a-p] 15 | 16 | # Session 17 | Session.vim 18 | 19 | # Temporary 20 | .netrwhist 21 | *~ 22 | # Auto-generated tag files 23 | tags 24 | -------------------------------------------------------------------------------- /profiles/psprint/functions/g1all: -------------------------------------------------------------------------------- 1 | # DESC: Iterates over *.git directories, runs git "$@" 2 | 3 | # Foreach *.git directory 4 | local PAUSE=0 i 5 | for i in *.git; do 6 | builtin echo -e "\n$i\n" 7 | LANG=C command sleep $PAUSE 8 | builtin cd -q "$i" 9 | command git "$@" 10 | builtin cd -q .. 11 | PAUSE="0.5" 12 | done 13 | 14 | # vim:ft=zsh:et 15 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/completions/_gebaard: -------------------------------------------------------------------------------- 1 | #compdef gebaard 2 | 3 | # zsh completions for 'gebaard' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | {-b,--background}'[daemonize]' 9 | {-h,--help}'[prints this help text]' 10 | '*:filename:_files' 11 | ) 12 | 13 | _arguments -s $arguments 14 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | command curl "https://sh.rustup.rs" -sSf | sh -s -- -y || true 4 | 5 | if [[ -f "${HOME}/.cargo/env" ]]; then 6 | print "source ${HOME}/.cargo/env" >>"${HOME}"/.zshenv 7 | source "${HOME}/.cargo/env" 8 | 9 | sudo apt update 10 | sudo DEBIAN_FRONTEND=noninteractive apt install --yes tlp lscolors fd-find fzf 11 | cargo install lsd 12 | fi 13 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/autoenv-files: -------------------------------------------------------------------------------- 1 | dirs=( $( { sed -e 's/:\(.*\):/\1/' $AUTOENV_AUTH_FILE } | sed 's/:.*//' | 2 | FZF_DEFAULT_OPTS="$FORGIT_FZF_DEFAULT_OPTS -0 -m --nth 2..,.. 3 | --preview='[[ \$(file --mime {}) =~ binary ]] && echo {} is a binary file || (bat --style=numbers --color=always {}) 2> /dev/null | head -500' 4 | $FORGIT_ADD_FZF_OPTS" fzf ) ) 5 | 6 | ${dirs:+kate} $dirs 7 | -------------------------------------------------------------------------------- /profiles/psprint/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | sudo apt update 4 | sudo DEBIAN_FRONTEND=noninteractive apt install --yes cmake redis-server libhiredis-dev \ 5 | tree gem libfreetype6-dev libfontconfig-dev autoconf automake nodejs npm 6 | 7 | # For zdharma/zredis 8 | sudo mkdir -p usr/local/var/db/redis 9 | 10 | # Install exa for ls aliases – currently not needed as 11 | # it is installed via zi 12 | #cargo install exa 13 | -------------------------------------------------------------------------------- /profiles/psprint/functions/psrecompile: -------------------------------------------------------------------------------- 1 | # DESC: Recompiles ~/.zshrc, ~/.zcompdump 2 | 3 | autoload -Uz zrecompile 4 | [[ -f ~/.zshrc ]] && zrecompile -p ~/.zshrc 5 | [[ -f ~/.zcompdump ]] && zrecompile -p ~/.zcompdump 6 | [[ -f ~/.zcompdump ]] && zrecompile -p ~/.zcompdump 7 | [[ -f ~/.zshrc.zwc.old ]] && command rm -f ~/.zshrc.zwc.old 8 | [[ -f ~/.zcompdump.zwc.old ]] && command rm -f ~/.zcompdump.zwc.old 9 | 10 | # vim:ft=zsh:et 11 | -------------------------------------------------------------------------------- /.github/workflows/trunk_check.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "⭕ Trunk" 3 | on: 4 | push: 5 | branches: [main] 6 | tags: ["v*.*.*"] 7 | pull_request: 8 | types: [opened, synchronize] 9 | workflow_dispatch: 10 | 11 | jobs: 12 | check: 13 | name: "⚡" 14 | uses: z-shell/.github/.github/workflows/trunk.yml@main 15 | secrets: 16 | trunk-token: ${{ secrets.TRUNK_TOKEN }} 17 | with: 18 | arguments: "--no-progress" 19 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | **Table of Contents** _generated with [DocToc](https://github.com/thlorenz/doctoc)_ 5 | 6 | - [config-files](#config-files) 7 | 8 | 9 | 10 | # config-files 11 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/mcsvr: -------------------------------------------------------------------------------- 1 | local svrdir="${HOME}/bin/minecraft/servers" dir 2 | 3 | [ -x $svrdir/$1/serverstartlinux.sh ] && dir="$svrdir/$1" || { 4 | dir=( $( echo $svrdir/* | tr ' ' '\n' | 5 | FZF_DEFAULT_OPTS="$FORGIT_FZF_DEFAULT_OPTS -0 --nth 2..,.. 6 | $FORGIT_ADD_FZF_OPTS" fzf ) ) 7 | } 8 | 9 | [ ! -z $dir ] && systemd-inhibit --who="mcsvr ${1:-${dir:t}}" --why="Running Minecraft Server" $dir/serverstartlinux.sh 10 | -------------------------------------------------------------------------------- /profiles/psprint/functions/t1fromhex: -------------------------------------------------------------------------------- 1 | # DESC: Converts hex-triplet into terminal color index 2 | 3 | local hex r g b 4 | 5 | hex=${${1#"#"}#0x} 6 | 7 | r="0x${hex[1,2]:-0}" 8 | g="0x${hex[3,4]:-0}" 9 | b="0x${hex[5,6]:-0}" 10 | 11 | val=$(printf -- '%03d\n' "$(( (r<75?0:(r-35)/40)*6*6 + 12 | (g<75?0:(g-35)/40)*6 + 13 | (b<75?0:(b-35)/40) + 16 ))" | tee >(pbcopy)) 14 | print -- "\e\[48\;5\;${val#0}m\e\[30m${val} TEST" 15 | # vim:ft=zsh:et 16 | -------------------------------------------------------------------------------- /profiles/lainiwa/1st_config/.zsh/prompts.zsh: -------------------------------------------------------------------------------- 1 | 2 | setopt PROMPT_SUBST # allow expansion in prompts 3 | 4 | # https://github.com/agkozak/agkozak-zsh-theme 5 | _is_ssh() { 6 | [[ -n "${SSH_CONNECTION-}${SSH_CLIENT-}${SSH_TTY-}" ]] 7 | } 8 | _is_ssh && host='%F{red}@%F{yellow}%m' || host='' 9 | 10 | export PS1="%B%F{yellow}%n${host}%F{red}: %F{green}%~ %F{red}%#%f%b " 11 | export PS2="%_> " 12 | export RPS1="%B%F{yellow}%(?..(%?%))%f%b" 13 | 14 | unset -f _is_ssh 15 | unset -v host 16 | -------------------------------------------------------------------------------- /profiles/lainiwa/2nd_config/.zsh/prompts.zsh: -------------------------------------------------------------------------------- 1 | 2 | setopt PROMPT_SUBST # allow expansion in prompts 3 | 4 | # https://github.com/agkozak/agkozak-zsh-theme 5 | _is_ssh() { 6 | [[ -n "${SSH_CONNECTION-}${SSH_CLIENT-}${SSH_TTY-}" ]] 7 | } 8 | _is_ssh && host='%F{red}@%F{yellow}%m' || host='' 9 | 10 | export PS1="%B%F{yellow}%n${host}%F{red}: %F{green}%~ %F{red}%#%f%b " 11 | export PS2="%_> " 12 | export RPS1="%B%F{yellow}%(?..(%?%))%f%b" 13 | 14 | unset -f _is_ssh 15 | unset -v host 16 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "docker" 9 | directory: "/" 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /profiles/psprint/functions/psls: -------------------------------------------------------------------------------- 1 | # DESC: `ls` or `ls -A`, depending on [[ -d .git ]] 2 | 3 | ls=exa 4 | 5 | [[ "$PWD" != "${PWD%Dropbox*}" ]] && echo -e '\x1b[5m\x1b[0m' 6 | if [[ ! -d _darcs && ! -d .git ]]; then 7 | # Normal 8 | $ls "$@" 9 | return 10 | fi 11 | 12 | if [[ "$PWD" = "$HOME" ]]; then 13 | # In $HOME - still normal 14 | $ls "$@" 15 | return 16 | fi 17 | 18 | # Full listing if in a git/darcs repository 19 | $ls -a "$@" 20 | 21 | # vim:ft=zsh:et 22 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/patches/zsh-dircycle.patch: -------------------------------------------------------------------------------- 1 | --- michaelxmcbride---zsh-dircycle/dircycle.zsh 2020-05-30 02:35:14.123391113 -0400 2 | +++ michaelxmcbride---zsh-dircycle/dircycle.zsh-patch 2020-05-30 02:39:33.544349578 -0400 3 | @@ -18,7 +18,9 @@ 4 | prompt_pure_async_tasks 5 | prompt_pure_preprompt_render 6 | else 7 | - zle reset-prompt 8 | + _p9k_precmd 9 | + zle .reset-prompt 10 | + zle -R 11 | fi 12 | } 13 | -------------------------------------------------------------------------------- /profiles/lainiwa/1st_config/.zsh/set_history.zsh: -------------------------------------------------------------------------------- 1 | 2 | export HISTFILE=~/.zsh_history 3 | export HISTSIZE=10000000 4 | export SAVEHIST=10000000 5 | 6 | setopt HIST_VERIFY 7 | setopt EXTENDED_HISTORY # save each command's beginning timestamp and the duration to the history file 8 | setopt HIST_IGNORE_ALL_DUPS 9 | setopt HIST_REDUCE_BLANKS 10 | setopt INC_APPEND_HISTORY # this is default, but set for share_history 11 | setopt SHARE_HISTORY # Share history file amongst all Zsh sessions 12 | -------------------------------------------------------------------------------- /profiles/lainiwa/2nd_config/.zsh/set_history.zsh: -------------------------------------------------------------------------------- 1 | 2 | export HISTFILE=~/.zsh_history 3 | export HISTSIZE=10000000 4 | export SAVEHIST=10000000 5 | 6 | setopt HIST_VERIFY 7 | setopt EXTENDED_HISTORY # save each command's beginning timestamp and the duration to the history file 8 | setopt HIST_IGNORE_ALL_DUPS 9 | setopt HIST_REDUCE_BLANKS 10 | setopt INC_APPEND_HISTORY # this is default, but set for share_history 11 | setopt SHARE_HISTORY # Share history file amongst all Zsh sessions 12 | -------------------------------------------------------------------------------- /profiles/psprint/functions/f1biggest: -------------------------------------------------------------------------------- 1 | # DESC: Size-sorts all descent files - finds biggest ones 2 | 3 | find 2>/dev/null . -type f -ls | 4 | sed -e "s/[[:blank:]][[:blank:]]*/ /g" -e 's/^ //' | 5 | cut -d" " -f 7,11- | sort -nr | head -25 | 6 | awk "{ printf \"%6d\", int( \$1/1048576 ); print \" MiB \" \$2 \" \" \$3 \" \" \$4 \" \" \$5 \" \" \$6 \" \" \$7 \" \" \$8 \" \" \$9 \" \" \$10 \" \" \$11 \" \" \$12 }" | 7 | sed -e "s:MiB \./:MiB :" -e "s:\\\ : :g" 8 | 9 | # vim:ft=zsh:et 10 | -------------------------------------------------------------------------------- /profiles/psprint/functions/mandelbrot: -------------------------------------------------------------------------------- 1 | # DESC: Draws mandelbrot fractal 2 | 3 | integer lines columns colour i=0 4 | float a b p q pnew delta1 delta2 5 | ((columns=COLUMNS-1, lines=LINES-1, colour=0)) 6 | for ((b=-1.5; b<=1.5; b+=3.0/lines)) do 7 | for ((a=-2.0; a<=1; a+=3.0/columns)) do 8 | for ((p=0.0, q=0.0, i=0; p*p+q*q < 4 && i < 32; i++)) do 9 | ((pnew=p*p-q*q+a, q=2*p*q+b, p=pnew)) 10 | done 11 | ((colour=(i/4)%8)) 12 | echo -n "\\e[4${colour}m " 13 | done 14 | echo 15 | done 16 | 17 | # vim:ft=zsh:et 18 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/dotscheck: -------------------------------------------------------------------------------- 1 | if [ -d $HOME/.dots ]; then 2 | local dotsvar1 dotsvar2 dotsvar3 dotsvar4 dotcmd 3 | dotcmd="/usr/bin/git --git-dir=$HOME/.dots/ --work-tree=$HOME" 4 | dotsvar1=("${dotsvar[@]/%/'}") 5 | dotsvar2=("${dotsvar1[@]/#/-e '}") 6 | dotsvar3=(grep -v "${dotsvar2[*]}") 7 | dotsvar4=$(eval $dotcmd ls-files --modified --deleted --exclude-standard | eval "${dotsvar3[*]}") 8 | if ! [ -z $dotsvar4 ]; then 9 | echo "" 10 | eval $dotcmd status -s 11 | else 12 | return 1 13 | fi 14 | fi 15 | -------------------------------------------------------------------------------- /profiles/psprint/functions/psprobe_host: -------------------------------------------------------------------------------- 1 | # DESC: Checks "$1" is alive, outputs also timestamp 2 | 3 | while (( 1 )); do 4 | command nmap --max-rtt-timeout 1250ms --host-timeout 100000ms --initial-rtt-timeout 600ms \ 5 | --max-retries 3 -sP "$1" | command grep -i "1 host up" > /dev/null 6 | if (( ! $? )); then 7 | builtin print -r -- $fg_bold[green]UP$reset_color" - "$(date); 8 | else 9 | builtin print -r -- $fg_bold[yellow]DOWN$reset_color" - "$(date); 10 | fi 11 | command sleep 1 12 | done 13 | 14 | # vim:ft=zsh:et 15 | -------------------------------------------------------------------------------- /profiles/psprint/functions/pngimage: -------------------------------------------------------------------------------- 1 | [[ -z "$1" ]] && { 2 | print -r -- "Missing argument – the output image name (path)" 3 | return 1 4 | } 5 | 6 | print -r -- pngquant ~"/Desktop/$( cd ~/Desktop; recently_changed_x 10 | sort -n | tail -1 )" 7 | pngquant ~"/Desktop/$( cd ~/Desktop; recently_changed_x 10 | sort -n | tail -1 )" 8 | print -r -- pngcrush ~"/Desktop/$( cd ~/Desktop; recently_changed_x 10 | grep -- -fs8 | sort -n | tail -1 )" "$1" 9 | pngcrush ~"/Desktop/$( cd ~/Desktop; recently_changed_x 10 | grep -- -fs8 | sort -n | tail -1 )" "$1" 10 | 11 | # vim:ft=zsh:sts=4:ts=4:et 12 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/completions/_tlp-stat: -------------------------------------------------------------------------------- 1 | #compdef tlp-stat 2 | 3 | # zsh completions for 'tlp-stat' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | {-d,--disk}'[| -e | --pcie |]' 9 | {-g,--graphics}'[| -p | --processor |]' 10 | {-r,--rfkill}'[| -s | --system |]' 11 | {-t,--temp}'[| -u | --usb |]' 12 | {-w,--warn}'[| -v | --verbose |]' 13 | {-P,--pev}'[| | --psup |]' 14 | {-T,--trace}'[]' 15 | '*:filename:_files' 16 | ) 17 | 18 | _arguments -s $arguments 19 | -------------------------------------------------------------------------------- /.github/workflows/run.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "▶️ Playground" 3 | 4 | on: 5 | workflow_dispatch: 6 | push: 7 | paths: 8 | - "profiles/**" 9 | 10 | jobs: 11 | play: 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | author: 16 | - "profiles/z-shell/meta-loader" 17 | - "profiles/z-shell/kickstart" 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@v3 21 | - name: "▶️ ${{matrix.author}}" 22 | run: | 23 | docker build --build-arg FOLDER="${{matrix.author}}" --build-arg TERM="${TERM}" -t "zi/${{ matrix.author }}" . 24 | -------------------------------------------------------------------------------- /profiles/brucebentley/.zshenv: -------------------------------------------------------------------------------- 1 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 | # 3 | # .zshenv 4 | # 5 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 | local dotdir="$HOME/.config/zsh" 7 | 8 | if [[ ! -f "$dotdir/.zshrc" ]] && [[ -f "$dotdir/zshrc" ]]; then 9 | ( 10 | cd "$dotdir" || exit; 11 | for f in *; do 12 | ln -s "$PWD/$f" "$PWD/.$f" 13 | done 14 | rm -rf .pkg .zsh 15 | ) 16 | elif [[ -f "$dotdir/.zshrc" ]]; then 17 | ZDOTDIR="$dotdir" 18 | else 19 | echo 'no zshrc' > $HOME/nozshrc 20 | fi 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/request-to-add-zshrc.md: -------------------------------------------------------------------------------- 1 | - [URL](#url) 2 | - [Username](#username) 3 | - [Zshrc body](#zshrc-body) 4 | 5 | --- 6 | 7 | name: Request to add zshrc to the playground repo 8 | about: Use this to submit a zshrc to the repo 9 | title: '' 10 | labels: '' 11 | assignees: '' 12 | 13 | --- 14 | 15 | # URL 16 | 17 | 18 | 19 | # Username 20 | 21 | 22 | 23 | # Zshrc body 24 | 25 | ```zsh 26 | # Paste here 27 | ``` 28 | 29 | 30 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/completions/_dynamicwall: -------------------------------------------------------------------------------- 1 | #compdef dynamicwall 2 | 3 | # zsh completions for 'dynamicwall' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | {-f,--force}'[update wallpaper immediately, optionally to a specific time]' 9 | {-p,--preview}'[run a 24 hour preview for a certain theme]' 10 | {-c,--config}'[edit your config file using your default editor]' 11 | {-s,--status}'[display systemd service status/crontab and system-sleep script log]' 12 | {-l,--list}'[list available themes to choose from]' 13 | {-h,--help}'[show help]' 14 | '*:filename:_files' 15 | ) 16 | 17 | _arguments -s $arguments 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | blank_issues_enabled: true 3 | contact_links: 4 | - name: ZI Wiki 5 | url: https://z.digitalclouds.dev 6 | about: Knowledge base. 7 | - name: Community Discussions 8 | url: https://github.com/orgs/z-shell/discussions 9 | about: Please ask and answer questions here. 10 | - name: Slack Workspace 11 | url: https://join.slack.com/t/z-shell/shared_invite/zt-16twpopd2-p08ROUeT2aGZ5njJwysawA 12 | about: Join to ask and answer questions or collaborate. 13 | - name: Crowdin Translations 14 | url: https://digitalclouds.crowdin.com/z-shell 15 | about: Join to participate in translations. 16 | - name: Z-Shell Portfolio 17 | url: https://github.zshell.dev/ 18 | about: Z-Shell organization portfolio and governance. 19 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "conventionalCommits.scopes": [ 3 | "maintenance", 4 | "workspace", 5 | "community", 6 | "general", 7 | "theme", 8 | "CI" 9 | ], 10 | "markdownlint.config": { 11 | "extends": ".github/.markdownlint.yaml" 12 | }, 13 | "files.associations": { 14 | "*za-default*": "zsh" 15 | }, 16 | "shellcheck.ignorePatterns": { 17 | "**/*.xonshrc": true, 18 | "**/*.xsh": true, 19 | "**/*.zsh": true, 20 | "**/*.zshrc": true, 21 | "**/zshrc": true, 22 | "**/*.zprofile": true, 23 | "**/zprofile": true, 24 | "**/*.zlogin": true, 25 | "**/zlogin": true, 26 | "**/*.zlogout": true, 27 | "**/zlogout": true, 28 | "**/*.zshenv": true, 29 | "**/zshenv": true, 30 | "**/*.zsh-theme": true, 31 | "**/*za-*": true 32 | }, 33 | "shellformat.useEditorConfig": true 34 | } 35 | -------------------------------------------------------------------------------- /.trunk/trunk.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | cli: 3 | version: 1.6.1 4 | plugins: 5 | sources: 6 | - id: trunk 7 | ref: v0.0.13 8 | uri: https://github.com/trunk-io/plugins 9 | repo: 10 | repo: 11 | host: github.com 12 | owner: z-shell 13 | name: playground 14 | lint: 15 | disabled: 16 | - yamllint 17 | enabled: 18 | - shfmt@3.5.0 19 | - actionlint@1.6.23 20 | - git-diff-check 21 | - gitleaks@8.16.1 22 | - hadolint@2.12.0 23 | - markdownlint@0.33.0 24 | - prettier@2.8.6 25 | - shellcheck@0.9.0 26 | ignore: 27 | - linters: [shellcheck] 28 | paths: 29 | - ./profiles/NICHOLAS85/bootstrap.sh 30 | runtimes: 31 | enabled: 32 | - go@1.19.5 33 | - node@18.12.1 34 | - python@3.10.8 35 | actions: 36 | enabled: 37 | - trunk-announce 38 | - trunk-check-pre-push 39 | - trunk-fmt-pre-commit 40 | - trunk-upgrade-available 41 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | set -o errexit # exit on fail 4 | set -o pipefail # catch errors in pipelines 5 | set -o nounset # exit on undeclared variable 6 | # set -o xtrace # trace execution 7 | 8 | # Folders containing `.zshrc` 9 | FOLDERS_WITH_ZSHRC=$( 10 | cd "${0:a:h}" 11 | find profiles/* \( -name .zshrc -o -name zshrc.zsh \) -type f -exec dirname {} \; 12 | ) 13 | 14 | # A fuzzy finder available 15 | if command -v fzy > /dev/null; then 16 | FUZZY_FINDER=fzy 17 | elif command -v fzf > /dev/null; then 18 | FUZZY_FINDER=fzf 19 | else 20 | echo 'No supported fuzzy finder found. Exiting!' 21 | exit 1 22 | fi 23 | 24 | # Folder to load, chosen by user 25 | FOLDER=$(${FUZZY_FINDER} <<< "${FOLDERS_WITH_ZSHRC}") 26 | # trunk-ignore(shellcheck/SC2296) 27 | # trunk-ignore(shfmt/parse) 28 | FOLDER_LOWERCASE="${(L)FOLDER}" 29 | docker build --build-arg FOLDER="${FOLDER}" --build-arg TERM="${TERM}" -t "playground/${FOLDER_LOWERCASE}" "${0:a:h}" 30 | docker run -ti --rm "playground/${FOLDER_LOWERCASE}" env TERM="${TERM}" zsh -i -l 31 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/zicompinit_fast: -------------------------------------------------------------------------------- 1 | setopt extendedglob local_options 2 | autoload -Uz compinit 3 | local zcompf="${ZI[ZCOMPDUMP_PATH]:-${ZDOTDIR:-$HOME}/.zcompdump}" 4 | 5 | # use a separate file to determine when to regenerate, as compinit doesn't always need to modify the compdump 6 | local zcompf_a="${zcompf}.augur" 7 | 8 | if [[ -e "$zcompf_a" && -f "$zcompf_a"(#qN.mh+24) ]]; then 9 | compinit -d "$zcompf" 10 | touch "$zcompf_a" 11 | else 12 | compinit -C -d "$zcompf" 13 | fi 14 | 15 | # if zcompdump exists (and is non-zero), and is older than the .zwc file, then regenerate 16 | if [[ -s "$zcompf" && (! -s "${zcompf}.zwc" || "$zcompf" -nt "${zcompf}.zwc") ]]; then 17 | # since file is mapped, it might be mapped right now (current shells), so rename it then make a new one 18 | [[ -e "$zcompf.zwc" ]] && mv -f "$zcompf.zwc" "$zcompf.zwc.old" 19 | # compile it mapped, so multiple shells can share it (total mem reduction) 20 | # run in background 21 | { zcompile -M "$zcompf" && command rm -f "$zcompf.zwc.old" }&! 22 | fi 23 | -------------------------------------------------------------------------------- /profiles/agkozak/.zshenv: -------------------------------------------------------------------------------- 1 | # ~/.zshenv 2 | # 3 | # https://github.com/agkozak/dotfiles 4 | 5 | # Benchmarks {{{1 6 | 7 | typeset -F SECONDS=0 8 | 9 | # }}}1 10 | 11 | # if ~/.profile has not been loaded and /etc/zsh/zshenv has {{{1 12 | 13 | if [[ -z $ENV ]] && [[ -n $PATH ]]; then 14 | case $- in 15 | *l*) ;; 16 | *) [[ -f ${HOME}/.profile ]] && source ${HOME}/.profile ;; 17 | esac 18 | fi 19 | 20 | # }}}1 21 | 22 | # Add snap binary and desktop directories to environment {{{1 23 | 24 | if whence -w snap &> /dev/null && [[ -f /etc/profile.d/apps-bin-path.sh ]]; then 25 | if [[ ! $PATH == */snap/bin* ]] || [[ ! $XDG_DATA_DIRS == */snapd/* ]]; then 26 | emulate sh 27 | source /etc/profile.d/apps-bin-path.sh 28 | emulate zsh 29 | fi 30 | fi 31 | 32 | # }}}1 33 | 34 | # source ~/.zshenv.local {{{1 35 | 36 | [[ -f ${HOME}/.zshenv.local ]] && source ${HOME}/.zshenv.local 37 | 38 | # }}}1 39 | 40 | # Benchmarks {{{1 41 | 42 | typeset -g AGKDOT_ZSHENV_BENCHMARK=${$(( SECONDS * 1000))%.*} 43 | 44 | # }}}1 45 | 46 | # vim: ai:fdm=marker:ts=2:et:sts=2:sw=2 47 | -------------------------------------------------------------------------------- /profiles/psprint/functions/t1countdown: -------------------------------------------------------------------------------- 1 | # DESC: Wait "$1" seconds for Ctrl-C (animated progress bar) 2 | 3 | setopt localtraps 4 | 5 | trap "return 1" INT TERM QUIT 6 | 7 | # Invoke e.g. t1countdown test && print "Progress bar available" 8 | [[ "$1" = "test" ]] && return $(( 1 - ${+commands[vramsteg]} )) 9 | 10 | (( ${+commands[vramsteg]} )) || { 11 | builtin print -r -- "Please install tool \`vramsteg' to use \`t1countdown' function" 12 | builtin print -r -- "Installation with Zplugin:" 13 | builtin print -r -- " zplugin ice as'command' pick'src/vramsteg' atclone'cmake .' atpull'%atclone' make" 14 | builtin print -r -- " zplugin light psprint/vramsteg-zsh" 15 | return 2 16 | } 17 | 18 | local START=$(vramsteg --now) pause_len="$1" 19 | integer cnt 20 | 21 | for (( cnt = 0; cnt <= pause_len * 7 - 1; ++ cnt )); do 22 | command vramsteg --label "Abort?" --min 0 --max $(( pause_len * 7 - 1 )) \ 23 | --current "$cnt" --start "$START" --elapsed --percentage 24 | LANG=C sleep 0.142 25 | done 26 | 27 | command vramsteg --remove 28 | 29 | return 0 30 | 31 | # vim:ft=zsh:et 32 | -------------------------------------------------------------------------------- /profiles/z-shell/kickstart/.zshrc: -------------------------------------------------------------------------------- 1 | # ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ❮ Z-SHELL ❯ ❮ ZI ❯ 2 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 3 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 4 | fi 5 | source <(curl -sL https://init.zshell.dev); zzinit 6 | zi for z-shell/z-a-meta-plugins @annexes \ 7 | skip'git-extras' @ext-git \ 8 | skip'peko skim fzy' @fuzzy \ 9 | skip'hexyl hyperfine vivid tig' @console-tools \ 10 | skip'F-Sy-H' @z-shell @zsh-users+fast @romkatv \ 11 | array=({git,functions,history,completion,prompt_info_functions,grep,completion,vcs_info}.zsh) 12 | zi-turbo '0a' lucid is-snippet for has'svn' svn multisrc'$array' pick'/dev/null' \ 13 | atinit'HISTFILE=${HOME}/.cache/zi/zsh-history; COMPLETION_WAITING_DOTS=true' OMZ::lib 14 | zi-turbo '0b' lucid is-snippet for \ 15 | atload"unalias grv g" OMZP::git 16 | zi-turbo '0c' lucid light-mode for \ 17 | atinit'AUTOCD=1' zplugin/zsh-exa \ 18 | MichaelAquilina/zsh-you-should-use \ 19 | 20 | [[ ! -f "${HOME}/.p10k.zsh" ]] && p10k configure 21 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/patches/LS_COLORS.patch: -------------------------------------------------------------------------------- 1 | Change dir color and add color to configs 2 | --- trapd00r---LS_COLORS/LS_COLORS 2019-11-10 20:06:56.272863178 -0500 3 | +++ trapd00r---LS_COLORS/LS_COLORS-patch 2019-11-10 20:07:58.156027896 -0500 4 | @@ -36,7 +36,7 @@ 5 | BLK 38;5;68 6 | CAPABILITY 38;5;17 7 | CHR 38;5;113;1 8 | -DIR 38;5;30 9 | +DIR 01;34 10 | DOOR 38;5;127 11 | EXEC 38;5;208;1 12 | FIFO 38;5;126 13 | @@ -146,14 +146,14 @@ 14 | # }}} 15 | # }}} 16 | # configs {{{2 17 | -*config 1 18 | -*cfg 1 19 | -*conf 1 20 | -*rc 1 21 | +*config 36 22 | +*cfg 36 23 | +*conf 36 24 | +*rc 36 25 | *authorized_keys 1 26 | *known_hosts 1 27 | -.ini 1 28 | -.plist 1 29 | +.ini 36 30 | +.plist 36 31 | # vim 32 | .viminfo 1 33 | # cisco VPN client configuration 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Zdharma Initiative 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/completions/_nl: -------------------------------------------------------------------------------- 1 | #compdef nl 2 | 3 | # zsh completions for 'nl' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | {-b,--body-numbering}'[use STYLE for numbering body lines]' 9 | {-d,--section-delimiter}'[use CC for logical page delimiters]' 10 | {-f,--footer-numbering}'[use STYLE for numbering footer lines]' 11 | {-h,--header-numbering}'[use STYLE for numbering header lines]' 12 | {-i,--line-increment}'[line number increment at each line]' 13 | {-l,--join-blank-lines}'[group of NUMBER empty lines counted as one]' 14 | {-n,--number-format}'[insert line numbers according to FORMAT]' 15 | {-p,--no-renumber}'[do not reset line numbers for each section]' 16 | {-s,--number-separator}'[add STRING after (possible) line number]' 17 | {-v,--starting-line-number}'[first line number for each section]' 18 | {-w,--number-width}'[use NUMBER columns for line numbers]' 19 | '--help[display this help and exit]' 20 | '--version[output version information and exit]' 21 | '*:filename:_files' 22 | ) 23 | 24 | _arguments -s $arguments 25 | -------------------------------------------------------------------------------- /profiles/psprint/functions/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 Sebastian Gniazdowski 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/LICENSE: -------------------------------------------------------------------------------- 1 | This software is licensed under MIT. 2 | 3 | MIT License 4 | ----------- 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /profiles/lainiwa/1st_config/.zsh/other/command-not-found.zsh: -------------------------------------------------------------------------------- 1 | # Uses the command-not-found package zsh support 2 | # as seen in http://www.porcheron.info/command-not-found-for-zsh/ 3 | # this is installed in Ubuntu 4 | 5 | [[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found 6 | 7 | # Arch Linux command-not-found support, you must have package pkgfile installed 8 | # https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook 9 | [[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh 10 | 11 | # 12 | if command -v prt-get >/dev/null; then 13 | if (( ! ${+functions[command_not_found_handler]} )) ; then 14 | function command_not_found_handler { 15 | crux_find_package ${1+"$1"} && : 16 | } 17 | fi 18 | 19 | crux_find_package() { 20 | bin=$1 21 | bin_path=$(prt-get fsearch ${bin} | grep "^ .*${bin}$" | sed 's/^ //g' | sed 1q) 22 | [[ -z $bin_path ]] && return 1 23 | pkg_path=$(prt-get fsearch --full "${bin_path}" | sed 1q | sed 's/Found in \(.*\):/\1/g') 24 | pkg_name=$(basename "${pkg_path}") 25 | printf "%s\n%s\n" "Command '${bin}' not found, but can be installed with:" "sudo prt-get depinst ${pkg_name}" 26 | } 27 | 28 | fi 29 | -------------------------------------------------------------------------------- /profiles/psprint/functions/deploy-code: -------------------------------------------------------------------------------- 1 | # This Zshell function will execute the given code from a Zle context. 2 | # It has an optional delay first argument: "@sleep:". 3 | # If given, then the code will wait in background before being executed, for 4 | # the specified amount of time. 5 | # The limit of the code length is 25 lines and can be easily extended by 6 | # changing the "repeat 25" line 7 | # 8 | # Usage: 9 | # deploy-code "echo Hello world" 10 | # deploy-code "BUFFER[-1]=''" 11 | # deploy-code @sleep:5.5 "BUFFER='The time has passed, sorry for replacing your command line ;)'" 12 | [[ "$1" = <-> && ${#} -eq 1 ]] && { 13 | local alltext text IFS=$'\n' nl=$'\n' 14 | repeat 25; do read -r -u"$1" text; alltext+="${text:+$text$nl}"; done 15 | zle -F "$1"; exec {1}<&- 16 | eval "$alltext" 17 | return 0 18 | } 19 | local THEFD 20 | exec {THEFD} < <( 21 | # The expansion is: if there is @sleep: pfx, then use what is after 22 | # it, otherwise substitute 0 23 | LANG=C sleep $(( 0.005 + ${${${(M)1#@sleep:}:+${1#@sleep:}}:-0} )) 24 | print -r -- ${1:#(@code|@sleep:*)} "${@[2,-1]}" 25 | ) 26 | zle -N deploy-code # idempotent 27 | zle -w -F "$THEFD" deploy-code 28 | 29 | # vim;ft=zsh:sts=4:sw=4:et 30 | -------------------------------------------------------------------------------- /profiles/lainiwa/2nd_config/.zsh/other/command-not-found.zsh: -------------------------------------------------------------------------------- 1 | # Uses the command-not-found package zsh support 2 | # as seen in http://www.porcheron.info/command-not-found-for-zsh/ 3 | # this is installed in Ubuntu 4 | 5 | [[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found 6 | 7 | # Arch Linux command-not-found support, you must have package pkgfile installed 8 | # https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook 9 | [[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh 10 | 11 | # 12 | if command -v prt-get >/dev/null; then 13 | if (( ! ${+functions[command_not_found_handler]} )) ; then 14 | function command_not_found_handler { 15 | crux_find_package ${1+"$1"} && : 16 | } 17 | fi 18 | 19 | crux_find_package() { 20 | bin=$1 21 | bin_path=$(prt-get fsearch ${bin} | grep "^ .*${bin}$" | sed 's/^ //g' | sed 1q) 22 | [[ -z $bin_path ]] && return 1 23 | pkg_path=$(prt-get fsearch --full "${bin_path}" | sed 1q | sed 's/Found in \(.*\):/\1/g') 24 | pkg_name=$(basename "${pkg_path}") 25 | printf "%s\n%s\n" "Command '${bin}' not found, but can be installed with:" \ 26 | "sudo prt-get depinst ${pkg_name}" 27 | } 28 | 29 | fi 30 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/patches/rm-trash.patch: -------------------------------------------------------------------------------- 1 | Don't run on sudo, Fix arg handling 2 | --- nateshmbhat---rm-trash/rm-trash/rm-trash 2020-05-22 20:42:16.267371553 -0400 3 | +++ nateshmbhat---rm-trash/rm-trash/rm-trash-patch 2020-05-22 20:42:13.677459148 -0400 4 | @@ -1,4 +1,5 @@ 5 | #!/bin/bash 6 | +[[ $EUID = 0 ]] && { echo "Root detected, running builtin rm"; command rm ${rm_opts} "${@}"; exit; } 7 | 8 | # MIT License 9 | 10 | @@ -238,7 +239,7 @@ 11 | 12 | LOOPENTERFLAG=0 13 | 14 | - for file in ${FILE_ARGS[@]} 15 | + for file in "${FILE_ARGS[@]}" 16 | do 17 | LOOPENTERFLAG=1 18 | if [ $DEBUGFLAG -eq 1 ] ; then 19 | @@ -273,7 +274,7 @@ 20 | exit 1 21 | fi 22 | 23 | - for arg in $@ ; do 24 | + for arg in "$@" ; do 25 | 26 | if [ "${arg:0:1}" == '-' ] ; then 27 | if [ "$arg" == "--no-trash" ] ;then 28 | @@ -283,7 +284,7 @@ 29 | 30 | OPTIONAL_ARGS+=($arg) 31 | else 32 | - FILE_ARGS+=($arg) 33 | + FILE_ARGS+=("$arg") 34 | fi 35 | 36 | case "$arg" in 37 | @@ -318,10 +319,10 @@ 38 | 39 | 40 | 41 | -handleArguments $@ 42 | +handleArguments "$@" 43 | if [ $DEBUGFLAG -eq 1 ] ;then 44 | echo ${OPTIONAL_ARGS[@]} 45 | echo ${FILE_ARGS[@]} 46 | fi 47 | 48 | -main $@ 49 | \ No newline at end of file 50 | +main $@ 51 | -------------------------------------------------------------------------------- /profiles/jubi/.zshrc: -------------------------------------------------------------------------------- 1 | ### Added by Zinit's installer 2 | source ~/.zi/bin/zi.zsh 3 | autoload -Uz _zi 4 | (( ${+_comps} )) && _comps[zi]=_zi 5 | ### End of Zinit installer's chunk 6 | 7 | ##### BEGIN Zinit stuff ##### 8 | ### needs: zi, fzf 9 | 10 | # z 11 | zi ice wait blockf lucid 12 | zi light rupa/z 13 | 14 | # z tab completion 15 | zi ice wait lucid 16 | zi light changyuheng/fz 17 | 18 | # z / fzf (ctrl-g) 19 | zi ice wait lucid 20 | zi light andrewferrier/fzf-z 21 | 22 | # cd 23 | zi ice wait lucid 24 | zi light changyuheng/zsh-interactive-cd 25 | 26 | # Don't bind these keys until ready 27 | bindkey -r '^[[A' 28 | bindkey -r '^[[B' 29 | function __bind_history_keys() { 30 | bindkey '^[[A' history-substring-search-up 31 | bindkey '^[[B' history-substring-search-down 32 | } 33 | # History substring searching 34 | zi ice wait lucid atload'__bind_history_keys' 35 | zi light zsh-users/zsh-history-substring-search 36 | 37 | # autosuggestions, trigger precmd hook upon load 38 | zi ice wait lucid atload'_zsh_autosuggest_start' 39 | zi light zsh-users/zsh-autosuggestions 40 | export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=10 41 | 42 | # Tab completions 43 | zi ice wait lucid blockf atpull'zi creinstall -q .' 44 | zi light zsh-users/zsh-completions 45 | 46 | # Syntax highlighting 47 | zi ice wait lucid atinit'zicompinit; zicdreplay' 48 | zi light z-shell/F-Sy-H 49 | 50 | ##### END Zinit stuff ##### 51 | -------------------------------------------------------------------------------- /profiles/z-shell/meta-loader/.zshrc: -------------------------------------------------------------------------------- 1 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 2 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 3 | fi 4 | if [[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/zi/init.zsh" ]]; then 5 | source "${XDG_CONFIG_HOME:-$HOME/.config}/zi/init.zsh" && zzinit 6 | fi 7 | setopt promptsubst 8 | module_path+=( /home/z-shell/.zi/zmodules/zpmod/Src ) 9 | zmodload zi/zpmod 2> /dev/null 10 | 11 | zi-turbo '0a' is-snippet for svn atinit'HISTFILE="${HOME}/.cache/zi/history"' \ 12 | pick"completion.zsh" multisrc'git.zsh functions.zsh \ 13 | {prompt_info_functions,history,grep}.zsh' OMZ::lib 14 | 15 | zi-turbo '0b' light-mode for atload"unalias grv g" OMZP::git OMZP::sudo OMZP::extract \ 16 | MichaelAquilina/zsh-you-should-use birdhackor/zsh-exa-ls-plugin z-shell/zsh-unique-id \ 17 | atload'zstyle :zi:annex:test quiet 0' z-shell/z-a-test atload"zsh-startify" z-shell/zsh-startify 18 | 19 | zi for z-shell/z-a-meta-plugins @annexes skip'fzy' @fuzzy skip'tig' @console-tools \ 20 | skip'git-extras' @ext-git @romkatv skip'F-Sy-H' @z-shell @zsh-users+fast @zunit 21 | 22 | if (( $+commands[vivid] )) { LS_COLORS="$(vivid generate solarized-light)" } 23 | if (( $+commands[exa] )) { auto-exa () { exa ${exa_params}; }; [[ ${chpwd_functions[(r)auto-exa]} == auto-exa ]] || chpwd_functions=( auto-exa $chpwd_functions ) } 24 | -------------------------------------------------------------------------------- /profiles/psprint/functions/pssetup_ssl_cert: -------------------------------------------------------------------------------- 1 | # DESC: Creates certificate (files key,crt,pem), see -h 2 | 3 | [[ -z "$1" || "$1" = "-h" || "$1" = "--help" ]] && { print "Usage: pssetup_ssl_cert {name} [output dir path]"; return 0; } 4 | local FILENAME="$1" 5 | 6 | command mkdir -p "${2:-$HOME/safe/socat}" 7 | builtin cd "${2:-$HOME/safe/socat}" 8 | 9 | # Generate a public/private key pair 10 | command rm -f $FILENAME.key 11 | builtin print -- "${fg[green]}Generating public/private key pair (output: $FILENAME.key)$reset_color" 12 | command openssl genrsa -out $FILENAME.key 1024 13 | 14 | # Generate a self-signed certificate 15 | command rm -f $FILENAME.crt 16 | builtin print -- "${fg[green]}Generating self-signed certificate (output: $FILENAME.crt)$reset_color" 17 | command openssl req -new -key $FILENAME.key -x509 -days 3653 -out $FILENAME.crt 18 | 19 | # Generate the PEM file by just appending the key and certificate files 20 | command rm -f $FILENAME.pem 21 | builtin print -- "${fg[green]}Create PEM file (output: $FILENAME.pem)$reset_color" 22 | command cat $FILENAME.key $FILENAME.crt >! $FILENAME.pem 23 | 24 | builtin print -- "${fg[green]}chmod 600 $FILENAME.key $FILENAME.pem$reset_color" 25 | command chmod 600 $FILENAME.key $FILENAME.pem 26 | 27 | builtin print -- "${fg[yellow]}Next step is to copy the certificate (${fg[red]}$FILENAME.crt${fg[yellow]}) to the opposite host" 28 | 29 | # vim:ft=zsh:et 30 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/patches/fz.patch: -------------------------------------------------------------------------------- 1 | Remove code which caused z to hang when completing 2 | --- changyuheng---fz/fz.sh 2020-02-25 15:05:44.397883607 -0500 3 | +++ changyuheng---fz/fz.sh-patch 2020-02-25 15:05:32.741982804 -0500 4 | @@ -27,7 +27,7 @@ 5 | local dir seg starts_with_dir 6 | if [[ "$1" == */ ]]; then 7 | dir="$1" 8 | - find -L "$(cd "$dir" 2>/dev/null && pwd)" -mindepth 1 -maxdepth 1 -type d \ 9 | + find -L "$(pwd)" -mindepth 1 -maxdepth 1 -type d \ 10 | 2>/dev/null | while read -r line; do 11 | base="${line##*/}" 12 | if [[ "$base" == .* ]]; then 13 | @@ -42,7 +42,7 @@ 14 | seg=$(echo "$seg" | tr '[:upper:]' '[:lower:]') 15 | fi 16 | starts_with_dir=$( \ 17 | - find -L "$(cd "$dir" 2>/dev/null && pwd)" -mindepth 1 -maxdepth 1 \ 18 | + find -L "$(pwd)" -mindepth 1 -maxdepth 1 \ 19 | -type d 2>/dev/null | while read -r line; do \ 20 | base="${line##*/}" 21 | if [[ "$seg" != .* && "$base" == .* ]]; then 22 | @@ -68,7 +68,7 @@ 23 | if [ -n "$starts_with_dir" ]; then 24 | echo "$starts_with_dir" 25 | else 26 | - find -L "$(cd "$dir" 2>/dev/null && pwd)" -mindepth 1 -maxdepth 1 \ 27 | + find -L "$(pwd)" -mindepth 1 -maxdepth 1 \ 28 | -type d 2>/dev/null | while read -r line; do \ 29 | base="${line##*/}" 30 | if [[ "$seg" != .* && "$base" == .* ]]; then 31 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/completions/_colorls: -------------------------------------------------------------------------------- 1 | #compdef colorls 2 | 3 | # zsh completions for 'colorls' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | {-a,--all}'[do not ignore entries starting with .]' 9 | {-A,--almost-all}'[do not list . and ..]' 10 | {-d,--dirs}'[show only directories]' 11 | {-f,--files}'[show only files]' 12 | {--gs,--git-status}'[show git status for each file]' 13 | '--report[show brief report]' 14 | '--format[use format: accross (-x), horizontal (-x), long (-l), single-column (-1)]' 15 | '-1[list one file per line]' 16 | {-l,--long}'[use a long listing format]' 17 | '-x[list entries by lines instead of by columns]' 18 | '--tree[shows tree view of the directory]' 19 | {--sd,--sort-dirs,--group-directories-first}'[sort directories first]' 20 | {--sf,--sort-files}'[sort files first]' 21 | '-t[sort by modification time, newest first]' 22 | '-U[do not sort; list entries in directory order]' 23 | '-S[sort by file size, largest first]' 24 | '-X[sort by file extension]' 25 | '--sort[sort by WORD instead of name: none, size (-S), time (-t), extension (-X)]' 26 | {-r,--reverse}'[reverse order while sorting]' 27 | {-h,--human-readable}'[]' 28 | '--color[colorize the output: auto, always (default if omitted), never]' 29 | '--light[use light color scheme]' 30 | '--dark[use dark color scheme]' 31 | '--hyperlink[]' 32 | '--help[prints this help]' 33 | '--version[show version]' 34 | '*:filename:_files' 35 | ) 36 | 37 | _arguments -s $arguments 38 | -------------------------------------------------------------------------------- /profiles/lainiwa/1st_config/.zsh/completions.zsh: -------------------------------------------------------------------------------- 1 | 2 | # https://github.com/zulu-zsh/zulu/blob/master/src/commands/init.zsh 3 | # not all options (see git [TAB]) 4 | 5 | # additional completions 6 | compdef _gnu_generic tr lsb_release 7 | 8 | # Suggestions descriptions. 9 | builtin zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f' 10 | builtin zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f' 11 | builtin zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f' 12 | builtin zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f' 13 | builtin zstyle ':completion:*' format ' %F{yellow}-- %d --%f' 14 | 15 | # https://www.topbug.net/blog/2017/08/08/enable-auto-completion-for-pip-in-zsh/ 16 | # eval "$(pip3 completion --zsh)" # <-- slow af. soo: 17 | function _pip_completion { 18 | local words cword 19 | read -Ac words 20 | read -cn cword 21 | reply=( $( COMP_WORDS="$words[*]" \ 22 | COMP_CWORD=$(( cword-1 )) \ 23 | PIP_AUTO_COMPLETE=1 $words[1] ) ) 24 | } 25 | compctl -K _pip_completion pip3 26 | 27 | # Select completions with arrows 28 | zstyle ':completion:*' menu select 29 | 30 | # Fuzzy match mistyped completions. 31 | # builtin zstyle ':completion:*' completer _complete _match _approximate 32 | # builtin zstyle ':completion:*:match:*' original only 33 | # builtin zstyle ':completion:*:approximate:*' max-errors 1 numeric 34 | 35 | # Increase the number of errors based on the length of the typed word. 36 | # builtin zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)' 37 | -------------------------------------------------------------------------------- /profiles/lainiwa/2nd_config/.zsh/completions.zsh: -------------------------------------------------------------------------------- 1 | 2 | # https://github.com/zulu-zsh/zulu/blob/master/src/commands/init.zsh 3 | # not all options (see git [TAB]) 4 | 5 | # additional completions 6 | compdef _gnu_generic tr lsb_release 7 | 8 | # Suggestions descriptions. 9 | builtin zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f' 10 | builtin zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f' 11 | builtin zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f' 12 | builtin zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f' 13 | builtin zstyle ':completion:*' format ' %F{yellow}-- %d --%f' 14 | 15 | # https://www.topbug.net/blog/2017/08/08/enable-auto-completion-for-pip-in-zsh/ 16 | # eval "$(pip3 completion --zsh)" # <-- slow af. soo: 17 | function _pip_completion { 18 | local words cword 19 | read -Ac words 20 | read -cn cword 21 | reply=( $( COMP_WORDS="$words[*]" \ 22 | COMP_CWORD=$(( cword-1 )) \ 23 | PIP_AUTO_COMPLETE=1 $words[1] ) ) 24 | } 25 | compctl -K _pip_completion pip3 26 | 27 | # Select completions with arrows 28 | zstyle ':completion:*' menu select 29 | 30 | # Fuzzy match mistyped completions. 31 | # builtin zstyle ':completion:*' completer _complete _match _approximate 32 | # builtin zstyle ':completion:*:match:*' original only 33 | # builtin zstyle ':completion:*:approximate:*' max-errors 1 numeric 34 | 35 | # Increase the number of errors based on the length of the typed word. 36 | # builtin zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)' 37 | -------------------------------------------------------------------------------- /profiles/lainiwa/1st_config/.zsh/aliases.zsh: -------------------------------------------------------------------------------- 1 | # Colorize and humanify `ls` 2 | if [[ "$(uname -s)" == "FreeBSD" ]]; then 3 | alias ls='ls -h -G' 4 | else 5 | alias ls='ls -h --color=auto' 6 | fi 7 | alias ll='ls -l' 8 | alias la='ls -A' 9 | alias lal='ls -Al' 10 | 11 | # Colorize `grep`s 12 | alias grep='grep --color=auto' 13 | alias fgrep='fgrep --color=auto' 14 | alias egrep='egrep --color=auto' 15 | 16 | alias mkdir='mkdir -pv' 17 | alias tree='tree -C' 18 | alias U='unbuffer ' 19 | 20 | alias -g H="| sed 11q" # (: 21 | alias -g T="| tail" 22 | 23 | alias -g G="| grep" 24 | alias -g S="| sed" 25 | 26 | alias -g L="| less" 27 | alias -g LR="| less -R" # less with colors support 28 | 29 | alias -g C='| column -t' 30 | 31 | alias -g NE="2> /dev/null" 32 | alias -g NUL="&> /dev/null" 33 | 34 | # Set grc alias for available commands. 35 | [[ -f /etc/grc.conf ]] && grc_conf='/etc/grc.conf' 36 | [[ -f /usr/local/etc/grc.conf ]] && grc_conf='/usr/local/etc/grc.conf' 37 | if [ ! -z "$grc_conf" ]; then 38 | for cmd in $(grep '^# ' "$grc_conf" | cut -f 2 -d ' '); do 39 | if (($ + commands[$cmd])) && [ "$cmd" != "ls" ]; then 40 | alias $cmd="grc --colour=auto $cmd" 41 | fi 42 | done 43 | fi 44 | 45 | # Create directory and cd to it 46 | mkcd() { mkdir -- "$1" && cd -P -- "$1"; } 47 | 48 | # Alias for altering some symbol with newline 49 | # Example: echo $PATH TRN : 50 | __rt__() { tr -- "$2" "$1"; } 51 | alias -g TRN='| __rt__ "\n" ' 52 | 53 | # Remove colors 54 | alias -g NOC='| sed -r "s/\x1B\[[0-9;]*[JKmsu]//g"' 55 | 56 | # npm-exec binary_name, to run localy installed nodejs binary 57 | alias npm-exec='PATH=$(npm bin):$PATH' 58 | -------------------------------------------------------------------------------- /profiles/psprint/functions/n1ssl_rtunnel: -------------------------------------------------------------------------------- 1 | # DESC: $0 2 | # Warning: this function calls exec, run it in background 3 | 4 | setopt localoptions extendedglob noksharrays noshwordsplit 5 | usage() { 6 | print -r -- "Usage: $1 " 7 | print -r -- "Warning: calls exec, to be run in background" 8 | } 9 | 10 | [[ "$1" = "-h" || "$1" = "--help" || -z "$1" ]] && { usage "$0"; return 0; } 11 | [[ "$1" != <-> ]] && { print "Listen port ($1) isn't a number, aborting"; return 1; } 12 | [[ "$3" != <-> ]] && { print "Target port ($3) isn't a number, aborting"; return 2; } 13 | 14 | local listen_port="$1" target_host="$2" target_port="$3" 15 | local cert="$4" cafile="$5" 16 | 17 | cert="${${(M)cert##/*}:-$HOME/safe/socat/$cert}" 18 | cafile="${${(M)cafile##/*}:-$HOME/safe/socat/$cafile}" 19 | 20 | [[ ! -r "$cert" ]] && { 21 | print "Cert ${cert:t} doesn't exist or is unreadable, aborting (looked at path: $cert)" 22 | return 3 23 | } 24 | [[ ! -r "$cafile" ]] && { 25 | print "Cafile ${cafile:t} doesn't exist or is unreadable, aborting (looked at path: $cafile)" 26 | return 4 27 | } 28 | 29 | local listen_line="openssl-listen:$listen_port,reuseaddr,fork" 30 | listen_line="$listen_line,cert=$cert,cafile=$cafile" 31 | 32 | local commonname="" 33 | command openssl x509 -noout -in "$cafile" -subject | read commonname 34 | commonname="${commonname##*/CN[[:space:]]#=}" 35 | commonname="${commonname##*, CN[[:space:]]##=[[:space:]]##}" 36 | 37 | listen_line="$listen_line,commonname=$commonname" 38 | 39 | exec socat $listen_line tcp4:$target_host:$target_port 2>/dev/null 40 | 41 | # vim:ft=zsh:et 42 | -------------------------------------------------------------------------------- /profiles/lainiwa/2nd_config/.zsh/aliases.zsh: -------------------------------------------------------------------------------- 1 | 2 | # Colorize and humanify `ls` 3 | if [[ "$(uname -s)" == "FreeBSD" ]]; then 4 | alias ls='ls -h -G' 5 | else 6 | alias ls='ls -h --color=auto' 7 | fi 8 | alias ll='ls -l' 9 | alias la='ls -A' 10 | alias lal='ls -Al' 11 | 12 | # Colorize `grep`s 13 | alias grep='grep --color=auto' 14 | alias fgrep='fgrep --color=auto' 15 | alias egrep='egrep --color=auto' 16 | 17 | alias mkdir='mkdir -pv' 18 | alias tree='tree -C' 19 | alias U='unbuffer ' 20 | 21 | alias -g H="| sed 11q" # (: 22 | alias -g T="| tail" 23 | 24 | alias -g G="| grep" 25 | alias -g S="| sed" 26 | 27 | alias -g L="| less" 28 | alias -g LR="| less -R" # less with colors support 29 | 30 | alias -g C='| column -t' 31 | 32 | alias -g NE="2> /dev/null" 33 | alias -g NUL="&> /dev/null" 34 | 35 | # Set grc alias for available commands. 36 | [[ -f /etc/grc.conf ]] && grc_conf='/etc/grc.conf' 37 | [[ -f /usr/local/etc/grc.conf ]] && grc_conf='/usr/local/etc/grc.conf' 38 | if [ ! -z "$grc_conf" ]; then 39 | for cmd in $(grep '^# ' "$grc_conf" | cut -f 2 -d ' '); do 40 | if (( $+commands[$cmd] )) && [ "$cmd" != "ls" ]; then 41 | alias $cmd="grc --colour=auto $cmd" 42 | fi 43 | done 44 | fi 45 | 46 | 47 | # Create directory and cd to it 48 | mkcd() { mkdir -- "$1" && cd -P -- "$1" ; } 49 | 50 | 51 | # Alias for altering some symbol with newline 52 | # Example: echo $PATH TRN : 53 | __rt__() { tr -- "$2" "$1" ; } 54 | alias -g TRN='| __rt__ "\n" ' 55 | 56 | 57 | # Remove colors 58 | alias -g NOC='| sed -r "s/\x1B\[[0-9;]*[JKmsu]//g"' 59 | 60 | 61 | # npm-exec binary_name, to run localy installed nodejs binary 62 | alias npm-exec='PATH=$(npm bin):$PATH' 63 | -------------------------------------------------------------------------------- /profiles/psprint/functions/n1ssl_tunnel: -------------------------------------------------------------------------------- 1 | # DESC: $0 2 | # Warning: this function calls exec, run it in background 3 | 4 | setopt localoptions extendedglob noksharrays noshwordsplit 5 | 6 | usage() { 7 | print -r -- "Usage: $1 " 8 | print -r -- "Warning: calls exec, to be run in background" 9 | } 10 | 11 | [[ "$1" = "-h" || "$1" = "--help" || -z "$1" ]] && { usage "$0"; return 0; } 12 | [[ "$1" != <-> ]] && { print "Listen port ($1) isn't a number, aborting"; return 1; } 13 | [[ "$3" != <-> ]] && { print "Target port ($3) isn't a number, aborting"; return 2; } 14 | 15 | local listen_port="$1" target_host="$2" target_port="$3" 16 | local cert="$4" cafile="$5" 17 | 18 | cert="${${(M)cert##/*}:-$HOME/safe/socat/$cert}" 19 | cafile="${${(M)cafile##/*}:-$HOME/safe/socat/$cafile}" 20 | 21 | [[ ! -r "$cert" ]] && { 22 | print "Cert ${cert:t} doesn't exist or is unreadable, aborting (looked at path: $cert)" 23 | return 3 24 | } 25 | [[ ! -r "$cafile" ]] && { 26 | print "Cafile ${cafile:t} doesn't exist or is unreadable, aborting (looked at path: $cafile)" 27 | return 4 28 | } 29 | 30 | local target_line="openssl-connect:$target_host:$target_port" 31 | target_line="$target_line,cert=$cert,cafile=$cafile" 32 | 33 | local commonname="" 34 | command openssl x509 -noout -in "$cafile" -subject | read commonname 35 | commonname="${commonname##*/CN[[:space:]]#=}" 36 | commonname="${commonname##*, CN[[:space:]]##=[[:space:]]##}" 37 | 38 | target_line="$target_line,commonname=$commonname" 39 | 40 | exec socat tcp4-listen:$listen_port,reuseaddr,fork,bind=127.0.0.1 "$target_line" 2>/dev/null 41 | 42 | # vim:ft=zsh:et 43 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/completions/_clight: -------------------------------------------------------------------------------- 1 | #compdef clight 2 | 3 | # zsh completions for 'clight' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | {-f,--frames}'[frames taken for each capture, Between 1]' 9 | {-d,--device}'[0 Path to webcam device. If empty, first]' 10 | {-b,--backlight}'[path to backlight syspath. If empty]' 11 | '--no-backlight-smooth[disable smooth backlight transitions]' 12 | '--no-gamma-smooth[disable smooth gamma transitions]' 13 | '--no-dimmer-smooth[disable smooth dimmer transitions]' 14 | '--day-temp[daily gamma temperature, between 1000]' 15 | '--night-temp[nightly gamma temperature, between 1000]' 16 | '--lat[your desired latitude]' 17 | '--lon[your desired longitude]' 18 | '--sunrise[7:00 Force sunrise time for gamma correction]' 19 | '--sunset[9:00 Force sunset time for gamma correction]' 20 | '--no-gamma[disable gamma correction tool]' 21 | '--no-dimmer[disable dimmer tool]' 22 | '--no-dpms[disable dpms tool]' 23 | '--no-inhibit[disable]' 24 | '--no-backlight[disable backlight module]' 25 | '--dimmer-pct[backlight level used while screen is]' 26 | '--verbose[enable verbose mode]' 27 | '--no-auto-calib[disable screen backlight automatic]' 28 | '--no-kbd-backlight[disable keyboard backlight calibration]' 29 | '--shutter-thres[threshold to consider a capture as]' 30 | {-v,--version}'[show version info]' 31 | {-c,--conf-file}'[specify a conf file to be parsed]' 32 | '--gamma-long-transition[enable a very long smooth transition for]' 33 | '--usage[display brief usage message]' 34 | '*:filename:_files' 35 | ) 36 | 37 | _arguments -s $arguments 38 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:rolling 2 | 3 | ARG TERM 4 | ARG SHELL 5 | ARG FOLDER 6 | ARG USERNAME=z-shell 7 | ARG DEBIAN_FRONTEND=noninteractive 8 | 9 | RUN apt-get update && apt-get install --no-install-recommends -yq file dirmngr iproute2 procps sudo lsb-release \ 10 | zlib1g tree vim nano ncurses-dev man telnet unzip zsh apt-transport-https jq gnupg2 git subversion curl make sudo \ 11 | locales autoconf automake python3-minimal python3-pip libffi-dev python3-venv golang-go rsync socat build-essential \ 12 | less vim htop && apt-get clean -y && rm -rf /var/lib/apt/lists/* 13 | 14 | RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen 15 | ENV LANG en_US.UTF-8 16 | ENV LANGUAGE en_US:en 17 | ENV LC_ALL en_US.UTF-8 18 | ENV TERM xterm-256color 19 | ENV SHELL=/bin/zsh 20 | 21 | RUN echo 'playground' > /etc/hostname 22 | RUN adduser --disabled-password --gecos '' $USERNAME && \ 23 | adduser $USERNAME sudo && \ 24 | echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 25 | usermod --shell /bin/zsh $USERNAME 26 | #RUN curl 'https://sh.rustup.rs' -sSf | sh -s -- -y && \ 27 | # echo 'source ${HOME}/.cargo/env' >> /home/$USERNAME/.zshenv 28 | 29 | USER ${USERNAME} 30 | COPY --chown=${USERNAME} "$FOLDER" /home/${USERNAME} 31 | 32 | RUN if [ -f /home/${USERNAME}/bootstrap.sh ]; then \ 33 | chmod u+x /home/${USERNAME}/bootstrap.sh; \ 34 | /home/${USERNAME}/bootstrap.sh; \ 35 | fi 36 | 37 | WORKDIR /home/${USERNAME} 38 | RUN cp -vf /home/${USERNAME}/zshrc.zsh /home/${USERNAME}/.zshrc 2>/dev/null || true; \ 39 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/z-shell/zi-src/main/lib/sh/install.sh)" -- -i skip 40 | RUN SHELL=/bin/zsh zsh -i -lc -- '@zi-scheduler burst || true ' 41 | CMD ["zsh", "-i", "-l"] 42 | 43 | -------------------------------------------------------------------------------- /profiles/psprint/functions/pslist: -------------------------------------------------------------------------------- 1 | # DESC: Lists ~/functions/* with their embedded descriptions 2 | 3 | setopt localoptions extendedglob 4 | 5 | local -a pfxs lines desc files 6 | pfxs=( ps t1 f1 g1 n1 x1 ) # grouped commands 7 | pfxs+=( "*~$HOME/functions/(${(j:|:)pfxs}|lps)" ) # ungrouped commands 8 | pfxs+=( lps ) # local, uncommited commands 9 | 10 | integer pass longest=0 longest2=0 11 | local p file header="# DESC: " 12 | 13 | for (( pass = 1; pass <= 2; ++ pass )); do 14 | for p in "${pfxs[@]}"; do 15 | files=( $HOME/functions/${~p}*(N) ) 16 | 17 | if (( pass == 2 )); then 18 | if (( ${#files[@]} )); then 19 | if [[ "$p" = "lps" ]]; then 20 | print -r -- ${(l:(longest+longest2)/2-4::-:):-} LOCAL ${(l:longest+longest2-(longest+longest2)/2-3::-:):-} 21 | else 22 | print -r -- ${(l:longest+longest2::-:):-} 23 | fi 24 | fi 25 | fi 26 | 27 | for file in "${files[@]}"; do 28 | lines=( ${(f)"$(<$file)"} ) 29 | desc=( "${(M)lines[@]:#${header}*}" ) 30 | desc[1]="${desc[1]#$header}" 31 | file="${file:t}" 32 | [[ "$file" = (LICENSE|README.md) ]] && continue 33 | if (( pass == 1 )); then 34 | (( longest < ${#file} + 3 )) && longest=$(( ${#file} + 3 )) 35 | (( longest2 < ${#desc[1]} )) && longest2=$(( ${#desc[1]} )) 36 | else 37 | echo "${file}${(l:longest-${#file}:: :):- }${desc[1]}" 38 | fi 39 | done 40 | done 41 | if (( pass == 2 )); then 42 | print -r -- ${(l:longest+longest2::-:):-} 43 | fi 44 | done 45 | 46 | # vim:ft=zsh:et 47 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/functions/sudo: -------------------------------------------------------------------------------- 1 | function _do_sudo() { 2 | [[ -z ${__do_sudo_glob+x} ]] && local __do_sudo_glob=1 3 | [[ -z ${__do_sudo_expanded+x} ]] && local -A __do_sudo_expanded 4 | local -a args 5 | local -a cmd_alias_arr 6 | local cmd_alias first=true 7 | while (($#)); do 8 | case "$1" in 9 | command|exec|-) shift; break ;; 10 | nocorrect) shift ;; 11 | noglob) __do_sudo_glob=0; shift ;; 12 | [1-9]) args+=( $1 ); shift ;; 13 | *) 14 | $first && { first=false; cmd_alias="$(command -v 2>/dev/null -- "$1")" } 15 | if [[ "$?" -eq 0 ]] && [[ "$cmd_alias" == 'alias'* ]] && [[ -z "$__do_sudo_expanded["$1"]" ]]; then 16 | __do_sudo_expanded["$1"]=1 17 | IFS=' ' read -A cmd_alias_arr <<< "$(sed -e "s/[^=]*=//" -e "s/^'//" -e "s/'$//" <<< "$cmd_alias")" 18 | args+=( "${cmd_alias_arr[@]}" ) 19 | shift 20 | break 21 | else 22 | if ((__do_sudo_glob)); then 23 | args+=( $~==1 ) 24 | else 25 | args+=( $==1 ) 26 | fi 27 | shift 28 | fi 29 | ;; 30 | esac 31 | done 32 | if [[ ${#cmd_alias_arr[@]} -gt 0 ]]; then 33 | _do_sudo "${args[@]}" $==* 34 | else 35 | if ((__do_sudo_glob)); then 36 | command sudo "${args[@]}" $~==* 37 | else 38 | command sudo "${args[@]}" $==* 39 | fi 40 | fi 41 | } 42 | 43 | local -a first 44 | local pos=1 second ret 45 | for arg in "$@" 46 | do 47 | if [[ ${arg:0:1} == "-" ]]; then 48 | ((++pos)) 49 | first=("${first[@]}" "$arg") 50 | else 51 | noglob _do_sudo ${first[@]} ${@:$pos} 52 | ret=$? 53 | unset -f _do_sudo 54 | return $ret 55 | fi 56 | done 57 | command sudo "${@}" 58 | unset -f _do_sudo 59 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/completions/_groff: -------------------------------------------------------------------------------- 1 | #compdef groff 2 | 3 | # zsh completions for 'groff' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | '-h[print this message]' 9 | '-v[print version number]' 10 | '-e[preprocess with eqn]' 11 | '-g[preprocess with grn]' 12 | '-j[preprocess with chem]' 13 | '-k[preprocess with preconv]' 14 | '-p[preprocess with pic]' 15 | '-s[preprocess with soelim]' 16 | '-t[preprocess with tbl]' 17 | '-G[preprocess with grap]' 18 | '-J[preprocess with gideal]' 19 | '-R[preprocess with refer]' 20 | '-a[produce ASCII description of output]' 21 | '-b[print backtraces with errors or warnings]' 22 | '-c[disable color output]' 23 | '-dcs[define a string c as s]' 24 | '-ffam[use fam as the default font family]' 25 | '-i[read standard input after named input files]' 26 | '-l[spool the output]' 27 | '-mname[read macros tmac.name]' 28 | '-nnum[number first page n]' 29 | '-olist[output only pages in list]' 30 | '-rcn[define a number register c as n]' 31 | '-wname[enable warning name]' 32 | '-z[suppress formatted output]' 33 | '-C[enable compatibility mode]' 34 | '-Darg[use arg as default input encoding. Implies -k]' 35 | '-E[inhibit all errors]' 36 | '-Fdir[search dir for device directories]' 37 | '-Idir[search dir for soelim, troff, and grops. Implies -s]' 38 | '-Karg[use arg as input encoding. Implies -k]' 39 | '-Larg[pass arg to the spooler]' 40 | '-Mdir[search dir for macro files]' 41 | '-N[dont allow newlines within eqn delimiters]' 42 | '-Parg[pass arg to the postprocessor]' 43 | '-S[enable safer mode (the default)]' 44 | '-Tdev[use device dev]' 45 | '-U[enable unsafe mode]' 46 | '-V[print commands on stdout instead of running them]' 47 | '-Wname[inhibit warning name]' 48 | '-X[use X11 previewer rather than usual postprocessor]' 49 | '-Z[dont postprocess]' 50 | '*:filename:_files' 51 | ) 52 | 53 | _arguments -s $arguments 54 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 |

2 |

3 | 4 | Zi Logo❮ Zi ❯ Playground 5 | 6 |

7 |

8 |

9 |
10 | z-shell/playground 11 |
12 |

13 | 14 |

15 | 16 | [![▶️ Playground](https://github.com/z-shell/playground/actions/workflows/run.yml/badge.svg)](https://github.com/z-shell/playground/actions/workflows/run.yml) 17 | 18 |


19 | 20 | ### Pull-requests welcomed! 21 | 22 | Feel free to submit your `zshrc` if it contains `zi` commands. 23 | 24 | You can either: 25 | 26 | - open a PR – fastest method 27 | - submit an issue with URL to the zshrc (or with the zshrc pasted) – [a quick link](https://github.com/z-shell/playground/issues/new?assignees=&labels=&template=request-to-add-zshrc.md) 28 | 29 | ## The repository structure 30 | 31 | The structure of the repository is very simple: 32 | 33 | - Directories named after the user-names of the submitting users. 34 | - In those directories there are files that the user decided to share. 35 | - For additional installs/setup, create and fill `bootstrap.zsh` 36 | 37 | ## Try configurations with docker 38 | 39 | ### Requirements 40 | 41 | You should have present on your system: 42 | 43 | - `zsh > 5.3` 44 | - [docker](https://docs.docker.com/install/) - `curl https://get.docker.com | sh` 45 | - [fzf](https://github.com/junegunn/fzf) or [fzy](https://github.com/jhawthorn/fzy) in your `$PATH`. 46 | 47 | #### You might choose to install via zi 48 | 49 | Install fzf: 50 | 51 | ```shell 52 | zi ice from"gh-r" as"command" 53 | zi load junegunn/fzf-bin 54 | ``` 55 | 56 | Install fzy: 57 | 58 | ```shell 59 | zi ice as"command" make"\!PREFIX=$ZPFX install" \ 60 | atclone"cp contrib/fzy-* $ZPFX/bin/" \ 61 | pick"$ZPFX/bin/fzy*" 62 | zi load jhawthorn/fzy 63 | ``` 64 | 65 | Keep in mind you will need a few Gb of free space to store docker images. 66 | 67 | ### Running a configuration 68 | 69 | To try a configuration, you have to clone this repository and execute a `run.sh` script: 70 | 71 | ```shell 72 | git clone 'https://github.com/z-shell/playground' 73 | ./playground/run.sh 74 | ``` 75 | 76 | Install and run this repository as a `zsh` plugin! 77 | 78 | ```shell 79 | zi load z-shell/playground 80 | playground 81 | ``` 82 | 83 | Now you will have to wait for a few minutes, while the required environment is 84 | being installed into the docker image. The next time you will want to try a configuration, loading it will take less time. 85 | -------------------------------------------------------------------------------- /profiles/lainiwa/1st_config/.zshrc: -------------------------------------------------------------------------------- 1 | # zmodload zsh/zprof 2 | 3 | # Set key bindings (Ctrl+V Key to see key code) 4 | bindkey -e 5 | bindkey "^A" vi-beginning-of-line # Ctrl+A 6 | bindkey "^E" vi-end-of-line # Ctrl+E 7 | bindkey "^[[1;5C" forward-word # Ctrl+Right 8 | bindkey "^[[1;5D" backward-word # Ctrl+Left 9 | bindkey ";2A" up-history # Shift+Up 10 | bindkey ";2B" down-history # Shift+Down 11 | bindkey "^[[5~" up-history # PageUp 12 | bindkey "^[[6~" down-history # PageDown 13 | 14 | 15 | # Return first installed util. 16 | # Example: `_1st_found most less more`. 17 | _1st_found() { 18 | for cmd in "$@"; do 19 | if type "$cmd" &>/dev/null; then 20 | printf "%s" "${cmd}" 21 | break 22 | fi 23 | done 24 | } 25 | 26 | # What characters are considered to be a part of a word 27 | export WORDCHARS='*?_-.[]~=&;!#$%^(){}<>' 28 | # Pager and editor 29 | export PAGER=$(_1st_found most less more) 30 | export EDITOR=$(_1st_found emacs vim vi) 31 | # Set a virtualenvwrapper path, if not already set (resolves tmux nesting issue) 32 | export VIRTUALENVWRAPPER_PYTHON="${VIRTUALENVWRAPPER_PYTHON:-$(which "$(_1st_found python3.9 python3.9 python3)")}" 33 | # Node Version Manager (NVM) direcory 34 | export NVM_DIR="${HOME}/.nvm" 35 | 36 | 37 | # Try to source: 38 | # NVM script and its completions 39 | # virtualenvwrapper 40 | # nix package manager 41 | # zsh settings 42 | # command-not-found functionality 43 | # python's virtualenvwrapper 44 | for file in "${NVM_DIR}/nvm.sh" \ 45 | "${NVM_DIR}/bash_completion" \ 46 | "${HOME}/.zsh/prompts.zsh" \ 47 | "${HOME}/.zsh/aliases.zsh" \ 48 | "${HOME}/.zsh/set_history.zsh" \ 49 | "${HOME}/.zsh/zi.zsh" \ 50 | "${HOME}/.zsh/completions.zsh" \ 51 | "${HOME}/.zsh/other/command-not-found.zsh" \ 52 | "${HOME}/.local/bin/virtualenvwrapper_lazy.sh" 53 | do 54 | [ -s "${file}" ] && source "${file}" 55 | done 56 | 57 | 58 | # Set some options 59 | setopt interactive_comments extended_glob autocd complete_aliases 60 | 61 | 62 | # Automatically list directory contents on `cd`. 63 | auto-ls () { ls; } 64 | [[ ${chpwd_functions[(r)auto-ls]} == auto-ls ]] || chpwd_functions=( auto-ls $chpwd_functions ) 65 | 66 | 67 | # Run manpage on Esc+h 68 | autoload -Uz run-help 69 | autoload -Uz run-help-git 70 | autoload -Uz run-help-sudo 71 | bindkey '^[h' run-help # Esc+h 72 | 73 | 74 | # Unset function so it would not be available is shell 75 | unset -f _1st_found 76 | 77 | # Choose binary in $PATH with fzf 78 | insert_binary_from_path() { 79 | cmd=$(print -rl -- ${(ko)commands} | fzf --height 40% --layout=reverse) 80 | LBUFFER="${LBUFFER}${cmd}" 81 | zle redisplay 82 | } 83 | zle -N insert_binary_from_path 84 | bindkey '^[d' insert_binary_from_path # Alt+d 85 | -------------------------------------------------------------------------------- /profiles/lainiwa/2nd_config/.zshrc: -------------------------------------------------------------------------------- 1 | # zmodload zsh/zprof 2 | 3 | # Set key bindings (Ctrl+V Key to see key code) 4 | bindkey -e 5 | bindkey "^A" vi-beginning-of-line # Ctrl+A 6 | bindkey "^E" vi-end-of-line # Ctrl+E 7 | bindkey "^[[1;5C" forward-word # Ctrl+Right 8 | bindkey "^[[1;5D" backward-word # Ctrl+Left 9 | bindkey ";2A" up-history # Shift+Up 10 | bindkey ";2B" down-history # Shift+Down 11 | bindkey "^[[5~" up-history # PageUp 12 | bindkey "^[[6~" down-history # PageDown 13 | 14 | 15 | # Return first installed util. 16 | # Example: `_1st_found most less more`. 17 | _1st_found() { 18 | for cmd in "$@"; do 19 | if type "$cmd" &>/dev/null; then 20 | printf "%s" "${cmd}" 21 | break 22 | fi 23 | done 24 | } 25 | 26 | # What characters are considered to be a part of a word 27 | export WORDCHARS='*?_-.[]~=&;!#$%^(){}<>' 28 | # Pager and editor 29 | export PAGER=$(_1st_found most less more) 30 | export EDITOR=$(_1st_found emacs vim vi) 31 | # Set a virtualenvwrapper path, if not already set (resolves tmux nesting issue) 32 | export VIRTUALENVWRAPPER_PYTHON="${VIRTUALENVWRAPPER_PYTHON:-$(which "$(_1st_found python3.6 python3.5 python3)")}" 33 | # Node Version Manager (NVM) direcory 34 | export NVM_DIR="${HOME}/.nvm" 35 | 36 | 37 | # Try to source: 38 | # NVM script and its completions 39 | # virtualenvwrapper 40 | # nix package manager 41 | # zsh settings 42 | # command-not-found functionality 43 | # python's virtualenvwrapper 44 | for file in "${NVM_DIR}/nvm.sh" \ 45 | "${NVM_DIR}/bash_completion" \ 46 | "${HOME}/.zsh/prompts.zsh" \ 47 | "${HOME}/.zsh/aliases.zsh" \ 48 | "${HOME}/.zsh/set_history.zsh" \ 49 | "${HOME}/.zsh/zinit.zsh" \ 50 | "${HOME}/.zsh/completions.zsh" \ 51 | "${HOME}/.zsh/other/command-not-found.zsh" \ 52 | "${HOME}/.local/bin/virtualenvwrapper_lazy.sh" 53 | do 54 | [ -s "${file}" ] && source "${file}" 55 | done 56 | 57 | 58 | # Set some options 59 | setopt interactive_comments extended_glob autocd complete_aliases 60 | 61 | 62 | # Automatically list directory contents on `cd`. 63 | auto-ls () { ls; } 64 | [[ ${chpwd_functions[(r)auto-ls]} == auto-ls ]] || chpwd_functions=( auto-ls $chpwd_functions ) 65 | 66 | 67 | # Run manpage on Esc+h 68 | autoload -Uz run-help 69 | autoload -Uz run-help-git 70 | autoload -Uz run-help-sudo 71 | bindkey '^[h' run-help # Esc+h 72 | 73 | 74 | # Unset function so it would not be available is shell 75 | unset -f _1st_found 76 | 77 | # Choose binary in $PATH with fzf 78 | insert_binary_from_path() { 79 | cmd=$(print -rl -- ${(ko)commands} | fzf --height 40% --layout=reverse) 80 | LBUFFER="${LBUFFER}${cmd}" 81 | zle redisplay 82 | } 83 | zle -N insert_binary_from_path 84 | bindkey '^[d' insert_binary_from_path # Alt+d 85 | -------------------------------------------------------------------------------- /profiles/jwdevelab/.zshrc: -------------------------------------------------------------------------------- 1 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 2 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 3 | fi 4 | if [[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/zi/init.zsh" ]]; then 5 | source "${XDG_CONFIG_HOME:-$HOME/.config}/zi/init.zsh" && zzinit 6 | fi 7 | 8 | # ================================================================================================= # 9 | [[ $COLORTERM = *(24bit|truecolor)* ]] || zmodload zsh/nearcolor 10 | auto-exa () { exa ${exa_params}; } 11 | [[ ${chpwd_functions[(r)auto-exa]} == auto-exa ]] || chpwd_functions=( auto-exa $chpwd_functions ) 12 | # ================================================================================================= # 13 | # setopt 14 | setopt hist_ignore_all_dups # Remove older duplicate entries from history 15 | setopt hist_expire_dups_first # Expire A Duplicate Event First When Trimming History. 16 | setopt hist_ignore_dups # Do Not Record An Event That Was Just Recorded Again. 17 | setopt hist_reduce_blanks # Remove superfluous blanks from history items 18 | setopt hist_find_no_dups # Do Not Display A Previously Found Event. 19 | setopt hist_ignore_space # Do Not Record An Event Starting With A Space. 20 | setopt hist_save_no_dups # Do Not Write A Duplicate Event To The History File. 21 | setopt hist_verify # Do Not Execute Immediately Upon History Expansion. 22 | setopt promptsubst 23 | # zstyle 24 | zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))' 25 | zstyle ':completion:*' use-cache true 26 | zstyle ':completion:*' rehash true 27 | zstyle ':completion:*' cache-path $ZSH_CACHE_DIR 28 | # ================================================================================================= # 29 | fpath+=( $ZDOTDIR/zsh/functions ) 30 | autoload -Uz mem setoptt whichcomp palette colormap 31 | 32 | zi is-snippet for svn \ 33 | pick"completion.zsh" multisrc'git.zsh functions.zsh \ 34 | {prompt_info_functions,clipboard,termsupport,history,grep}.zsh' OMZ::lib 35 | 36 | zi is-snippet for OMZP::ssh-agent OMZP::gpg-agent OMZP::sudo \ 37 | OMZP::encode64 OMZP::extract \ 38 | atload'zstyle ":completion:*" special-dirs false' PZTM::completion \ 39 | 40 | zi light-mode for z-shell/z-a-meta-plugins @annexes \ 41 | skip'fzy' @fuzzy skip'tig' @console-tools skip'F-Sy-H' @z-shell 42 | 43 | zi light-mode for \ 44 | birdhackor/zsh-exa-ls-plugin \ 45 | MichaelAquilina/zsh-you-should-use @zsh-users+fast @romkatv 46 | 47 | zicompinit 48 | zi snippet "$ZDOTDIR/aliases/aliases.zsh" 49 | zi snippet "$ZDOTDIR/bindmap/bindkeys.zsh" 50 | zi snippet "$ZDOTDIR/.p10k.zsh" 51 | 52 | # To customize prompt, run `p10k configure` or edit ~/.config/zsh/.zi/snippets/home--jwdev--.config--zsh/.p10k.zsh/.p10k.zsh. 53 | [[ ! -f ~/.config/zsh/.zi/snippets/home--jwdev--.config--zsh/.p10k.zsh/.p10k.zsh ]] || source ~/.config/zsh/.zi/snippets/home--jwdev--.config--zsh/.p10k.zsh/.p10k.zsh 54 | 55 | -------------------------------------------------------------------------------- /profiles/psprint/functions/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | **Table of Contents** _generated with [DocToc](https://github.com/thlorenz/doctoc)_ 5 | 6 | - [Collection of Zsh functions](#collection-of-zsh-functions) 7 | 8 | 9 | 10 | ## Collection of Zsh functions 11 | 12 | Listable by `pslist`: 13 | 14 | ```zsh 15 | % pslist 16 | ----------------------------------------------------------------------- 17 | pscopy_xauth Copies xauth data to "$1" at "$2" 18 | psffconv Converts (ffmpeg) file $1 to $2, or $1 to ${1:r}.mp4 19 | pslist Lists ~/functions/* with their embedded descriptions 20 | psls `ls` or `ls -A`, depending on [[ -d .git ]] 21 | psprobe_host Checks "$1" is alive, outputs also timestamp 22 | psrecompile Recompiles ~/.zshrc, ~/.zcompdump 23 | pssetup_ssl_cert Creates certificate (files key,crt,pem), see -h 24 | ----------------------------------------------------------------------- 25 | t1countdown Wait "$1" seconds for Ctrl-C (animated progress bar) 26 | t1fromhex Converts hex-triplet into terminal color index 27 | t1uncolor Perl invocation to strip color codes (use in pipe) 28 | ----------------------------------------------------------------------- 29 | f1biggest Size-sorts all descent files - finds biggest ones 30 | f1rechg Finds files changed in last 15 minutes 31 | f1rechg_x_min Finds files changed in last "$1" minutes 32 | ----------------------------------------------------------------------- 33 | g1all Iterates over *.git directories, runs git "$@" 34 | g1zip Creates `basename $(pwd)`-$(date ...) archive 35 | ----------------------------------------------------------------------- 36 | n1dict Queries dict.pl with $@ (w3m) 37 | n1diki Queries diki.pl with $@ (w3m) 38 | n1gglinks Queries google.com with $@ (links) 39 | n1ggw3m Queries google.com with $@ (w3m) 40 | n1ling Queries ling.pl with $@ (w3m) 41 | n1ssl_rtunnel $0 42 | n1ssl_tunnel $0 43 | ----------------------------------------------------------------------- 44 | x1iso2dmg Converts file $1 (iso) to ${1:r}.dmg 45 | ----------------------------------------------------------------------- 46 | is_macports Tests if $PATH contains /opt/local/bin 47 | localbin_off Removes /usr/local/{bin,sbin} from $PATH 48 | localbin_on Adds /usr/local/{bin,sbin} to $PATH 49 | mandelbrot Draws mandelbrot fractal 50 | optlbin_off Removes /opt/local/{bin,sbin} from $PATH 51 | optlbin_on Adds /opt/local/bin to $PATH 52 | setopt A setopt wrapper with tracing to /tmp/setopt.log 53 | zman Searches zshall with special keyword ($1) matching 54 | ----------------------------------------------------------------------- 55 | ``` 56 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/01_bug_report.yml: -------------------------------------------------------------------------------- 1 | name: "🐞 Bug report" 2 | description: File a bug report 3 | title: "[bug]: " 4 | labels: ["bug 🐞", "triage 📑"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated. 10 | - type: input 11 | id: environment 12 | attributes: 13 | label: Environment 14 | description: > 15 | Please describe your environment e.g: echo "OSTYPE=${OSTYPE} CPUTYPE=$(uname -m) / MACHINE_TYPE=$MACHTYPE ZSH_VERSION=${ZSH_VERSION}" 16 | 17 | It may contain any additional information which would help to reproduce the issue. 18 | placeholder: "OSTYPE=linux-gnu CPUTYPE=x86_64 / MACHINE_TYPE=x86_64 ZSH_VERSION=5.8" 19 | validations: 20 | required: true 21 | - type: textarea 22 | id: expected 23 | attributes: 24 | label: Expected behavior 25 | description: "Please describe the expected behavior" 26 | validations: 27 | required: true 28 | - type: textarea 29 | id: current 30 | attributes: 31 | label: Current behavior 32 | description: "Please describe how the bug manifests" 33 | validations: 34 | required: true 35 | - type: textarea 36 | id: reproduce 37 | attributes: 38 | label: Steps to reproduce 39 | description: "Explain the steps required to duplicate the issue" 40 | validations: 41 | required: true 42 | - type: textarea 43 | id: code-snippet 44 | attributes: 45 | label: Code snippet 46 | description: "Please insert your zshrc or just a short code snippet in concern" 47 | validations: 48 | required: true 49 | - type: textarea 50 | id: additional 51 | attributes: 52 | label: Aditional information 53 | description: "List any other information that is relevant to your issue. For reports and stats run `zi analytics`" 54 | validations: 55 | required: true 56 | - type: checkboxes 57 | attributes: 58 | label: Self-service 59 | description: | 60 | If you feel like you could contribute to this issue, please check the box below. This would tell us and other people looking for contributions that someone's working on it. 61 | If you do check this box, please send a pull request within 7 days so we can still delegate this to someone else. 62 | options: 63 | - label: I'd be willing to address this documentation request myself. 64 | - type: checkboxes 65 | attributes: 66 | label: Have you read the Contributing Guidelines? 67 | options: 68 | - label: I have read the [Contributing Guidelines](https://github.com/z-shell/community/blob/main/docs/CONTRIBUTING_GUIDELINES.md). 69 | required: true 70 | - type: checkboxes 71 | attributes: 72 | label: Are you familiar with Contributor Covenant Code of Conduct? 73 | options: 74 | - label: I have read the [Contributor Covenant Code of Conduct](https://github.com/z-shell/zi/blob/main/docs/CODE_OF_CONDUCT.md). 75 | required: true 76 | - type: input 77 | id: contact 78 | attributes: 79 | label: Contact Details 80 | description: How can we get in touch with you if we need more info? 81 | placeholder: ex. email@example.com 82 | validations: 83 | required: false 84 | -------------------------------------------------------------------------------- /profiles/agkozak/.profile: -------------------------------------------------------------------------------- 1 | # ~/.profile: executed by the command interpreter for login shells. 2 | # 3 | # https://github.com/agkozak/dotfiles 4 | # 5 | # shellcheck shell=sh 6 | # shellcheck disable=SC2034 7 | 8 | # AGKDOT_SYSTEMINFO {{{1 9 | 10 | export AGKDOT_SYSTEMINFO 11 | AGKDOT_SYSTEMINFO=$(uname -a) 12 | 13 | # }}}1 14 | 15 | # Environment variables {{{1 16 | 17 | export EDITOR VISUAL 18 | if command -v vim >/dev/null 2>&1; then 19 | EDITOR='vim' 20 | else 21 | EDITOR='vi' 22 | fi 23 | VISUAL="$EDITOR" 24 | 25 | export ENV 26 | ENV="$HOME/.shrc" 27 | 28 | case $(ls -l "$(command -v less)") in 29 | *busybox*) ;; 30 | *) 31 | case $AGKDOT_SYSTEMINFO in 32 | UWIN*) ;; 33 | *) 34 | export LESS 35 | LESS='-R' 36 | ;; 37 | esac 38 | ;; 39 | esac 40 | 41 | # if command -v lesspipe > /dev/null 2>&1; then 42 | # export LESSOPEN 43 | # LESSOPEN='| ~/.lessfilter %s' 44 | # elif command -v lesspipe.sh > /dev/null 2>&1; then 45 | # export LESSOPEN 46 | # LESSOPEN='| lesspipe.sh %s' 47 | # fi 48 | 49 | if [ -f "$HOME/.lynx.cfg" ]; then 50 | export LYNX_CFG 51 | LYNX_CFG="$HOME/.lynx.cfg" 52 | fi 53 | 54 | export MANPAGER 55 | MANPAGER='less -X' 56 | 57 | # Always use Unicode line-drawing characters, not VT100-style ones 58 | export NCURSES_NO_UTF8_ACS 59 | NCURSES_NO_UTF8_ACS=1 60 | 61 | export PAGER 62 | PAGER=less 63 | 64 | # More modern utilities on Solaris 65 | # case $systeminfo in 66 | # SunOS*) PATH="$(getconf PATH):$PATH" ;; 67 | # esac 68 | 69 | export PATH 70 | 71 | # Construct $PATH 72 | for i in "$HOME/.gem/ruby/3.0.0/bin" \ 73 | "$HOME/.local/bin" \ 74 | "$HOME/go/bin" \ 75 | "$HOME/.cabal/bin" \ 76 | "$HOME/.config/composer/vendor/bin" \ 77 | "$HOME/.composer/vendor/bin" \ 78 | "$HOME/.luarocks/bin" \ 79 | "$HOME/ruby/gems/bin" \ 80 | "$HOME/.rvim/bin" \ 81 | "$HOME/bin"; do 82 | if [ -d "$i" ]; then 83 | case :$PATH: in 84 | *:$i:*) ;; 85 | *) 86 | PATH="$i:$PATH" 87 | ;; 88 | esac 89 | fi 90 | done 91 | 92 | unset i 93 | 94 | case $AGKDOT_SYSTEMINFO in 95 | *Msys) [ -d /mingw64/bin ] && PATH="$PATH:/mingw64/bin" ;; 96 | esac 97 | 98 | # Load RVM into a shell session *as a function* 99 | # shellcheck source=/dev/null 100 | [ -s "$HOME/.rvm/scripts/rvm" ] && . "$HOME/.rvm/scripts/rvm" 101 | 102 | case $AGKDOT_SYSTEMINFO in 103 | Darwin* | FreeBSD*) 104 | export CLICOLOR LSCOLORS SSL_CERT_DIR SSL_CERT_FILE 105 | CLICOLOR=1 106 | LSCOLORS='ExfxcxdxBxegedAbagacad' 107 | SSL_CERT_DIR=/etc/ssl/certs 108 | SSL_CERT_FILE=/etc/ssl/cert.pem 109 | ;; 110 | *Msys) 111 | export MSYS SSL_CERT_DIR SSL_CERT_FILE 112 | # `ln` creates native symlinks in Windows -- only works for administrator 113 | MSYS="winsymlinks:nativestrict" 114 | unset PYTHONHOME 115 | [ ! -f /usr/bin/zsh ] && SHELL=/usr/bin/bash 116 | SSL_CERT_DIR=/mingw64/ssl/certs 117 | SSL_CERT_FILE=/mingw64/ssl/cert.pem 118 | ;; 119 | *Cygwin) 120 | export CYGWIN 121 | # `ln` creates native symlinks in Windows -- only works for administrator 122 | CYGWIN="winsymlinks:native" 123 | unset PYTHONHOME SSL_CERT_DIR SSL_CERT_FILE 124 | ;; 125 | *raspberrypi*) 126 | command -v chromium-browser >/dev/null 2>&1 && BROWSER='chromium-browser' 127 | ;; 128 | esac 129 | 130 | # }}}1 131 | 132 | # umask {{{1 133 | 134 | if [ "$(umask)" = "000" ]; then # For WSL 135 | umask 022 136 | fi 137 | 138 | # }}}1 139 | 140 | # Source ~/.profile.local {{{1 141 | 142 | if [ -f "$HOME/.profile.local" ]; then 143 | # shellcheck source=/dev/null 144 | . "$HOME/.profile.local" 145 | fi 146 | 147 | # }}}1 148 | 149 | # vim: fdm=marker:ts=2:sts=2:sw=2:ai:et 150 | -------------------------------------------------------------------------------- /profiles/dominik-schwabe/.zshrc: -------------------------------------------------------------------------------- 1 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 2 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 3 | fi 4 | source <(curl -sL https://init.zshell.dev); zzinit 5 | zi ice atinit'COMPLETION_WAITING_DOTS=true' 6 | zi snippet OMZL::completion.zsh 7 | zi ice wait'0' lucid 8 | zi light dominik-schwabe/vi-mode.zsh 9 | zi ice wait'!0' lucid 10 | zi light ~/.shell_plugins/asdf 11 | zi ice wait'0' lucid 12 | zi snippet OMZP::git 13 | zi ice wait'0' lucid 14 | zi snippet OMZP::pip 15 | zi ice wait'0' lucid 16 | zi light agkozak/zsh-z 17 | zi ice wait'0' lucid 18 | zi light t413/zsh-background-notify 19 | zi ice wait'0' lucid 20 | zi light zsh-users/zsh-history-substring-search 21 | zi ice wait'0' lucid 22 | zi light zsh-vi-more/vi-increment 23 | zi ice wait'0' lucid 24 | zi light zdharma-continuum/fast-syntax-highlighting 25 | zi ice wait'0' lucid 26 | zi light MichaelAquilina/zsh-you-should-use 27 | zi ice wait'0' lucid silent atinit'ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT=true' 28 | zi light kutsan/zsh-system-clipboard 29 | zi ice wait'0' lucid atload'zicompinit' 30 | zi light zsh-users/zsh-completions 31 | zi snippet 'https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh' 32 | 33 | [[ -z "$LS_COLORS" ]] && (( $+commands[dircolors] )) && eval "$(dircolors -b)" 34 | zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" 35 | 36 | bindkey -M vicmd 'k' history-substring-search-up 37 | bindkey -M vicmd 'j' history-substring-search-down 38 | 39 | ## use the vi navigation keys in menu completion 40 | bindkey -M menuselect 'h' vi-backward-char 41 | bindkey -M menuselect 'k' vi-up-line-or-history 42 | bindkey -M menuselect 'l' vi-forward-char 43 | bindkey -M menuselect 'j' vi-down-line-or-history 44 | 45 | ls_on() { 46 | chpwd() { 47 | emulate -L zsh 48 | ls 49 | } 50 | } 51 | 52 | ls_off() { 53 | chpwd() { } 54 | } 55 | 56 | ls_on 57 | 58 | unset correctall 59 | 60 | # theme 61 | DEFAULT_COLOR="2" 62 | ROOT_COLOR="161" 63 | SSH_COLOR="214" 64 | 65 | PROMPT_COLOR=${DEFAULT_COLOR:-green} 66 | [[ "$UID" = "0" ]] && PROMPT_COLOR=${ROOT_COLOR:-red} 67 | [[ "$SSH_TTY" ]] && PROMPT_COLOR=${SSH_COLOR:-blue} 68 | 69 | git_prompt_info() { 70 | if ref=$(git symbolic-ref HEAD 2>&1); then 71 | branch=${ref#refs/heads/} 72 | if [[ "$branch" = "master" || "$branch" = "main" ]]; then 73 | echo " %F{1}$branch%f" 74 | else 75 | echo " %F{3}$branch%f" 76 | fi 77 | else 78 | [[ "$ref" = 'fatal: ref HEAD is not a symbolic ref' ]] && echo " %F{14}no branch%f" 79 | fi 80 | } 81 | PROMPT='%B%F{'$PROMPT_COLOR'}%n%f%F{7}@%F{'$PROMPT_COLOR'}%m %F{blue}%2~%f%B$(git_prompt_info)%b%b >>> ' 82 | 83 | declare -u _GET_ASDF_VERSION_VARIABLE_NAME 84 | _get_asdf_versions_prompt() { 85 | _GET_ASDF_VERSION_VARIABLE_NAME=ASDF_$1_VERSION 86 | if DEFINED_NAME=$(export -p "$_GET_ASDF_VERSION_VARIABLE_NAME") 2>/dev/null && [[ "$DEFINED_NAME" = 'export'* ]]; then 87 | eval "_VERSIONS=\$$_GET_ASDF_VERSION_VARIABLE_NAME" 88 | [[ -n "$_VERSIONS" ]] && { 89 | echo "$_VERSIONS" 90 | return 0 91 | } 92 | fi 93 | [[ -r ~/.tool-versions ]] || return 1 94 | while read LINE; do 95 | IFS=" " read _ASDF_PROG_NAME _ASDF_PROG_VERSION <<< $LINE; 96 | if [[ "$_ASDF_PROG_NAME" = $1 ]]; then 97 | echo "$_ASDF_PROG_VERSION" 98 | return 0 99 | fi 100 | done < "$HOME/.tool-versions" 101 | return 1 102 | } 103 | 104 | get_python_version() { _get_asdf_versions_prompt python || echo system } 105 | get_node_version() { _get_asdf_versions_prompt nodejs || echo system } 106 | RPS1='%(?..%F{1}%B%?%b%f )% %w %B%F{11}%T%f%b%F{9}%B $(get_python_version)%b%f%F{34}%B $(get_node_version)%b%f' 107 | # theme end 108 | 109 | setopt hist_ignore_dups hist_ignore_space interactivecomments noextendedhistory nosharehistory auto_cd multios prompt_subst histignorealldups 110 | 111 | exit_zsh() { exit } 112 | zle -N exit_zsh 113 | bindkey -M viins '^D' exit_zsh 114 | bindkey -M vicmd '^D' exit_zsh 115 | 116 | autoload -Uz bracketed-paste-magic 117 | zle -N bracketed-paste bracketed-paste-magic 118 | autoload -Uz url-quote-magic 119 | zle -N self-insert url-quote-magic 120 | 121 | expand-alias() { zle _expand_alias } 122 | zle -N expand-alias 123 | bindkey -M viins '^[OS' expand-alias 124 | bindkey -M vicmd '^[OS' expand-alias 125 | 126 | alias -g ...='../..' 127 | alias -g ....='../../..' 128 | alias -g .....='../../../..' 129 | alias -g ......='../../../../..' 130 | 131 | bindkey -r -M vicmd '\ec' 132 | bindkey -r -M viins '\ec' 133 | 134 | bindkey -M vicmd '^P' fzf-cd-widget 135 | bindkey -M viins '^P' fzf-cd-widget 136 | -------------------------------------------------------------------------------- /profiles/numToStr/zshrc.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env/zsh 2 | 3 | ### Added by ZI's installer 4 | if [[ ! -f $HOME/.zi/bin/zi.zsh ]]; then 5 | print -P "%F{33}▓▒░ %F{220}Installing %F{33}ZI%F{220} Initiative Plugin Manager (%F{33}z-shell/zi%F{220})…%f" 6 | command mkdir -p "$HOME/.zi" && command chmod g-rwX "$HOME/.zi" 7 | command git clone https://github.com/z-shell/zi "$HOME/.zi/bin" && \ 8 | print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \ 9 | print -P "%F{160}▓▒░ The clone has failed.%f%b" 10 | fi 11 | source "$HOME/.zi/bin/zi.zsh" 12 | autoload -Uz _zi 13 | (( ${+_comps} )) && _comps[zi]=_zi 14 | ### End of ZI's installer chunk 15 | 16 | ##################### 17 | # PROMPT # 18 | ##################### 19 | zi lucid for \ 20 | as"command" from"gh-r" atinit'export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"' atload'eval "$(starship init zsh)"' bpick'*unknown-linux-gnu*' \ 21 | starship/starship \ 22 | 23 | 24 | ########################## 25 | # OMZ Libs and Plugins # 26 | ########################## 27 | 28 | # IMPORTANT: 29 | # Ohmyzsh plugins and libs are loaded first as some these sets some defaults which are required later on. 30 | # Otherwise something will look messed up 31 | # ie. some settings help zsh-autosuggestions to clear after tab completion 32 | 33 | setopt promptsubst 34 | 35 | # Explanation: 36 | # - Loading tmux first, to prevent jumps when tmux is loaded after .zshrc 37 | # - History plugin is loaded early (as it has some defaults) to prevent empty history stack for other plugins 38 | zi lucid for \ 39 | atinit"\ 40 | ZSH_TMUX_FIXTERM=true \ 41 | ZSH_TMUX_AUTOSTART=true \ 42 | ZSH_TMUX_AUTOCONNECT=true" \ 43 | OMZP::tmux \ 44 | atinit"HIST_STAMPS=dd.mm.yyyy" \ 45 | OMZL::history.zsh \ 46 | 47 | zi wait lucid for \ 48 | OMZL::clipboard.zsh \ 49 | OMZL::compfix.zsh \ 50 | OMZL::completion.zsh \ 51 | OMZL::correction.zsh \ 52 | atload"\ 53 | alias ..='cd ..' \ 54 | alias ...='cd ../..' \ 55 | alias ....='cd ../../..' \ 56 | alias .....='cd ../../../..'" \ 57 | OMZL::directories.zsh \ 58 | OMZL::git.zsh \ 59 | OMZL::grep.zsh \ 60 | OMZL::key-bindings.zsh \ 61 | OMZL::spectrum.zsh \ 62 | OMZL::termsupport.zsh \ 63 | atload"\ 64 | alias gcd='gco dev'" \ 65 | OMZP::git \ 66 | atload"\ 67 | alias dcupb='docker-compose up --build'" \ 68 | OMZP::docker-compose \ 69 | as"completion" \ 70 | OMZP::docker/_docker \ 71 | djui/alias-tips \ 72 | # hlissner/zsh-autopair \ 73 | # chriskempson/base16-shell \ 74 | 75 | ##################### 76 | # PLUGINS # 77 | ##################### 78 | # @source: https://github.com/crivotz/dot_files/blob/master/linux/zplugin/zshrc 79 | 80 | # IMPORTANT: 81 | # These plugins should be loaded after ohmyzsh plugins 82 | 83 | zi wait lucid for \ 84 | light-mode atinit"ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20" atload"_zsh_autosuggest_start" \ 85 | zsh-users/zsh-autosuggestions \ 86 | light-mode atinit"typeset -gA FAST_HIGHLIGHT; FAST_HIGHLIGHT[git-cmsg-len]=100; zicompinit; zicdreplay;" \ 87 | z-shell/F-Sy-H \ 88 | light-mode blockf atpull'zi creinstall -q .' \ 89 | atinit" \ 90 | zstyle ':completion:*' completer _expand _complete _ignored _approximate \ 91 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' \ 92 | zstyle ':completion:*' menu select=2 \ 93 | zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s' \ 94 | zstyle ':completion:*:descriptions' format '-- %d --' \ 95 | zstyle ':completion:*:processes' command 'ps -au$USER' \ 96 | zstyle ':completion:complete:*:options' sort false \ 97 | zstyle ':fzf-tab:complete:_zlua:*' query-string input \ 98 | zstyle ':completion:*:*:*:*:processes' command 'ps -u $USER -o pid,user,comm,cmd -w -w' \ 99 | zstyle ':fzf-tab:complete:kill:argument-rest' extra-opts --preview=$extract'ps --pid=$in[(w)1] -o cmd --no-headers -w -w' --preview-window=down:3:wrap \ 100 | zstyle ':fzf-tab:complete:cd:*' extra-opts --preview=$extract'exa -1 --color=always ${~ctxt[hpre]}$in'" \ 101 | zsh-users/zsh-completions \ 102 | bindmap"^R -> ^H" atinit"\ 103 | zstyle :history-search-multi-word page-size 10 \ 104 | zstyle :history-search-multi-word highlight-color fg=red,bold \ 105 | zstyle :plugin:history-search-multi-word reset-prompt-protect 1" \ 106 | z-shell/H-S-MW \ 107 | reset \ 108 | atclone"local P=${${(M)OSTYPE:#*darwin*}:+g}${P}sed -i '/DIR/c\DIR 38;5;63;1' LS_COLORS; ${P}dircolors -b LS_COLORS > c.zsh" \ 109 | atpull'%atclone' pick"c.zsh" nocompile'!' \ 110 | atload'zstyle ":completion:*" list-colors “${(s.:.)LS_COLORS}”' \ 111 | trapd00r/LS_COLORS \ 112 | 113 | ##################### 114 | # PROGRAMS # 115 | ##################### 116 | 117 | zi wait'1' lucid light-mode for \ 118 | from"gh-r" as"program" \ 119 | junegunn/fzf \ 120 | pick"z.sh" \ 121 | knu/z \ 122 | as'command' atinit'export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"' pick"bin/n" \ 123 | tj/n \ 124 | from'gh-r' as'command' atinit'export PATH="$HOME/.yarn/bin:$PATH"' mv'yarn* -> yarn' pick"yarn/bin/yarn" bpick'*.tar.gz' \ 125 | yarnpkg/yarn \ 126 | 127 | 128 | ##################### 129 | # Misc Stuff # 130 | ##################### 131 | 132 | zi is-snippet for \ 133 | if"[[ -f $HOME/.localrc ]]" $HOME/.localrc 134 | -------------------------------------------------------------------------------- /profiles/psprint/functions/acc_print: -------------------------------------------------------------------------------- 1 | # A function that displays given text surrounding it with 2 | # horizontal-rules (the `bars') with given color and using 3 | # given bar-character. The main point is: 4 | # - one can passs colorized text (ANSI escape sequences), and 5 | # it will not disturb the output (i.e. it will not confuse 6 | # the bars' lengths) 7 | # - one can pass the same options as to `print' builtin - the 8 | # options are fully parsed and separated from the `private' 9 | # options of the acc_print 10 | # - acc_print will not print unless --print option given - the 11 | # main result of the funcction is then input text lenght ( 12 | # resilient to the ANSI escapes) in `REPLY', and complete print 13 | # arguments in `reply' (so that user can do: print "${reply[@]}" 14 | # 15 | # Options --dbg --bar-above --bar-below --both-bars --print --bar-char: 16 | # --bar-color: are mostly self-explaining. The --bar-color is an escape 17 | # string (e.g. taken from $fg[blue]). The colon : denotes options that 18 | # require an argument. --dbg will show some information on the acc_print 19 | # state and operation. 20 | # 21 | # The prefix acc_* comes from accumulation, i.e. following use case is 22 | # possible: 23 | # 24 | # acc_print -n "Test$fg[yellow]MSG$reset_color" 25 | # acc_print "${reply[@]}" "\nLength of the above message: $REPLY" 26 | # acc_print "${reply[@]}" "\nFinished::)\n" --print 27 | # 28 | # By passing the $reply from previous call one accumulates multiple 29 | # prints. The last one does the whole aggregated data displying, by 30 | # obeying the --print option. The effect: 31 | # 32 | # TestMSG 33 | # Length of the above message: 7 34 | # Finished::) 35 | # 36 | # One problem - above example will wrongly print the bars, with e.g. 37 | # --both-bars passed, because it will have the length of the sum of 38 | # all 3 strings lengths. A workaround: 39 | # 40 | # integer prev max 41 | # acc_print -n "Test$fg[yellow]MSG$reset_color" 42 | # prev=$REPLY max=$REPLY 43 | # acc_print "${reply[@]}" "\nLength of the above message: $REPLY" 44 | # max=$(( max = (REPLY-prev) > max ? REPLY-prev : max )) 45 | # prev+=REPLY 46 | # acc_print "${reply[@]}" "\nFinished::)\n" 47 | # max=$(( max = (REPLY-prev) > max ? REPLY-prev : max )) 48 | # print -- ${(l:max::-:):-} 49 | # acc_print "${reply[@]}" --print 50 | # print -- ${(l:max::-:):-} 51 | # 52 | # Other problem: escape sequences like \n \r etc. should be also 53 | # ignored in the length returned by REPLY (if not using -r print 54 | # option). 55 | # 56 | acc_print() { 57 | setopt localoptions extendedglob typesetsilent warncreateglobal 58 | local -A opthash 59 | local -a optarray 60 | integer pdebug 61 | 62 | # The ${^...} (with additional s-flag, i.e. the s::) will expand every 63 | # splitted sequence of elements to append the =optarg to them. Thus, 64 | # there will be a semi-separation of storage of the non-argument options 65 | # (landing in both `optarray' and `opthash') and of the with-argument 66 | # options (landing only in the hash `opthash'. 67 | # Note: (s::) splits on every character. 68 | 69 | local -a private_opts 70 | private_opts=( --dbg --bar-above --bar-below --both-bars --print --bar-char: --bar-color: ) 71 | # ${(s::)^:-abcDilmnNoOpPrsSzRe}=optarray will expand to each character 72 | # (the split on null string does this, s::) with =optarray appended (the 73 | # ^ does this). 74 | zparseopts -E -D -A opthash ${(s::)^:-abcDilmnNoOpPrsSzRe}=optarray u: f: C: v: x: X: ${private_opts[@]#-} || \ 75 | { builtin print -r -- "Bad options given to the internal \`acc_print' function, aborting the function call"; return 1; } 76 | 77 | # 1st return value: length of the string without escape codes 78 | local input="${(j: :)@}" 79 | input="${input//$'\x1b'\[[0-9;]##m/}" 80 | typeset -g REPLY=${#input} 81 | 82 | # arg_keys - the keys in the opthash that belong to the with-value 83 | # options. Basically, :# means "filter out from array", 84 | # ${(~j:|:)optarray[@]]] means: connect all elements via alternative 85 | # - so this :# and a|b|c filters-out non-argument options from the 86 | # opthash (plus also the private_opts, i.e. non print-options 87 | local -a arg_keys 88 | arg_keys=( ${(k)opthash[@]:#(${(~j:|:)optarray[@]}|${(~j:|:)private_opts%:})} ) 89 | 90 | # Some debug messages to enable (by reoving the colon) 91 | (( ${+opthash[--dbg]} )) && { 92 | builtin print -r -- OPTION-HASH '(ALL OPTIONS)': ${(q-kv)opthash[@]} 93 | builtin print -r -- OPTION-ARRAY '(NON-ARGUMENT OPTIONS)': "${(q-)optarray[@]}" 94 | builtin print -r -- ARGUMENT-ONLY-OPTIONS: "${(kv@)opthash[(I)(${(~j:|:)arg_keys[@]})]}" 95 | 96 | builtin print 97 | builtin print -r -- "The command to be run in case of --print option:" 98 | builtin print -r -- print "${(kv@)opthash[(I)(${(~j:|:)arg_keys[@]})]}" \ 99 | "${optarray[@]}" "${(q-)@}" 100 | } 101 | 102 | # 2nd return value: the complete arguments for the print builtin 103 | typeset -ga reply 104 | reply=( "${(kv@)opthash[(I)(${(~j:|:)arg_keys[@]})]}" "${optarray[@]}" "$@" ) 105 | 106 | local bar_char="${opthash[--bar-char]:--}" 107 | (( ${+opthash[--bar-above]} + ${+opthash[--both-bars]} )) && \ 108 | print -- "${opthash[--bar-color]:-}${(pl:REPLY::$bar_char:):-}${opthash[--bar-color]:+$reset_color}" 109 | (( ${+opthash[--print]} )) && builtin print "${(kv@)opthash[(I)(${(~j:|:)arg_keys[@]})]}" "${optarray[@]}" "$@" 110 | (( ${+opthash[--bar-below]} + ${+opthash[--both-bars]} )) && \ 111 | print -- "${opthash[--bar-color]:-}${(pl:REPLY::$bar_char:):-}${opthash[--bar-color]:+$reset_color}" 112 | } 113 | # vim:ft=zsh:et:wrap:sw=4:sts=4 114 | -------------------------------------------------------------------------------- /profiles/colerar/zshrc.zsh: -------------------------------------------------------------------------------- 1 | if [[ ! -f $HOME/.zi/bin/zi.zsh ]]; then 2 | print -P "%F{33}▓▒░ %F{160}Installing (%F{33}z-shell/zi%F{160})…%f" 3 | command mkdir -p "$HOME/.zi" && command chmod g-rwX "$HOME/.zi" 4 | command git clone -q --depth=1 --branch "main" https://github.com/z-shell/zi "$HOME/.zi/bin" && \ 5 | print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \ 6 | print -P "%F{160}▓▒░ The clone has failed.%f%b" 7 | fi 8 | source "$HOME/.zi/bin/zi.zsh" 9 | autoload -Uz _zi 10 | (( ${+_comps} )) && _comps[zi]=_zi 11 | 12 | # ZSH option 13 | 14 | ## history setting 15 | setopt HIST_IGNORE_ALL_DUPS HIST_EXPIRE_DUPS_FIRST HIST_IGNORE_DUPS HIST_IGNORE_SPACE HIST_SAVE_NO_DUPS INC_APPEND_HISTORY 16 | 17 | ## pushd and other 18 | setopt PUSHD_IGNORE_DUPS AUTO_PUSHD AUTO_LIST INTERACTIVE_COMMENTS AUTO_CD 19 | 20 | ## completion settings - pretty print - ignore case 21 | zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" 22 | zstyle ':completion:*:matches' group 'yes' 23 | zstyle ':completion:*:options' description 'yes' 24 | zstyle ':completion:*:options' auto-description '%d' 25 | zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f' 26 | zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f' 27 | zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f' 28 | zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f' 29 | zstyle ':completion:*:default' list-prompt '%S%M matches%s' 30 | zstyle ':completion:*' format ' %F{yellow}-- %d --%f' 31 | zstyle ':completion:*' group-name '' 32 | zstyle ':completion:*' verbose yes 33 | zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 34 | zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))' 35 | zstyle ':completion:*' use-cache true 36 | zstyle ':completion:*' rehash true 37 | 38 | # exports 39 | 40 | ## faster startup, but less safer 41 | export ZSH_DISABLE_COMPFIX="true" 42 | 43 | ## LS color, defined esp. for cd color, 'cause exa has its own setting 44 | export CLICOLOR=1 45 | export LSCOLORS=ExGxFxdaCxDaDahbadeche 46 | 47 | ## needs Clash installed 48 | export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 49 | 50 | ## needs Secretive installed - https://github.com/maxgoedjen/secretive 51 | export SSH_AUTH_SOCK=/Users/col/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh 52 | 53 | ## brew install gnupg 54 | export GPG_TTY=$(tty) 55 | 56 | export LANG=en_US.UTF-8 57 | 58 | ## brew install llvm; delete if you are not macos 59 | export PATH="/usr/local/opt/llvm/bin:$PATH" 60 | export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" 61 | export CPPFLAGS="-I/usr/local/opt/llvm/include" 62 | 63 | ## brew install openssl; delete if you are not macos 64 | export PATH="/usr/local/opt/openssl@3/bin:$PATH" 65 | export LDFLAGS="-L/usr/local/opt/openssl@3/lib" 66 | export CPPFLAGS="-I/usr/local/opt/openssl@3/include" 67 | export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig" 68 | 69 | # zi 70 | 71 | ## - zsh-aliases-exa: exa required 72 | ## 73 | ## - macos: only for macOS 74 | ## 75 | ## - git: git required 76 | ## 77 | ## - brew: brew required 78 | ## 79 | ## - vscode 80 | ## 81 | ## brew install --cask visual-studio code 82 | ## or ln -s /path/to/vscode /user/local/bin/code 83 | ## for example: ln -s "/Applications/Visual Studio Code.app/Contents/MacOS/Electron" /usr/local/bin/code 84 | 85 | zi wait lucid light-mode depth"1" for \ 86 | atinit"ZI[COMPINIT_OPTS]=-C;" \ 87 | z-shell/F-Sy-H \ 88 | atload"!_zsh_autosuggest_start" \ 89 | zsh-users/zsh-autosuggestions \ 90 | pick"z.sh" \ 91 | z-shell/z \ 92 | compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh' atload" \ 93 | PURE_PROMPT_SYMBOL='λ';" \ 94 | sindresorhus/pure \ 95 | as'completion' atload'zicompinit; zicdreplay; def_lazyloads' \ 96 | zsh-users/zsh-completions \ 97 | multisrc="{directories,functions}.zsh" pick"/dev/null" \ 98 | Colerar/omz-extracted \ 99 | svn \ 100 | https://github.com/ohmyzsh/ohmyzsh/trunk/plugins/macos \ 101 | as"completion" blockf \ 102 | https://raw.githubusercontent.com/Colerar/Tracks/cli/completions/_tracks \ 103 | https://gist.githubusercontent.com/Colerar/2f23c76583ac7866a50cda5bb04ff3a4/raw/sha-alias.plugin.zsh \ 104 | Colerar/zsh-aliases-exa \ 105 | OMZL::git.zsh \ 106 | OMZL::key-bindings.zsh \ 107 | OMZP::git \ 108 | OMZP::brew \ 109 | OMZP::autojump \ 110 | OMZP::vscode 111 | 112 | PS1=`print "%F{magenta}λ%f "` 113 | 114 | # functions 115 | 116 | ## jenv 117 | ## brew install jenv 118 | eval export PATH="$HOME/.jenv/shims:${PATH}" 119 | 120 | # 0.1 s faster 121 | __lazyload_jenv() { 122 | unfunction __lazyload_jenv 123 | export JENV_SHELL=zsh 124 | export JENV_LOADED=1 125 | unset JAVA_HOME 126 | source '/usr/local/Cellar/jenv/0.5.4/libexec/completions/jenv.zsh' 127 | jenv rehash 2>/dev/null 128 | jenv refresh-plugins 129 | } 130 | 131 | jenv() { 132 | __lazyload_jenv() 133 | typeset command 134 | command="$1" 135 | if [ "$#" -gt 0 ]; then 136 | shift 137 | fi 138 | 139 | case "$command" in 140 | enable-plugin|rehash|shell|shell-options) 141 | eval `jenv "sh-$command" "$@"`;; 142 | *) 143 | command jenv "$command" "$@";; 144 | esac 145 | } 146 | 147 | function def_lazyloads() { 148 | unfunction def_lazyloads 149 | 150 | # gh: Colerar/tracks 151 | function __lazyload_tracks_completion() { 152 | [[ -e ~/.zi/completions/_tracks ]] && source ~/.zi/completions/_tracks 153 | } 154 | 155 | compdef __lazyload_tracks_completion tracks 156 | } 157 | 158 | # Alias 159 | 160 | alias rm='move1(){ /bin/mv -f $@ ~/.trash/; };move1 $@' 161 | 162 | alias grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}' 163 | 164 | emptytrash() { 165 | sudo /bin/rm -rf ~/.trash/* 166 | } 167 | 168 | alias -s gz='tar -xzvf' 169 | alias -s tgz='tar -xzvf' 170 | alias -s zip='unzip' 171 | alias -s bz2='tar -xjvf' 172 | alias -s zshrc=vi 173 | alias -s zsh=zsh 174 | alias gcid="git rev-parse --short HEAD | pbcopy" 175 | 176 | alias tracksub="tracks dig -so -ze -zt China" 177 | -------------------------------------------------------------------------------- /profiles/lainiwa/1st_config/.zsh/completions/_my: -------------------------------------------------------------------------------- 1 | #compdef _my my 2 | 3 | _my() { 4 | local line 5 | 6 | _arguments -C \ 7 | "-h[Show help information]" \ 8 | "--h[Show help information]" \ 9 | "1: :(show_installed \ 10 | disks \ 11 | current_layout_indicator \ 12 | i3_exit_menu \ 13 | fix_zsh_history \ 14 | random_reddit_image \ 15 | set_bg \ 16 | save_4chan_thread_imgs \ 17 | transfer \ 18 | most_used_commands \ 19 | history_hours_freq \ 20 | weather \ 21 | hr \ 22 | cclip \ 23 | screenshot \ 24 | serveo \ 25 | jqv \ 26 | curl_first_ok \ 27 | ip \ 28 | map \ 29 | speedtest \ 30 | graph_dependencies \ 31 | pastebin \ 32 | install_from_web \ 33 | install_package \ 34 | fullUpgrade \ 35 | check_dependencies \ 36 | dependencies \ 37 | allitebooks \ 38 | ijrnl \ 39 | fill_requirements_txt \ 40 | )" \ 41 | "*::arg:->args" 42 | 43 | case $line[1] in 44 | set_bg) 45 | _set_bg 46 | ;; 47 | save_4chan_thread_imgs) 48 | _save_4chan_thread_imgs 49 | ;; 50 | screenshot) 51 | _screenshot 52 | ;; 53 | graph_dependencies) 54 | _graph_dependencies 55 | ;; 56 | pastebin) 57 | _pastebin 58 | ;; 59 | install_package) 60 | _install_package 61 | ;; 62 | dependencies) 63 | _dependencies 64 | ;; 65 | esac 66 | 67 | } 68 | 69 | _set_bg() { 70 | local line 71 | 72 | _arguments -C \ 73 | "1: :(disk reddit)" \ 74 | "*::arg:->args" 75 | 76 | case $line[1] in 77 | *) 78 | _files -g "*.(jpg|jpeg|png)" 79 | ;; 80 | esac 81 | } 82 | 83 | _save_4chan_thread_imgs() { 84 | local -a commands 85 | IFS=$'\n' commands=($( 86 | curl --silent 'http://www.4chan.org/' | 87 | grep '^||' | # remove unnecessary html 90 | sed -e 's|||' | # now we have a "a Anime & Manga" kind of lines 91 | sed -e 's|\ |:|' | # fit autocompletion format command:description 92 | sed -e 's|\&|\&|' # resolve ampersands 93 | )) 94 | 95 | if ((CURRENT == 2)); then 96 | _describe -t commands 'commands' commands 97 | fi 98 | 99 | local board 100 | local html 101 | local threads 102 | local titles 103 | if ((CURRENT == 3)) && 104 | command -v hxnormalize >/dev/null 2>&1 && # require html-xml-utils 105 | command -v hxselect >/dev/null 2>&1; then # 106 | if [[ "${board}" != "${line[2]}" ]]; then 107 | board="${line[2]}" 108 | html=$(curl --silent --location "http://boards.4channel.org/${board}/") 109 | threads=$(echo "${html}" | lynx -dump -nonumbers -listonly -stdin | 110 | grep 'thread/[0-9]*$' | sed 's|.*thread/||g') 111 | titles=$(echo "${html}" | hxnormalize -x | tr -d '\n' | 112 | hxselect -c -s '\n' '.postInfo .subject') 113 | IFS=$'\n' commands=($( 114 | paste -d ':' <(echo "${threads}") <(echo "${titles}") 115 | )) 116 | fi 117 | _describe -t commands 'commands' commands 118 | fi 119 | 120 | return 0 121 | } 122 | 123 | _screenshot() { 124 | local -a commands 125 | commands=( 126 | 'full:Shoot whole screen' 127 | 'select:Select an area with mouse to shoot' 128 | 'focused:Shoot focused window' 129 | ) 130 | 131 | if ((CURRENT == 2)); then 132 | _describe -t commands 'commands' commands 133 | fi 134 | 135 | return 0 136 | } 137 | 138 | _graph_dependencies() { 139 | local -a commands 140 | commands=($(dpkg --get-selections | sed 's/\t.*//')) 141 | 142 | if ((CURRENT == 2)); then 143 | _describe -t commands 'commands' commands 144 | fi 145 | 146 | return 0 147 | } 148 | 149 | _pastebin() { 150 | local line 151 | 152 | _arguments -C \ 153 | "-h[Show help information]" \ 154 | "--help[Show help information]" \ 155 | "-x[Insert download URL into clipboard]" \ 156 | "--xclip[Insert download URL into clipboard]" \ 157 | "-e[Ecrypt file with GPG]" \ 158 | "--encrypt[Ecrypt file with GPG]" \ 159 | "*::arg:->args" 160 | 161 | case $line[1] in 162 | *) 163 | _files 164 | ;; 165 | esac 166 | } 167 | 168 | _install_package() { 169 | local -a commands 170 | commands=( 171 | 'autobench:HTTP benchmark tool' 172 | 'remarkable:Markdown graphical editor' 173 | 'cgo:Console non-curses gopher client' 174 | 'tomb:Encrypt files' 175 | 'tor-browser:A tor browser from git releases' 176 | 'vte-ng:Enhanced vte terminal widget' 177 | 'dfc:Report file system space usage information' 178 | 'sent:Simple plaintext presentation tool' 179 | 'docker-compose:Tool for defining and running multi-container Docker applications' 180 | 'grv:Terminal interface for viewing git repositories' 181 | 'icecat:A GNU version of Firefox browser' 182 | ) 183 | 184 | if ((CURRENT == 2)); then 185 | _describe -t commands 'commands' commands 186 | fi 187 | 188 | return 0 189 | } 190 | 191 | _dependencies() { 192 | local -a commands 193 | commands=( 194 | 'self:Dependencies found in current file' 195 | 'posix:POSIX utils' 196 | 'non-posix:Non-POSIX dependencies' 197 | 'check:Notify if some dependency is missing' 198 | ) 199 | 200 | if ((CURRENT == 2)); then 201 | _describe -t commands 'commands' commands 202 | fi 203 | 204 | return 0 205 | } 206 | 207 | _my "$@" 208 | -------------------------------------------------------------------------------- /profiles/lainiwa/2nd_config/.zsh/completions/_my: -------------------------------------------------------------------------------- 1 | #compdef _my my 2 | 3 | 4 | _my() { 5 | local line 6 | 7 | _arguments -C \ 8 | "-h[Show help information]" \ 9 | "--h[Show help information]" \ 10 | "1: :(show_installed \ 11 | disks \ 12 | current_layout_indicator \ 13 | i3_exit_menu \ 14 | fix_zsh_history \ 15 | random_reddit_image \ 16 | set_bg \ 17 | save_4chan_thread_imgs \ 18 | transfer \ 19 | most_used_commands \ 20 | history_hours_freq \ 21 | weather \ 22 | hr \ 23 | cclip \ 24 | screenshot \ 25 | serveo \ 26 | jqv \ 27 | curl_first_ok \ 28 | ip \ 29 | map \ 30 | speedtest \ 31 | graph_dependencies \ 32 | pastebin \ 33 | install_from_web \ 34 | install_package \ 35 | fullUpgrade \ 36 | check_dependencies \ 37 | dependencies \ 38 | allitebooks \ 39 | ijrnl \ 40 | fill_requirements_txt \ 41 | )" \ 42 | "*::arg:->args" 43 | 44 | case $line[1] in 45 | set_bg) 46 | _set_bg 47 | ;; 48 | save_4chan_thread_imgs) 49 | _save_4chan_thread_imgs 50 | ;; 51 | screenshot) 52 | _screenshot 53 | ;; 54 | graph_dependencies) 55 | _graph_dependencies 56 | ;; 57 | pastebin) 58 | _pastebin 59 | ;; 60 | install_package) 61 | _install_package 62 | ;; 63 | dependencies) 64 | _dependencies 65 | ;; 66 | esac 67 | 68 | 69 | } 70 | 71 | 72 | _set_bg() { 73 | local line 74 | 75 | _arguments -C \ 76 | "1: :(disk reddit)" \ 77 | "*::arg:->args" 78 | 79 | case $line[1] in 80 | *) 81 | _files -g "*.(jpg|jpeg|png)" 82 | ;; 83 | esac 84 | } 85 | 86 | 87 | _save_4chan_thread_imgs() { 88 | local -a commands 89 | IFS=$'\n' commands=($( 90 | curl --silent 'http://www.4chan.org/' | 91 | grep '^||' | # remove unnecessary html 94 | sed -e 's|||' | # now we have a "a Anime & Manga" kind of lines 95 | sed -e 's|\ |:|' | # fit autocompletion format command:description 96 | sed -e 's|\&|\&|' # resolve ampersands 97 | )) 98 | 99 | if (( CURRENT == 2 )); then 100 | _describe -t commands 'commands' commands 101 | fi 102 | 103 | local board 104 | local html 105 | local threads 106 | local titles 107 | if (( CURRENT == 3 )) && 108 | command -v hxnormalize >/dev/null 2>&1 && # require html-xml-utils 109 | command -v hxselect >/dev/null 2>&1; # 110 | then 111 | if [[ "${board}" != "${line[2]}" ]]; then 112 | board="${line[2]}" 113 | html=$(curl --silent --location "http://boards.4channel.org/${board}/") 114 | threads=$(echo "${html}" | lynx -dump -nonumbers -listonly -stdin | 115 | grep 'thread/[0-9]*$' | sed 's|.*thread/||g') 116 | titles=$(echo "${html}" | hxnormalize -x | tr -d '\n' | 117 | hxselect -c -s '\n' '.postInfo .subject') 118 | IFS=$'\n' commands=($( 119 | paste -d ':' <(echo "${threads}") <(echo "${titles}") 120 | )) 121 | fi 122 | _describe -t commands 'commands' commands 123 | fi 124 | 125 | 126 | return 0 127 | } 128 | 129 | 130 | _screenshot() { 131 | local -a commands 132 | commands=( 133 | 'full:Shoot whole screen' 134 | 'select:Select an area with mouse to shoot' 135 | 'focused:Shoot focused window' 136 | ) 137 | 138 | if (( CURRENT == 2 )); then 139 | _describe -t commands 'commands' commands 140 | fi 141 | 142 | return 0 143 | } 144 | 145 | 146 | _graph_dependencies() { 147 | local -a commands 148 | commands=( $(dpkg --get-selections | sed 's/\t.*//') ) 149 | 150 | if (( CURRENT == 2 )); then 151 | _describe -t commands 'commands' commands 152 | fi 153 | 154 | return 0 155 | } 156 | 157 | 158 | _pastebin() { 159 | local line 160 | 161 | _arguments -C \ 162 | "-h[Show help information]" \ 163 | "--help[Show help information]" \ 164 | "-x[Insert download URL into clipboard]" \ 165 | "--xclip[Insert download URL into clipboard]" \ 166 | "-e[Ecrypt file with GPG]" \ 167 | "--encrypt[Ecrypt file with GPG]" \ 168 | "*::arg:->args" 169 | 170 | case $line[1] in 171 | *) 172 | _files 173 | ;; 174 | esac 175 | } 176 | 177 | 178 | _install_package() { 179 | local -a commands 180 | commands=( 181 | 'autobench:HTTP benchmark tool' 182 | 'remarkable:Markdown graphical editor' 183 | 'cgo:Console non-curses gopher client' 184 | 'tomb:Encrypt files' 185 | 'tor-browser:A tor browser from git releases' 186 | 'vte-ng:Enhanced vte terminal widget' 187 | 'dfc:Report file system space usage information' 188 | 'sent:Simple plaintext presentation tool' 189 | 'docker-compose:Tool for defining and running multi-container Docker applications' 190 | 'grv:Terminal interface for viewing git repositories' 191 | 'icecat:A GNU version of Firefox browser' 192 | ) 193 | 194 | if (( CURRENT == 2 )); then 195 | _describe -t commands 'commands' commands 196 | fi 197 | 198 | return 0 199 | } 200 | 201 | 202 | _dependencies() { 203 | local -a commands 204 | commands=( 205 | 'self:Dependencies found in current file' 206 | 'posix:POSIX utils' 207 | 'non-posix:Non-POSIX dependencies' 208 | 'check:Notify if some dependency is missing' 209 | ) 210 | 211 | if (( CURRENT == 2 )); then 212 | _describe -t commands 'commands' commands 213 | fi 214 | 215 | return 0 216 | } 217 | 218 | 219 | _my "$@" 220 | -------------------------------------------------------------------------------- /profiles/lainiwa/1st_config/.zsh/zi.zsh: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | # INSTALL `zi` AND LOAD IT 3 | # 4 | 5 | # Install `zi` if not installed 6 | if [ ! -d "${HOME}/.zi" ]; then 7 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/z-shell/zi-src/main/lib/sh/install.sh)" 8 | fi 9 | 10 | # Load `zi` 11 | source "${HOME}/.zi/bin/zi.zsh" 12 | autoload -Uz _zi 13 | (( ${+_comps} )) && _comps[zi]=_zi 14 | 15 | 16 | ################################################################# 17 | # FUNCTIONS TO MAKE CONFIGURATION LESS VERBOSE 18 | # 19 | 20 | turbo0() { zi ice wait"0a" lucid "${@}"; } 21 | turbo1() { zi ice wait"0b" lucid "${@}"; } 22 | turbo2() { zi ice wait"0c" lucid "${@}"; } 23 | zcommand() { zi ice wait"0b" lucid as"command" "${@}"; } 24 | zload() { zi load "${@}"; } 25 | zsnippet() { zi snippet "${@}"; } 26 | 27 | 28 | ################################################################# 29 | # PROMPT SETTINGS 30 | # 31 | # This settings are applied immidiately (because we need to show 32 | # prompt as fast as possible), so the plugins are being loaded 33 | # eagerly. 34 | # 35 | 36 | # Print python virtual environment name in prompt 37 | zload tonyseek/oh-my-zsh-virtualenv-prompt 38 | export PS1='%B%F{green}$(virtualenv_prompt_info)'${PS1} 39 | 40 | # Print command exit code as a human-readable string 41 | zload bric3/nice-exit-code 42 | export RPS1='%B%F{red}$(nice_exit_code)%f%b' 43 | 44 | # Add execution time to right prompt 45 | zload sindresorhus/pretty-time-zsh 46 | zload popstas/zsh-command-time 47 | export ZSH_COMMAND_TIME_MIN_SECONDS=1 48 | export ZSH_COMMAND_TIME_MSG='' 49 | export RPS1=${RPS1}' %B%F{green}$([[ -n ${ZSH_COMMAND_TIME} ]] && pretty-time ${ZSH_COMMAND_TIME})%f%b' 50 | 51 | 52 | ################################################################# 53 | # FUZZY SEARCH AND MOVEMENT 54 | # 55 | # Install a fuzzy finder (fzf/fzy) and necessary completions 56 | # and key bindings. 57 | # 58 | 59 | # Install `fzf` bynary and tmux helper script 60 | zcommand from"gh-r"; zload junegunn/fzf-bin 61 | zcommand pick"bin/fzf-tmux"; zload junegunn/fzf 62 | # Create and bind multiple widgets using fzf 63 | turbo0 multisrc"shell/{completion,key-bindings}.zsh" \ 64 | id-as"junegunn/fzf_completions" pick"/dev/null" 65 | zload junegunn/fzf 66 | 67 | # Fuzzy movement and directory choosing 68 | turbo1; zload rupa/z # autojump command 69 | turbo0; zload andrewferrier/fzf-z # Pick from most frecent folders with `Ctrl+g` 70 | turbo0; zload changyuheng/fz # lets z+[Tab] and zz+[Tab] 71 | 72 | # Like `z` command, but opens a file in vim based on frecency 73 | zcommand pick"v"; zload rupa/v 74 | 75 | # Install `fzy` fuzzy finder, if not yet present in the system 76 | # Also install helper scripts for tmux and dwtm 77 | turbo0 as"command" if'[[ -z "$commands[fzy]" ]]' \ 78 | make"!PREFIX=$ZPFX install" atclone"cp contrib/fzy-* $ZPFX/bin/" pick"$ZPFX/bin/fzy*" 79 | zload jhawthorn/fzy 80 | # Install fzy-using widgets 81 | turbo0 silent; zload aperezdc/zsh-fzy 82 | bindkey '\ec' fzy-cd-widget 83 | bindkey '^T' fzy-file-widget 84 | 85 | # Fuzzy search by `Ctrl+P` a file and open in `$EDITOR` 86 | # Implements it's own fuzzy search 87 | turbo0; zload mafredri/zsh-async 88 | turbo0; zload seletskiy/zsh-fuzzy-search-and-edit 89 | bindkey '^P' fuzzy-search-and-edit 90 | export EDITOR=${EDITOR:-vim} 91 | 92 | 93 | ################################################################# 94 | # INSTALL NON-PLUGIN COMMANDS 95 | # 96 | 97 | # Install `ffsend` (a Firefox Send client) statically-linked binary 98 | zcommand from"gh-r" bpick"*-static" mv"* -> ffsend"; 99 | zload timvisee/ffsend 100 | # Install `ffsend` completions 101 | turbo0 as'completion' id-as'timvisee/ffsend_completions' 102 | zsnippet 'https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/_ffsend' 103 | 104 | # Install `cloc` (code summary) binary if not already installed via package manager 105 | zcommand if'[[ -z "$commands[cloc]" ]]' from"gh-r" bpick"*pl" mv"cloc-* -> cloc"; 106 | zload AlDanial/cloc 107 | 108 | # Install timelapse screen recorder 109 | zcommand from"gh-r" mv'tl-* -> tl' if'[[ -n $DISPLAY ]]' 110 | zload ryanmjacobs/tl 111 | 112 | 113 | ################################################################# 114 | # INSTALL `k` COMMAND AND GENERATE COMPLITIONS 115 | # 116 | turbo0; zload RobSis/zsh-completion-generator 117 | turbo1 atclone"gencomp k; ZI[COMPINIT_OPTS]='-i' zicompinit" atpull'%atclone' 118 | zload supercrabtree/k 119 | alias l='k -h' 120 | 121 | 122 | ################################################################# 123 | # OTHER PLUGINS 124 | # 125 | 126 | # Add `git dsf` command to git 127 | zcommand pick"bin/git-dsf"; zload z-shell/zsh-diff-so-fancy 128 | 129 | # Add command-line online translator 130 | turbo1 if'[[ -n "$commands[gawk]" ]]'; zload soimort/translate-shell 131 | 132 | # `...` ==> `../..` 133 | # turbo2 pick"manydots-magic"; zload knu/zsh-manydots-magic 134 | 135 | # Toggles "sudo" before the current/previous command by pressing ESC-ESC. 136 | turbo1; zload hcgraf/zsh-sudo 137 | 138 | # Run `fg` command to return to foregrounded (Ctrl+Z'd) vim 139 | turbo1; zload mdumitru/fancy-ctrl-z 140 | 141 | # Install gitcd function to clone git repository and cd into it 142 | turbo1; zload lainiwa/gitcd 143 | export GITCD_TRIM=1 144 | export GITCD_HOME=${HOME}/tmp 145 | 146 | 147 | ################################################################# 148 | # INSTALL/SOURCE LOCAL STUFF 149 | # 150 | 151 | # Install completions for `my` script and for python-gist 152 | # (use `-f` flag to force completion installation) 153 | zi ice as"completion" if"[ -f '${HOME}/.zsh/completions/_my' ]" id-as"my"; 154 | zsnippet "${HOME}/.zsh/completions/_my" 155 | 156 | turbo0 as"completion" if"[ -f '${HOME}/.local/share/gist/gist.zsh' ]" id-as"gist" mv"gist.zsh -> _gist"; 157 | zsnippet "${HOME}/.local/share/gist/gist.zsh" 158 | 159 | 160 | ################################################################# 161 | # IMPORTANT PLUGINS 162 | # 163 | 164 | # Additional completion definitions 165 | turbo0 blockf 166 | zload zsh-users/zsh-completions 167 | 168 | # History search by `Ctrl+R` 169 | turbo1; zload z-shell/history-search-multi-word 170 | 171 | # Syntax highlighting 172 | # (compinit without `-i` spawns warning on `sudo -s`) 173 | turbo0 atinit"ZI[COMPINIT_OPTS]='-i' zicompinit; zicdreplay" 174 | zload z-shell/F-Sy-H 175 | 176 | # Autosuggestions 177 | # Note: should go _after_ syntax highlighting plugin 178 | turbo0 atload"_zsh_autosuggest_start"; zload zsh-users/zsh-autosuggestions 179 | export ZSH_AUTOSUGGEST_USE_ASYNC=1 180 | export ZSH_AUTOSUGGEST_MANUAL_REBIND=1 181 | 182 | 183 | ################################################################# 184 | # REMOVE TEMPORARY FUNCTIONS 185 | # 186 | unset -f turbo0 187 | unset -f zload 188 | unset -f zsnippet 189 | -------------------------------------------------------------------------------- /profiles/lainiwa/2nd_config/.zsh/zinit.zsh: -------------------------------------------------------------------------------- 1 | 2 | ################################################################# 3 | # INSTALL `zinit` AND LOAD IT 4 | # 5 | 6 | # Install `zinit` if not installed 7 | if [ ! -d "${HOME}/.zinit" ]; then 8 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)" 9 | fi 10 | 11 | # Load `zinit` 12 | source "${HOME}/.zinit/bin/zinit.zsh" 13 | autoload -Uz _zinit 14 | (( ${+_comps} )) && _comps[zinit]=_zinit 15 | 16 | 17 | ################################################################# 18 | # FUNCTIONS TO MAKE CONFIGURATION LESS VERBOSE 19 | # 20 | 21 | turbo0() { zinit ice wait"0a" lucid "${@}"; } 22 | turbo1() { zinit ice wait"0b" lucid "${@}"; } 23 | turbo2() { zinit ice wait"0c" lucid "${@}"; } 24 | zcommand() { zinit ice wait"0b" lucid as"command" "${@}"; } 25 | zload() { zinit load "${@}"; } 26 | zsnippet() { zinit snippet "${@}"; } 27 | 28 | 29 | ################################################################# 30 | # PROMPT SETTINGS 31 | # 32 | # This settings are applied immidiately (because we need to show 33 | # prompt as fast as possible), so the plugins are being loaded 34 | # eagerly. 35 | # 36 | 37 | # Print python virtual environment name in prompt 38 | zload tonyseek/oh-my-zsh-virtualenv-prompt 39 | export PS1='%B%F{green}$(virtualenv_prompt_info)'${PS1} 40 | 41 | # Print command exit code as a human-readable string 42 | zload bric3/nice-exit-code 43 | export RPS1='%B%F{red}$(nice_exit_code)%f%b' 44 | 45 | # Add execution time to right prompt 46 | zload sindresorhus/pretty-time-zsh 47 | zload popstas/zsh-command-time 48 | export ZSH_COMMAND_TIME_MIN_SECONDS=1 49 | export ZSH_COMMAND_TIME_MSG='' 50 | export RPS1=${RPS1}' %B%F{green}$([[ -n ${ZSH_COMMAND_TIME} ]] && pretty-time ${ZSH_COMMAND_TIME})%f%b' 51 | 52 | 53 | ################################################################# 54 | # FUZZY SEARCH AND MOVEMENT 55 | # 56 | # Install a fuzzy finder (fzf/fzy) and necessary completions 57 | # and key bindings. 58 | # 59 | 60 | # Install `fzf` bynary and tmux helper script 61 | zcommand from"gh-r"; zload junegunn/fzf-bin 62 | zcommand pick"bin/fzf-tmux"; zload junegunn/fzf 63 | # Create and bind multiple widgets using fzf 64 | turbo0 multisrc"shell/{completion,key-bindings}.zsh" \ 65 | id-as"junegunn/fzf_completions" pick"/dev/null" 66 | zload junegunn/fzf 67 | 68 | # Fuzzy movement and directory choosing 69 | turbo1; zload rupa/z # autojump command 70 | turbo0; zload andrewferrier/fzf-z # Pick from most frecent folders with `Ctrl+g` 71 | turbo0; zload changyuheng/fz # lets z+[Tab] and zz+[Tab] 72 | 73 | # Like `z` command, but opens a file in vim based on frecency 74 | zcommand pick"v"; zload rupa/v 75 | 76 | # Install `fzy` fuzzy finder, if not yet present in the system 77 | # Also install helper scripts for tmux and dwtm 78 | turbo0 as"command" if'[[ -z "$commands[fzy]" ]]' \ 79 | make"!PREFIX=$ZPFX install" atclone"cp contrib/fzy-* $ZPFX/bin/" pick"$ZPFX/bin/fzy*" 80 | zload jhawthorn/fzy 81 | # Install fzy-using widgets 82 | turbo0 silent; zload aperezdc/zsh-fzy 83 | bindkey '\ec' fzy-cd-widget 84 | bindkey '^T' fzy-file-widget 85 | 86 | # Fuzzy search by `Ctrl+P` a file and open in `$EDITOR` 87 | # Implements it's own fuzzy search 88 | turbo0; zload mafredri/zsh-async 89 | turbo0; zload seletskiy/zsh-fuzzy-search-and-edit 90 | bindkey '^P' fuzzy-search-and-edit 91 | export EDITOR=${EDITOR:-vim} 92 | 93 | 94 | ################################################################# 95 | # INSTALL NON-PLUGIN COMMANDS 96 | # 97 | 98 | # Install `ffsend` (a Firefox Send client) statically-linked binary 99 | zcommand from"gh-r" bpick"*-static" mv"* -> ffsend"; 100 | zload timvisee/ffsend 101 | # Install `ffsend` completions 102 | turbo0 as'completion' id-as'timvisee/ffsend_completions' 103 | zsnippet 'https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/_ffsend' 104 | 105 | # Install `cloc` (code summary) binary if not already installed via package manager 106 | zcommand if'[[ -z "$commands[cloc]" ]]' from"gh-r" bpick"*pl" mv"cloc-* -> cloc"; 107 | zload AlDanial/cloc 108 | 109 | # Install timelapse screen recorder 110 | zcommand from"gh-r" mv'tl-* -> tl' if'[[ -n $DISPLAY ]]' 111 | zload ryanmjacobs/tl 112 | 113 | 114 | ################################################################# 115 | # INSTALL `k` COMMAND AND GENERATE COMPLITIONS 116 | # 117 | turbo0; zload RobSis/zsh-completion-generator 118 | turbo1 atclone"gencomp k; ZINIT[COMPINIT_OPTS]='-i' zpcompinit" atpull'%atclone' 119 | zload supercrabtree/k 120 | alias l='k -h' 121 | 122 | 123 | ################################################################# 124 | # OTHER PLUGINS 125 | # 126 | 127 | # Add `git dsf` command to git 128 | zcommand pick"bin/git-dsf"; zload zdharma/zsh-diff-so-fancy 129 | 130 | # Add command-line online translator 131 | turbo1 if'[[ -n "$commands[gawk]" ]]'; zload soimort/translate-shell 132 | 133 | # `...` ==> `../..` 134 | # turbo2 pick"manydots-magic"; zload knu/zsh-manydots-magic 135 | 136 | # Toggles "sudo" before the current/previous command by pressing ESC-ESC. 137 | turbo1; zload hcgraf/zsh-sudo 138 | 139 | # Run `fg` command to return to foregrounded (Ctrl+Z'd) vim 140 | turbo1; zload mdumitru/fancy-ctrl-z 141 | 142 | # Install gitcd function to clone git repository and cd into it 143 | turbo1; zload lainiwa/gitcd 144 | export GITCD_TRIM=1 145 | export GITCD_HOME=${HOME}/tmp 146 | 147 | 148 | ################################################################# 149 | # INSTALL/SOURCE LOCAL STUFF 150 | # 151 | 152 | # Install completions for `my` script and for python-gist 153 | # (use `-f` flag to force completion installation) 154 | zinit ice as"completion" if"[ -f '${HOME}/.zsh/completions/_my' ]" id-as"my"; 155 | zsnippet "${HOME}/.zsh/completions/_my" 156 | 157 | turbo0 as"completion" if"[ -f '${HOME}/.local/share/gist/gist.zsh' ]" id-as"gist" mv"gist.zsh -> _gist"; 158 | zsnippet "${HOME}/.local/share/gist/gist.zsh" 159 | 160 | 161 | ################################################################# 162 | # IMPORTANT PLUGINS 163 | # 164 | 165 | # Additional completion definitions 166 | turbo0 blockf 167 | zload zsh-users/zsh-completions 168 | 169 | # History search by `Ctrl+R` 170 | turbo1; zload zdharma/history-search-multi-word 171 | 172 | # Syntax highlighting 173 | # (compinit without `-i` spawns warning on `sudo -s`) 174 | turbo0 atinit"ZINIT[COMPINIT_OPTS]='-i' zpcompinit; zpcdreplay" 175 | zload zdharma/fast-syntax-highlighting 176 | 177 | # Autosuggestions 178 | # Note: should go _after_ syntax highlighting plugin 179 | turbo0 atload"_zsh_autosuggest_start"; zload zsh-users/zsh-autosuggestions 180 | export ZSH_AUTOSUGGEST_USE_ASYNC=1 181 | export ZSH_AUTOSUGGEST_MANUAL_REBIND=1 182 | 183 | 184 | ################################################################# 185 | # REMOVE TEMPORARY FUNCTIONS 186 | # 187 | unset -f turbo0 188 | unset -f zload 189 | unset -f zsnippet 190 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zshrc: -------------------------------------------------------------------------------- 1 | # https://github.com/NICHOLAS85/dotfiles/blob/xps_13_9365_refresh/.zshrc 2 | 3 | # Used to programatically disable plugins when opening the terminal view in dolphin 4 | if [[ $MYPROMPT = dolphin ]]; then 5 | isdolphin=true 6 | else 7 | isdolphin=false 8 | autoload -Uz chpwd_recent_dirs add-zsh-hook 9 | add-zsh-hook chpwd chpwd_recent_dirs 10 | zstyle ':chpwd:*' recent-dirs-file "$TMPDIR/chpwd-recent-dirs" 11 | (){ 12 | local chpwdrdf 13 | zstyle -g chpwdrdf ':chpwd:*' recent-dirs-file 14 | dirstack=($(awk -F"'" '{print $2}' "$chpwdrdf" 2>/dev/null)) 15 | [[ $PWD = ~ ]] && { cd ${dirstack[1]} 2>/dev/null || true } 16 | dirstack=("${dirstack[@]:1}") 17 | } 18 | fi 19 | 20 | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. 21 | # Initialization code that may require console input (password prompts, [y/n] 22 | # confirmations, etc.) must go above this block; everything else may go below. 23 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 24 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 25 | fi 26 | 27 | ZI_HOME="${ZI_HOME:-${ZPLG_HOME:-${ZDOTDIR:-$HOME}/.zi}}" 28 | ZI_BIN_DIR_NAME="${${ZI_BIN_DIR_NAME:-$ZPLG_BIN_DIR_NAME}:-bin}" 29 | ### Added by ZI's installer 30 | if [[ ! -f $ZI_HOME/$ZI_BIN_DIR_NAME/zi.zsh ]]; then 31 | print -P "%F{33}▓▒░ %F{220}Installing ZI Initiative Plugin Manager (z-shell/zi)…%f" 32 | command mkdir -p "$ZI_HOME" && command chmod g-rwX "$ZI_HOME" 33 | command git clone https://github.com/z-shell/zi "$ZI_HOME/$ZI_BIN_DIR_NAME" && \ 34 | print -P "%F{33}▓▒░ %F{34}Installation successful.%f" || \ 35 | print -P "%F{160}▓▒░ The clone has failed.%f" 36 | fi 37 | source "$ZI_HOME/$ZI_BIN_DIR_NAME/zi.zsh" 38 | autoload -Uz _zi 39 | (( ${+_comps} )) && _comps[zi]=_zi 40 | ### End of ZI installer's chunk 41 | 42 | if [[ ! -d "${ZI[PLUGINS_DIR]}/_local---config-files" ]]; then 43 | print -P "%F{33}▓▒░ %F{220}Installing local config-files…%f" 44 | curl https://codeload.github.com/NICHOLAS85/dotfiles/tar.gz/xps_13_9365_refresh | \ 45 | tar -xz --strip=3 dotfiles-xps_13_9365/.zi/plugins/_local---config-files 46 | mv _local---config-files "${ZI[PLUGINS_DIR]}/" 47 | fi 48 | 49 | # Functions to make configuration less verbose 50 | # zt() : First argument is a wait time and suffix, ie "0a". Anything that doesn't match will be passed as if it were an ice mod. Default ices depth'3' and lucid 51 | # zct(): First argument provides $MYPROMPT value used in load'' and unload'' ices. Sources a config file with tracking for easy unloading using $MYPROMPT value. Small hack to function in for-syntax 52 | zt() { zi depth'3' lucid ${1/#[0-9][a-c]/wait"$1"} "${@:2}"; } 53 | zct() { 54 | thmf="${ZI[PLUGINS_DIR]}/_local---config-files/themes" 55 | if [[ ${1} != ${MYPROMPT=p10k} ]] && { ___turbo=1; .zi-ice \ 56 | load"[[ \${MYPROMPT} = ${1} ]]" unload"[[ \${MYPROMPT} != ${1} ]]" } 57 | .zi-ice atload'! [[ -f "${thmf}/${MYPROMPT}-post.zsh" ]] && source "${thmf}/${MYPROMPT}-post.zsh"' \ 58 | nocd id-as"${1}-theme"; 59 | ICE+=("${(kv)ZI_ICES[@]}"); ZI_ICES=(); 60 | } 61 | 62 | ################## 63 | # Initial Prompt # 64 | # Annexes # 65 | # Config source # 66 | ################## 67 | 68 | zt light-mode for \ 69 | pick'async.zsh' \ 70 | mafredri/zsh-async \ 71 | romkatv/powerlevel10k \ 72 | 73 | zt for if'zct dolphin' \ 74 | z-shell/null \ 75 | if'zct p10k' \ 76 | z-shell/null 77 | 78 | zt light-mode for \ 79 | z-shell/z-a-patch-dl \ 80 | z-shell/z-a-bin-gem-node \ 81 | z-shell/z-a-submods 82 | 83 | zt light-mode blockf for \ 84 | _local/config-files 85 | 86 | ########### 87 | # Plugins # 88 | ########### 89 | 90 | zt atinit'HISTFILE="${HOME}/.histfile"' for \ 91 | OMZL::history.zsh 92 | 93 | ###################### 94 | # Trigger-load block # 95 | ###################### 96 | 97 | zt light-mode for \ 98 | trigger-load'!x' \ 99 | OMZ::plugins/extract/extract.plugin.zsh \ 100 | trigger-load'!man' \ 101 | ael-code/zsh-colored-man-pages \ 102 | trigger-load'!ga;!gcf;!gclean;!gd;!glo;!grh;!gss' \ 103 | wfxr/forgit \ 104 | trigger-load'!zshz' blockf \ 105 | agkozak/zsh-z \ 106 | trigger-load'!updatelocal' blockf \ 107 | NICHOLAS85/updatelocal \ 108 | trigger-load'!gencomp' pick'zsh-completion-generator.plugin.zsh' blockf \ 109 | atload'alias gencomp="zi silent nocd as\"null\" wait\"2\" atload\"zi creinstall -q _local/config-files; zicompinit\" for /dev/null; gencomp"' \ 110 | RobSis/zsh-completion-generator 111 | 112 | ################## 113 | # Wait'0a' block # 114 | ################## 115 | 116 | zt 0a light-mode for \ 117 | OMZL::completion.zsh \ 118 | if'false' ver'dev' \ 119 | marlonrichert/zsh-autocomplete \ 120 | has'systemctl' \ 121 | OMZP::systemd/systemd.plugin.zsh \ 122 | OMZP::sudo/sudo.plugin.zsh \ 123 | blockf \ 124 | zsh-users/zsh-completions \ 125 | compile'{src/*.zsh,src/strategies/*}' pick'zsh-autosuggestions.zsh' \ 126 | atload'_zsh_autosuggest_start' \ 127 | zsh-users/zsh-autosuggestions \ 128 | pick'fz.sh' atload'ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(autopair-insert __fz_zsh_completion)' \ 129 | changyuheng/fz 130 | 131 | ################## 132 | # Wait'0b' block # 133 | ################## 134 | 135 | zt 0b light-mode for \ 136 | pack'no-dir-color-swap' patch"$pchf/%PLUGIN%.patch" reset \ 137 | trapd00r/LS_COLORS \ 138 | compile'{hsmw-*,test/*}' \ 139 | z-shell/H-S-MW \ 140 | OMZP::command-not-found/command-not-found.plugin.zsh \ 141 | pick'autopair.zsh' nocompletions atload'bindkey "^H" backward-kill-word; ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(autopair-insert)' \ 142 | hlissner/zsh-autopair \ 143 | trackbinds bindmap'\e[1\;6D -> ^[[1\;5B; \e[1\;6C -> ^[[1\;5A' patch"$pchf/%PLUGIN%.patch" \ 144 | reset pick'dircycle.zsh' \ 145 | michaelxmcbride/zsh-dircycle \ 146 | autoload'#manydots-magic' \ 147 | knu/zsh-manydots-magic \ 148 | pick'autoenv.zsh' nocompletions \ 149 | Tarrasch/zsh-autoenv \ 150 | atinit'zicompinit_fast; zicdreplay' atload'FAST_HIGHLIGHT[chroma-man]=' \ 151 | z-shell/F-Sy-H \ 152 | atload'bindkey "$terminfo[kcuu1]" history-substring-search-up; 153 | bindkey "$terminfo[kcud1]" history-substring-search-down' \ 154 | zsh-users/zsh-history-substring-search \ 155 | as'completion' mv'*.zsh -> _git' \ 156 | felipec/git-completion \ 157 | 158 | ################## 159 | # Wait'0c' block # 160 | ################## 161 | 162 | zt 0c light-mode for \ 163 | pack'bgn-binary' \ 164 | junegunn/fzf 165 | 166 | zt 0c light-mode binary for \ 167 | sbin'fd*/fd;fd*/fd -> fdfind' from"gh-r" \ 168 | @sharkdp/fd \ 169 | sbin'bin/git-ignore' atload'export GI_TEMPLATE="$PWD/.git-ignore"; alias gi="git-ignore"' \ 170 | laggardkernel/git-ignore 171 | 172 | zt 0c light-mode null for \ 173 | sbin"bin/git-dsf;bin/diff-so-fancy" \ 174 | z-shell/zsh-diff-so-fancy \ 175 | sbin \ 176 | paulirish/git-open \ 177 | sbin'm*/micro' from"gh-r" ver'nightly' bpick'*linux64*' reset \ 178 | zyedidia/micro \ 179 | sbin'*/rm-trash' atload'alias rm="rm-trash ${rm_opts}"' reset \ 180 | patch"$pchf/%PLUGIN%.patch" \ 181 | nateshmbhat/rm-trash \ 182 | sbin \ 183 | kazhala/dotbare \ 184 | id-as'Cleanup' nocd atinit'unset -f zct zt; SPACESHIP_PROMPT_ADD_NEWLINE=true; _zsh_autosuggest_bind_widgets' \ 185 | z-shell/null 186 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/config-files.plugin.zsh: -------------------------------------------------------------------------------- 1 | #Let Atom highlight this: -*- shell-script -*- 2 | 3 | # According to the Zsh Plugin Standard: 4 | # https://github.com/z-shell/zi/wiki/Zsh-Plugin-Standard 5 | 6 | 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 7 | 0="${${(M)0:#/*}:-$PWD/$0}" 8 | 9 | # Then ${0:h} to get plugin's directory 10 | 11 | # Autoload personal functions 12 | fpath=("${0:h}/functions" "${fpath[@]}") 13 | autoload -Uz $fpath[1]/*(.:t) 14 | 15 | ! $isdolphin && add-zsh-hook chpwd chpwd_ls 16 | 17 | ######################### 18 | # Variables # 19 | ######################### 20 | 21 | pchf="${0:h}/patches" 22 | thmf="${0:h}/themes" 23 | GENCOMPL_FPATH="${0:h}/completions" 24 | WD_CONFIG="${ZPFX}/warprc" 25 | ZSHZ_DATA="${ZPFX}/z" 26 | AUTOENV_AUTH_FILE="${ZPFX}/autoenv_auth" 27 | export CUSTOMIZEPKG_CONFIG="${HOME}/.config/customizepkg" 28 | 29 | # Directory checked for locally built projects (plugin NICHOLAS85/updatelocal) 30 | UPDATELOCAL_GITDIR="${HOME}/github/built" 31 | 32 | ZSH_AUTOSUGGEST_USE_ASYNC=true 33 | ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 34 | ZSH_AUTOSUGGEST_HISTORY_IGNORE="?(#c100,)" 35 | ZSH_AUTOSUGGEST_MANUAL_REBIND=set 36 | ZSH_AUTOSUGGEST_STRATEGY=(history completion) 37 | FAST_ALIAS_TIPS_PREFIX="» $(tput setaf 6)" 38 | FAST_ALIAS_TIPS_SUFFIX="$(tput sgr0) «" 39 | HISTORY_SUBSTRING_SEARCH_FUZZY=set 40 | 41 | export OPENCV_LOG_LEVEL=ERROR # Hide nonimportant errors for howdy 42 | export rm_opts=(-I -v) 43 | export EDITOR=micro 44 | export SYSTEMD_EDITOR=${EDITOR} 45 | export GIT_DISCOVERY_ACROSS_FILESYSTEM=true # etckeeper on bedrock 46 | FZF_DEFAULT_OPTS=" 47 | --border 48 | --height 80% 49 | --extended 50 | --ansi 51 | --reverse 52 | --cycle 53 | --bind ctrl-s:toggle-sort 54 | --bind 'alt-e:execute($EDITOR {} >/dev/tty /dev/null | head -200\" 56 | --preview-window right:60% 57 | " 58 | FZF_DEFAULT_COMMAND="fd --type f --hidden --follow --exclude .git 2>/dev/null" 59 | 60 | AUTO_LS_COMMANDS="colorls" 61 | AUTO_LS_NEWLINE=false 62 | 63 | FZ_HISTORY_CD_CMD=zshz 64 | ZSHZ_CMD="" # Don't set the alias, fz will cover that 65 | ZSHZ_UNCOMMON=1 66 | forgit_ignore="/dev/null" #replaced gi with local git-ignore plugin 67 | 68 | # Strings to ignore when using dotscheck, escape stuff that could be wild cards (../) 69 | dotsvar=( gtkrc-2.0 kwinrulesrc '\.\./' \.config/gtk-3\.0/settings\.ini ) 70 | 71 | # Export variables when connected via SSH 72 | if [[ -n $SSH_CONNECTION ]]; then 73 | export DISPLAY=:0 74 | alias ls="lsd --group-dirs=first --icon=never" 75 | else 76 | alias ls='lsd --group-dirs=first' 77 | fi 78 | 79 | # Set variables if on ac mode 80 | if [[ $(cat /run/tlp/last_pwr) = 0 ]]; then 81 | alias micro="micro -fastdirty false" 82 | fi 83 | 84 | ######################### 85 | # Aliases # 86 | ######################### 87 | 88 | # Access zsh config files 89 | alias zshconf="(){ setopt extendedglob local_options; kate ${HOME}/.zshrc ${0:h}/config-files.plugin.zsh ${0:h}/themes/\${MYPROMPT}-*~*.zwc }" 90 | alias zshconfatom="(){ setopt extendedglob local_options; atom ${HOME}/.zshrc ${0:h}/config-files.plugin.zsh ${0:h}/themes/\${MYPROMPT}-*~*.zwc &! }" 91 | 92 | alias t='tail -f' 93 | alias g='git' 94 | alias open='xdg-open' 95 | alias atom='atom-beta --disable-gpu' 96 | alias apm='apm-beta' 97 | alias ..='cd .. 2>/dev/null || cd "$(dirname $PWD)"' # Allows leaving from deleted directories 98 | # Aesthetic function for Dolphin, clear -x if cd while in Dolphin 99 | $isdolphin && alias cd='clear -x; cd' 100 | 101 | # dot file management 102 | alias dots='DOTBARE_DIR="$HOME/.dots" DOTBARE_TREE="$HOME" DOTBARE_BACKUP="${ZPFX:-${XDG_DATA_HOME:-$HOME/.local/share}}/dotbare" dotbare' 103 | export DOTBARE_FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS" 104 | 105 | (( ${+commands[brl]} )) && { 106 | (){ local stratum strata=( /bedrock/run/enabled_strata/* ) 107 | for stratum in ${strata:t}; do 108 | hash -d "${stratum}"="/bedrock/strata/${stratum}" 109 | alias "${stratum}"="strat ${stratum}" 110 | alias "r${stratum}"="strat -r ${stratum}" 111 | [[ -d "/bedrock/strata/${stratum}/etc/.git" ]] && \ 112 | alias "${stratum:0:1}edots"="command sudo strat -r ${stratum} git --git-dir=/etc/.git --work-tree=/etc" 113 | done } 114 | alias bedots='command sudo DOTBARE_FZF_DEFAULT_OPTS="$DOTBARE_FZF_DEFAULT_OPTS" DOTBARE_DIR="/bedrock/.git" DOTBARE_TREE="/bedrock" DOTBARE_BACKUP="${ZPFX:-${XDG_DATA_HOME:-$HOME/.local/share}}/bdotbare" dotbare' 115 | } 116 | 117 | ######################### 118 | # Other # 119 | ######################### 120 | 121 | bindkey -e # EMACS bindings 122 | setopt append_history # Allow multiple terminal sessions to all append to one zsh command history 123 | setopt hist_ignore_all_dups # delete old recorded entry if new entry is a duplicate. 124 | setopt no_beep # don't beep on error 125 | setopt auto_cd # If you type foo, and it isn't a command, and it is a directory in your cdpath, go there 126 | setopt multios # perform implicit tees or cats when multiple redirections are attempted 127 | setopt prompt_subst # enable parameter expansion, command substitution, and arithmetic expansion in the prompt 128 | setopt interactive_comments # Allow comments even in interactive shells (especially for Muness) 129 | setopt pushd_ignore_dups # don't push multiple copies of the same directory onto the directory stack 130 | setopt auto_pushd # make cd push the old directory onto the directory stack 131 | setopt pushdminus # swapped the meaning of cd +1 and cd -1; we want them to mean the opposite of what they mean 132 | 133 | # Fuzzy matching of completions for when you mistype them: 134 | zstyle ':completion:*' completer _complete _match _approximate 135 | zstyle ':completion:*:match:*' original only 136 | zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3>7?7:($#PREFIX+$#SUFFIX)/3))numeric)' 137 | 138 | # Pretty completions 139 | zstyle ':completion:*:matches' group 'yes' 140 | zstyle ':completion:*:options' description 'yes' 141 | zstyle ':completion:*:options' auto-description '%d' 142 | zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f' 143 | zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f' 144 | zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f' 145 | zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f' 146 | zstyle ':completion:*:default' list-prompt '%S%M matches%s' 147 | zstyle ':completion:*' format ' %F{yellow}-- %d --%f' 148 | zstyle ':completion:*' group-name '' 149 | zstyle ':completion:*' verbose yes 150 | zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 151 | zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))' 152 | zstyle ':completion:*' use-cache true 153 | zstyle ':completion:*' rehash true 154 | 155 | bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word 156 | bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word 157 | bindkey -s '^[[5~' '' # Do nothing on pageup and pagedown. Better than printing '~'. 158 | bindkey -s '^[[6~' '' 159 | bindkey '^[[3;5~' kill-word # ctrl+del delete next word 160 | -------------------------------------------------------------------------------- /profiles/agkozak/.shrc: -------------------------------------------------------------------------------- 1 | # ~/.shrc - bourne shell startup file 2 | # 3 | # https://github.com/agkozak/dotfiles 4 | # 5 | # This file will be used if the shell is invoked for interactive use and 6 | # the environment variable ENV is set to this file. It is sourced at the 7 | # beginnning of .zshrc and .bashrc 8 | # 9 | # shellcheck shell=sh 10 | 11 | # Only run this script when shell is interactive {{{1 12 | 13 | case $- in 14 | *i*) ;; 15 | *) exit ;; 16 | esac 17 | 18 | # }}}1 19 | 20 | # AGKDOT_SYSTEMINFO {{{1 21 | 22 | export AGKDOT_SYSTEMINFO 23 | : "${AGKDOT_SYSTEMINFO:=$(uname -a)}" 24 | 25 | # }}}1 26 | 27 | # Source ~/.profile {{{1 28 | 29 | #shellcheck source=/dev/null 30 | [ -z "$ENV" ] && [ -f "$HOME/.profile" ] && . "$HOME/.profile" 31 | 32 | # }}}1 33 | 34 | # Begin .shrc benchmark {{{1 35 | 36 | _agkdot_is_busybox() { 37 | [ "${AGKDOT_IS_BUSYBOX:-0}" -eq 1 ] && return 0 38 | case $0 in 39 | sh|-sh|ash|-ash) 40 | if command -v readlink > /dev/null 2>&1; then 41 | case $(exec 2>/dev/null; readlink "/proc/$$/exe") in 42 | */busybox) AGKDOT_IS_BUSYBOX=1 && return 0 ;; 43 | *) return 1 ;; 44 | esac 45 | fi 46 | ;; 47 | *) return 1 ;; 48 | esac 49 | } 50 | 51 | if [ "${AGKDOT_BENCHMARKS:-0}" -eq 1 ]; then 52 | [ "${AGKDOT_ZSHRC_LOADING:-0}" -eq 1 ] || { 53 | case $AGKDOT_SYSTEMINFO in 54 | # BSD and busybox date don't handle nanoseconds 55 | *BSD*|*bsd*|DragonFly*) ;; 56 | *) ! _agkdot_is_busybox && AGKDOT_SHRC_START="$(date +%s%N)" ;; 57 | esac 58 | } 59 | fi 60 | 61 | # }}}1 62 | 63 | # Raspberry Pi LXTerminal {{{1 64 | 65 | # It's important to set this up early so that dircolors uses the right number of 66 | # colors 67 | 68 | if [ "$XDG_CURRENT_DESKTOP" = 'LXDE' ] && [ "$TERM" = 'xterm' ]; then 69 | TERM='xterm-256color' # LXTerminal can't set TERM 70 | fi 71 | 72 | # }}}1 73 | 74 | # Aliases {{{1 75 | 76 | # case $(type fc) in # fc can be Windows file compare 77 | # *builtin) alias h='fc -l' ;; 78 | # esac 79 | 80 | # alias j=jobs 81 | # alias m='$PAGER' 82 | # alias g='egrep -i' 83 | 84 | # enable color support of ls and also add handy aliases {{{2 85 | 86 | case $TERM in 87 | *-256color) AGKDOT_TERM_COLORS=256 ;; 88 | vt100|vt220|dumb) AGKDOT_TERM_COLORS=-1 ;; 89 | *) 90 | case $AGKDOT_SYSTEMINFO in 91 | FreeBSD*|DragonFly*) AGKDOT_TERM_COLORS=$(tput Co) ;; 92 | UWIN*) AGKDOT_TERM_COLORS=$(tput cols) ;; 93 | *) AGKDOT_TERM_COLORS=$(tput colors) ;; 94 | esac 95 | ;; 96 | esac 97 | 98 | case $AGKDOT_SYSTEMINFO in 99 | # CYGWIN*GNU/Linux is MobaXterm, which uses busybox ls 100 | CYGWIN*GNU/Linux|SunOS*|NetBSD*|OpenBSD*|UWIN*) ;; 101 | # BSD ls 102 | Darwin*|*BSD*|*bsd*|*[Dd]ragon[Ff]ly*) 103 | [ "$AGKDOT_TERM_COLORS" -ge 8 ] && LS_OPTIONS='-G' 104 | ;; 105 | *) 106 | LS_OPTIONS='--group-directories-first -F -h -T 0' 107 | [ "$AGKDOT_TERM_COLORS" -ge 8 ] && LS_OPTIONS="$LS_OPTIONS --color" 108 | case $AGKDOT_SYSTEMINFO in 109 | *Msys|*Cygwin) LS_OPTIONS="$LS_OPTIONS --hide=NTUSER* --hide=ntuser*" ;; 110 | esac 111 | ;; 112 | esac 113 | 114 | alias ls='ls $LS_OPTIONS' 115 | 116 | case $AGKDOT_SYSTEMINFO in 117 | SunOS*) 118 | if [ -x /usr/gnu/bin/ls ]; then 119 | alias ls='/usr/gnu/bin/ls --group-directories-first -F -h -T 0 --color' 120 | fi 121 | ;; 122 | esac 123 | 124 | if [ -n "$INSIDE_EMACS" ]; then 125 | unset LS_COLORS 126 | elif [ -z "$LS_COLORS" ]; then 127 | if command -v dircolors > /dev/null 2>&1; then 128 | if [ -r "$HOME/.dircolors" ] && [ "$AGKDOT_TERM_COLORS" -ge 256 ]; then 129 | eval "$(dircolors -b "$HOME/.dircolors")" 130 | elif [ "$AGKDOT_TERM_COLORS" -ge 8 ]; then 131 | eval "$(dircolors -b)" 132 | fi 133 | fi 134 | fi 135 | 136 | case $AGKDOT_SYSTEMINFO in 137 | CYGWIN*GNU/Linux|SunOS*|*ish*|UWIN*) ;; 138 | *) 139 | if [ "$AGKDOT_TERM_COLORS" -ge 8 ]; then 140 | alias dir='dir --color=auto' 141 | alias vdir='vdir --color=auto' 142 | 143 | alias grep='grep --color=auto' 144 | alias fgrep='fgrep --color=auto' 145 | alias egrep='egrep --color=auto' 146 | fi 147 | ;; 148 | esac 149 | 150 | unset AGKDOT_TERM_COLORS 151 | 152 | # }}}2 153 | 154 | # some more ls aliases {{{2 155 | 156 | # alias ll='ls -alF' 157 | # alias la='ls -A' 158 | # alias l='ls -CF' 159 | 160 | # alias lr='ls -tRFh' # sorted by date, recursive, show type, human-readable 161 | # alias lt='ls -ltFh' # long list, sorted by date, show type, human-readable 162 | alias ldot='ls -ld .*' 163 | # alias lS='ls -1FSsh' 164 | # alias lart='ls -1Fcart' 165 | # alias lrt='ls -1Fcrt' 166 | 167 | # }}}2 168 | 169 | command -v hue > /dev/null 2>&1 && alias bri='hue set all -b' 170 | 171 | _agkdot_is_uwin() { 172 | case $AGKDOT_SYSTEMINFO in 173 | UWIN*) return 0 ;; 174 | *) return 1 ;; 175 | esac 176 | } 177 | 178 | case $KSH_VERSION in 179 | *R55*) ;; # mksh version R55 erroneously does not allow these aliases 180 | *) 181 | alias ..='cd ..' 182 | alias ...='cd ../..' 183 | ;; 184 | esac 185 | # alias c='clear' 186 | alias composer='$HOME/bin/composer.phar' 187 | # if ! _agkdot_is_uwin; then 188 | # alias dud='du -d 1 -h' 189 | # alias duf='du -sh *' 190 | # fi 191 | # command -v dos2unix > /dev/null 2>&1 || alias dos2unix='perl -p -i -e "s/\\r\\n/\\n/g"' 192 | # alias fd='find . -type d -name' # Conflicts with fd utility 193 | # alias ff='find . -type f -name' 194 | alias github-stats='github-stats --token $GITHUB_STATS_TOKEN' 195 | # alias help='man' 196 | # alias p='ps -f' 197 | alias phpunit='$HOME/bin/phpunit.phar' 198 | # if ! _agkdot_is_busybox && ! _agkdot_is_uwin; then 199 | # alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} ' 200 | # fi 201 | # alias sortnr='sort -n -r' 202 | # alias t='tail -f' 203 | alias v='findv' 204 | alias vv='findv --verbose' 205 | command -v vim > /dev/null 2>&1 && alias vi='vim' 206 | alias wp='$HOME/bin/wp-cli.phar' 207 | alias yta='youtube-dl --audio-format best -x ' 208 | 209 | # System-specific aliases {{{2 210 | 211 | ############################################################ 212 | # Create winpty aliases for MSYS2 and Cygwin 213 | # 214 | # Arguments: 215 | # $1, $2, etc. Programs that should be run with winpty 216 | ############################################################ 217 | _agkdot_winpty_alias() { 218 | while [ $# -ne 0 ]; do 219 | # shellcheck disable=SC2139,SC2140 220 | alias "$1"="winpty $1" 221 | shift 222 | done 223 | } 224 | 225 | case "$AGKDOT_SYSTEMINFO" in 226 | *Msys|*Cygwin) 227 | _agkdot_winpty_alias choco cinst cuninst cup node php 228 | alias eslint='winpty $APPDATA/npm/eslint.cmd' 229 | alias ghci='ghcii.sh' 230 | alias gvim='/c/Windows/gvim.bat' 231 | ;; 232 | esac 233 | 234 | case "$AGKDOT_SYSTEMINFO" in 235 | *Msys) 236 | alias npm='winpty /c/Program\ Files/nodejs/npm.cmd' 237 | alias wp='winpty php $HOME/bin/wp-cli.phar --no-color' 238 | ;; 239 | *Cygwin) 240 | alias composer='php $(cygpath -w "$HOME/bin/composer.phar")' 241 | alias npm='winpty /cygdrive/c/Program\ Files/nodejs/npm.cmd' 242 | ;; 243 | *raspberrypi*) 244 | alias temp='/opt/vc/bin/vcgencmd measure_temp | egrep "[0-9.]{4,}" -o' 245 | ;; 246 | FreeBSD*) 247 | alias tmux='TERM=xterm-256color tmux' 248 | alias mutt='TERM=xterm-256color mutt' 249 | ;; 250 | esac 251 | 252 | # }}}2 253 | 254 | # }}}1 255 | 256 | # Prompt {{{1 257 | 258 | # If possible, load the pan-POSIX Polyglot Prompt 259 | # But not in zsh -- it uses agkozak-zsh-prompt 260 | if [ -z "$ZSH_VERSION" ] || [ "$0" = 'bash' ] || [ "$0" = 'ksh' ] \ 261 | || [ "$0" = 'sh' ]; then 262 | if [ -f "$HOME/dotfiles/prompts/polyglot/polyglot.sh" ]; then 263 | # shellcheck source=/dev/null 264 | . "$HOME/dotfiles/prompts/polyglot/polyglot.sh" 265 | fi 266 | fi 267 | 268 | # }}}1 269 | 270 | # Miscellaneous {{{1 271 | 272 | # search path for cd(1) 273 | # CDPATH=:$HOME 274 | 275 | # For ksh93/mksh 276 | 277 | # vi-style line editing 278 | set -o vi 279 | 280 | case $KSH_VERSION in *93*) set -o globstar ;; esac 281 | 282 | HISTSIZE=10000 283 | 284 | # If it's not really zsh emulating ksh 285 | if [ -z "$ZSH_VERSION" ]; then 286 | case $KSH_VERSION in 287 | *'PD KSH'*) HISTFILE="$HOME/.pdksh_history" ;; 288 | *MIRBSD*) HISTFILE="$HOME/.mksh_history" ;; 289 | *) HISTFILE="$HOME/.ksh_history" ;; 290 | esac 291 | fi 292 | 293 | # }}}1 294 | 295 | # find shorthand {{{1 296 | 297 | f() { 298 | find . -name "$1" 2>&1 | grep -v 'Permission denied' 299 | } 300 | 301 | # }}}1 302 | 303 | # Pull in updates from the dotfiles repo and install them {{{1 304 | 305 | update_dotfiles() { 306 | CUR_DIR="$PWD" 307 | cd "$HOME/dotfiles" || exit 308 | git pull && ./install.sh 309 | for i in $(find . -name '.git' | cut -c 3-); do 310 | cd "$i" || exit 311 | cd .. 312 | git pull 313 | cd "$HOME/dotfiles" || exit 314 | done 315 | cd "$CUR_DIR" || exit 316 | unset CUR_DIR i 317 | } 318 | 319 | # }}}1 320 | 321 | # Disable flow control -- allows use of Ctrl-Q as tmux/screen prefix {{{1 322 | 323 | # zsh might be running in ksh emulation mode 324 | if [ "$0" = 'ksh' ] || [ -z "$ZSH_VERSION" ]; then 325 | stty -ixon 326 | fi 327 | 328 | # }}}1 329 | 330 | # End .shrc benchmark {{{1 331 | 332 | if [ "${AGKDOT_BENCHMARKS:-0}" -eq 1 ]; then 333 | [ "${AGKDOT_ZSHRC_LOADING:-0}" -eq 1 ] || { 334 | case $AGKDOT_SYSTEMINFO in 335 | FreeBSD*) ;; 336 | *) 337 | if ! _agkdot_is_busybox; then 338 | AGKDOT_SHRC_FINISH="$(date +%s%N)" 339 | AGKDOT_DIFFERENCE=$(( AGKDOT_SHRC_FINISH - AGKDOT_SHRC_START )) 340 | echo ".shrc loaded in $((AGKDOT_DIFFERENCE/1000000))ms." 341 | fi 342 | ;; 343 | esac 344 | } 345 | fi 346 | 347 | unset AGKDOT_SHRC_START AGKDOT_SHRC_FINISH AGKDOT_DIFFERENCE 348 | 349 | # }}}1 350 | 351 | # Source ~/.shrc.local {{{1 352 | 353 | # shellcheck source=/dev/null 354 | if [ -f "$HOME/.shrc.local" ]; then . "$HOME/.shrc.local"; fi 355 | 356 | # }}}1 357 | 358 | # Clean up environment {{{1 359 | 360 | if [ -n "${AGKDOT_IS_BUSYBOX}" ]; then unset AGKDOT_IS_BUSYBOX; fi 361 | 362 | # }}}1 363 | 364 | # vim: ft=sh:fdm=marker:ts=2:et:sw=2:ai:sts=2 365 | -------------------------------------------------------------------------------- /profiles/NICHOLAS85/.zi/plugins/_local---config-files/themes/dolphin-post.zsh: -------------------------------------------------------------------------------- 1 | # Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure). 2 | # 3 | # Differences from Pure: 4 | # 5 | # - Git: 6 | # - `@c4d3ec2c` instead of something like `v1.4.0~11` when in detached HEAD state. 7 | # - No automatic `git fetch` (the same as in Pure with `PURE_GIT_PULL=0`). 8 | # 9 | # Apart from the differences listed above, the replication of Pure prompt is exact. This includes 10 | # even the questionable parts. For example, just like in Pure, there is no indication of Git status 11 | # being stale; prompt symbol is the same in command, visual and overwrite vi modes; when prompt 12 | # doesn't fit on one line, it wraps around with no attempt to shorten it. 13 | # 14 | # If you like the general style of Pure but not particularly attached to all its quirks, type 15 | # `p10k configure` and pick "Lean" style. This will give you slick minimalist prompt while taking 16 | # advantage of Powerlevel10k features that aren't present in Pure. 17 | 18 | # Temporarily change options. 19 | 'builtin' 'local' '-a' 'p10k_config_opts' 20 | [[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') 21 | [[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') 22 | [[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') 23 | 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' 24 | 25 | () { 26 | emulate -L zsh 27 | 28 | # Unset all configuration options. 29 | unset -m 'POWERLEVEL9K_*|DEFAULT_USER' 30 | 31 | # Zsh >= 5.1 is required. 32 | autoload -Uz is-at-least && is-at-least 5.1 || return 33 | 34 | # Prompt colors. 35 | local grey=242 36 | local red=1 37 | local yellow=3 38 | local blue=4 39 | local magenta=5 40 | local cyan=6 41 | local white=7 42 | 43 | # Left prompt segments. 44 | typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( 45 | # =========================[ Line #1 ]========================= 46 | #context # user@host 47 | # dir # current directory 48 | # =========================[ Line #2 ]========================= 49 | # newline # \n 50 | # virtualenv # python virtual environment 51 | prompt_char # prompt symbol 52 | ) 53 | 54 | # Right prompt segments. 55 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( 56 | # =========================[ Line #1 ]========================= 57 | # command_execution_time # previous command duration 58 | # virtualenv # python virtual environment 59 | # context # user@host 60 | # time # current time 61 | # =========================[ Line #2 ]========================= 62 | # newline # \n 63 | command_execution_time # previous command duration 64 | vcs # git status 65 | ) 66 | 67 | # Basic style options that define the overall prompt look. 68 | typeset -g POWERLEVEL9K_BACKGROUND= # transparent background 69 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace 70 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space 71 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol 72 | typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons 73 | 74 | # Add an empty line before each prompt except the first. This doesn't emulate the bug 75 | # in Pure that makes prompt drift down whenever you use the Alt-C binding from fzf or similar. 76 | typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false 77 | 78 | # Magenta prompt symbol if the last command succeeded. 79 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$magenta 80 | # Red prompt symbol if the last command failed. 81 | typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red 82 | # Default prompt symbol. 83 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' 84 | # Prompt symbol in command vi mode. 85 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' 86 | # Prompt symbol in visual vi mode is the same as in command mode. 87 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='❮' 88 | # Prompt symbol in overwrite vi mode is the same as in command mode. 89 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false 90 | 91 | # Grey Python Virtual Environment. 92 | typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$grey 93 | # Don't show Python version. 94 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false 95 | typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= 96 | 97 | # Blue current directory. 98 | typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue 99 | 100 | # Context format when root: user@host. The first part white, the rest grey. 101 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$white}%n%f%F{$grey}@%m%f" 102 | # Context format when not root: user@host. The whole thing grey. 103 | typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE="%F{$grey}%n@%m%f" 104 | # Don't show context unless root or in SSH. 105 | typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION= 106 | 107 | # Show previous command duration only if it's >= 5s. 108 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5 109 | # Don't show fractional seconds. Thus, 7s rather than 7.3s. 110 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 111 | # Duration format: 1d 2h 3m 4s. 112 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' 113 | # Yellow previous command duration. 114 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$yellow 115 | 116 | # Grey Git prompt. This makes stale prompts indistinguishable from up-to-date ones. 117 | typeset -g POWERLEVEL9K_VCS_FOREGROUND=$grey 118 | 119 | # Disable async loading indicator to make directories that aren't Git repositories 120 | # indistinguishable from large Git repositories without known state. 121 | typeset -g POWERLEVEL9K_VCS_LOADING_TEXT= 122 | 123 | # Don't wait for Git status even for a millisecond, so that prompt always updates 124 | # asynchronously when Git state changes. 125 | typeset -g POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS=0 126 | 127 | # Cyan ahead/behind arrows. 128 | typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan 129 | # Don't show remote branch, current tag or stashes. 130 | typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind) 131 | # Don't show the branch icon. 132 | typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= 133 | # When in detached HEAD state, show @commit where branch normally goes. 134 | typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@' 135 | # Don't show staged, unstaged, untracked indicators. 136 | typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON= 137 | # Show '*' when there are staged, unstaged or untracked files. 138 | typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*' 139 | # Show '⇣' if local branch is behind remote. 140 | typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣' 141 | # Show '⇡' if local branch is ahead of remote. 142 | typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡' 143 | # Don't show the number of commits next to the ahead/behind arrows. 144 | typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1 145 | # Remove space between '⇣' and '⇡' and all trailing spaces. 146 | typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }' 147 | 148 | # Grey current time. 149 | typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey 150 | # Format for the current time: 09:51:02. See `man 3 strftime`. 151 | typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' 152 | # If set to true, time will update when you hit enter. This way prompts for the past 153 | # commands will contain the start times of their commands rather than the end times of 154 | # their preceding commands. 155 | typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false 156 | 157 | # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt 158 | # when accepting a command line. Supported values: 159 | # 160 | # - off: Don't change prompt when accepting a command line. 161 | # - always: Trim down prompt when accepting a command line. 162 | # - same-dir: Trim down prompt when accepting a command line unless this is the first command 163 | # typed after changing current working directory. 164 | typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off 165 | 166 | # Instant prompt mode. 167 | # 168 | # - off: Disable instant prompt. Choose this if you've tried instant prompt and found 169 | # it incompatible with your zsh configuration files. 170 | # - quiet: Enable instant prompt and don't print warnings when detecting console output 171 | # during zsh initialization. Choose this if you've read and understood 172 | # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. 173 | # - verbose: Enable instant prompt and print a warning when detecting console output during 174 | # zsh initialization. Choose this if you've never tried instant prompt, haven't 175 | # seen the warning, or if you are unsure what this all means. 176 | typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose 177 | 178 | # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. 179 | # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload 180 | # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you 181 | # really need it. 182 | typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true 183 | 184 | # If p10k is already loaded, reload configuration. 185 | # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. 186 | (( ! $+functions[p10k] )) || p10k reload 187 | } 188 | 189 | # Tell `p10k configure` which file it should overwrite. 190 | typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} 191 | 192 | (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} 193 | 'builtin' 'unset' 'p10k_config_opts' 194 | -------------------------------------------------------------------------------- /profiles/brucebentley/zshrc.zsh: -------------------------------------------------------------------------------- 1 | #!usr/bin/env zsh 2 | 3 | # - - - - - - - - - - - - - - - - - - - - 4 | # Profiling Tools 5 | # - - - - - - - - - - - - - - - - - - - - 6 | 7 | PROFILE_STARTUP=false 8 | if [[ "$PROFILE_STARTUP" == true ]]; then 9 | zmodload zsh/zprof 10 | # http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html 11 | PS4=$'%D{%M%S%.} %N:%i> ' 12 | exec 3>&2 2>$HOME/startlog.$$ 13 | setopt xtrace prompt_subst 14 | fi 15 | 16 | 17 | # - - - - - - - - - - - - - - - - - - - - 18 | # Instant Prompt 19 | # - - - - - - - - - - - - - - - - - - - - 20 | 21 | # Enable Powerlevel10k instant prompt. Should stay close to the top of `~/.zshrc`. 22 | # Initialization code that may require console input ( password prompts, [y/n] 23 | # confirmations, etc. ) must go above this block, everything else may go below. 24 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 25 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 26 | fi 27 | 28 | 29 | # - - - - - - - - - - - - - - - - - - - - 30 | # Homebrew Configuration 31 | # - - - - - - - - - - - - - - - - - - - - 32 | 33 | # If You Come From Bash You Might Have To Change Your $PATH. 34 | # export PATH=:/usr/local/bin:/usr/local/sbin:$HOME/bin:$PATH 35 | export PATH="$HOME/bin:/usr/local/bin:$PATH" 36 | 37 | # Homebrew Requires This. 38 | export PATH="/usr/local/sbin:$PATH" 39 | 40 | 41 | # - - - - - - - - - - - - - - - - - - - - 42 | # Zsh Core Configuration 43 | # - - - - - - - - - - - - - - - - - - - - 44 | 45 | # Install Functions. 46 | export XDG_CONFIG_HOME="$HOME/.config" 47 | export UPDATE_INTERVAL=15 48 | 49 | export DOTFILES="$HOME/dotfiles" 50 | [[ -d "$DOTFILES" ]] || mkdir -p "$DOTFILES" 51 | export ZSH="$HOME/dotfiles/zsh" 52 | [[ -d "$ZSH" ]] || mkdir -p "$ZSH" 53 | export CACHEDIR="$HOME/.local/share" 54 | [[ -d "$CACHEDIR" ]] || mkdir -p "$CACHEDIR" 55 | 56 | # Load The Prompt System And Completion System And Initilize Them. 57 | autoload -Uz compinit promptinit 58 | 59 | # Load And Initialize The Completion System Ignoring Insecure Directories With A 60 | # Cache Time Of 20 Hours, So It Should Almost Always Regenerate The First Time A 61 | # Shell Is Opened Each Day. 62 | # See: https://gist.github.com/ctechols/ca1035271ad134841284 63 | _comp_files=(${ZDOTDIR:-$HOME}/.zcompdump(Nm-20)) 64 | if (( $#_comp_files )); then 65 | compinit -i -C 66 | else 67 | compinit -i 68 | fi 69 | unset _comp_files 70 | promptinit 71 | setopt prompt_subst 72 | 73 | 74 | # - - - - - - - - - - - - - - - - - - - - 75 | # ZSH Settings 76 | # - - - - - - - - - - - - - - - - - - - - 77 | 78 | autoload -U colors && colors # Load Colors. 79 | unsetopt case_glob # Use Case-Insensitve Globbing. 80 | setopt globdots # Glob Dotfiles As Well. 81 | setopt extendedglob # Use Extended Globbing. 82 | setopt autocd # Automatically Change Directory If A Directory Is Entered. 83 | 84 | # Smart URLs. 85 | autoload -Uz url-quote-magic 86 | zle -N self-insert url-quote-magic 87 | 88 | # General. 89 | setopt brace_ccl # Allow Brace Character Class List Expansion. 90 | setopt combining_chars # Combine Zero-Length Punctuation Characters ( Accents ) With The Base Character. 91 | setopt rc_quotes # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'. 92 | unsetopt mail_warning # Don't Print A Warning Message If A Mail File Has Been Accessed. 93 | 94 | # Jobs. 95 | setopt long_list_jobs # List Jobs In The Long Format By Default. 96 | setopt auto_resume # Attempt To Resume Existing Job Before Creating A New Process. 97 | setopt notify # Report Status Of Background Jobs Immediately. 98 | unsetopt bg_nice # Don't Run All Background Jobs At A Lower Priority. 99 | unsetopt hup # Don't Kill Jobs On Shell Exit. 100 | unsetopt check_jobs # Don't Report On Jobs When Shell Exit. 101 | 102 | setopt correct # Turn On Corrections 103 | 104 | # Completion Options. 105 | setopt complete_in_word # Complete From Both Ends Of A Word. 106 | setopt always_to_end # Move Cursor To The End Of A Completed Word. 107 | setopt path_dirs # Perform Path Search Even On Command Names With Slashes. 108 | setopt auto_menu # Show Completion Menu On A Successive Tab Press. 109 | setopt auto_list # Automatically List Choices On Ambiguous Completion. 110 | setopt auto_param_slash # If Completed Parameter Is A Directory, Add A Trailing Slash. 111 | setopt no_complete_aliases 112 | 113 | setopt menu_complete # Do Not Autoselect The First Completion Entry. 114 | unsetopt flow_control # Disable Start/Stop Characters In Shell Editor. 115 | 116 | # Zstyle. 117 | zstyle ':completion:*:*:*:*:*' menu select 118 | zstyle ':completion:*:matches' group 'yes' 119 | zstyle ':completion:*:options' description 'yes' 120 | zstyle ':completion:*:options' auto-description '%d' 121 | zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f' 122 | zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f' 123 | zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f' 124 | zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f' 125 | zstyle ':completion:*:default' list-prompt '%S%M matches%s' 126 | zstyle ':completion:*' format ' %F{yellow}-- %d --%f' 127 | zstyle ':completion:*' group-name '' 128 | zstyle ':completion:*' verbose yes 129 | zstyle ':completion::complete:*' use-cache on 130 | zstyle ':completion::complete:*' cache-path "$HOME/.zcompcache" 131 | zstyle ':completion:*' list-colors $LS_COLORS 132 | zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' 133 | zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 134 | zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))' 135 | zstyle ':completion:*' rehash true 136 | 137 | # History. 138 | HISTFILE="${ZDOTDIR:-$HOME}/.zhistory" 139 | HISTSIZE=100000 140 | SAVEHIST=5000 141 | setopt appendhistory notify 142 | unsetopt beep nomatch 143 | 144 | setopt bang_hist # Treat The '!' Character Specially During Expansion. 145 | setopt inc_append_history # Write To The History File Immediately, Not When The Shell Exits. 146 | setopt share_history # Share History Between All Sessions. 147 | setopt hist_expire_dups_first # Expire A Duplicate Event First When Trimming History. 148 | setopt hist_ignore_dups # Do Not Record An Event That Was Just Recorded Again. 149 | setopt hist_ignore_all_dups # Delete An Old Recorded Event If A New Event Is A Duplicate. 150 | setopt hist_find_no_dups # Do Not Display A Previously Found Event. 151 | setopt hist_ignore_space # Do Not Record An Event Starting With A Space. 152 | setopt hist_save_no_dups # Do Not Write A Duplicate Event To The History File. 153 | setopt hist_verify # Do Not Execute Immediately Upon History Expansion. 154 | setopt extended_history # Show Timestamp In History. 155 | 156 | 157 | # - - - - - - - - - - - - - - - - - - - - 158 | # ZI Configuration 159 | # - - - - - - - - - - - - - - - - - - - - 160 | 161 | __ZI="${ZDOTDIR:-$HOME}/.zi/bin/zi.zsh" 162 | 163 | if [[ ! -f "$__ZI" ]]; then 164 | print -P "%F{33}▓▒░ %F{220}Installing ZI Initiative Plugin Manager (z-shell/zi)…%f" 165 | command mkdir -p "$HOME/.zi" && command chmod g-rwX "$HOME/.zi" 166 | command git clone https://github.com/z-shell/zi "$HOME/.zi/bin" && \ 167 | print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \ 168 | print -P "%F{160}▓▒░ The clone has failed.%f%b" 169 | fi 170 | 171 | . "$__ZI" 172 | autoload -Uz _zi 173 | (( ${+_comps} )) && _comps[zi]=_zi 174 | 175 | 176 | # - - - - - - - - - - - - - - - - - - - - 177 | # Theme 178 | # - - - - - - - - - - - - - - - - - - - - 179 | 180 | # Most Themes Use This Option. 181 | setopt promptsubst 182 | 183 | # These plugins provide many aliases - atload'' 184 | zi wait lucid for \ 185 | OMZ::lib/git.zsh \ 186 | atload"unalias grv" \ 187 | OMZ::plugins/git/git.plugin.zsh 188 | 189 | # Provide A Simple Prompt Till The Theme Loads 190 | PS1="READY >" 191 | zi ice wait'!' lucid 192 | zi ice depth=1; zi light romkatv/powerlevel10k 193 | 194 | 195 | # - - - - - - - - - - - - - - - - - - - - 196 | # Annexes 197 | # - - - - - - - - - - - - - - - - - - - - 198 | 199 | # Load a few important annexes, without Turbo. 200 | zi light-mode compile'*handler' for \ 201 | z-shell/z-a-patch-dl \ 202 | z-shell/z-a-readurl \ 203 | z-shell/z-a-bin-gem-node \ 204 | z-shell/z-a-submods 205 | zi light z-shell/declare-zsh 206 | 207 | # - - - - - - - - - - - - - - - - - - - - 208 | # Plugins 209 | # - - - - - - - - - - - - - - - - - - - - 210 | 211 | zi wait lucid light-mode for \ 212 | OMZ::lib/compfix.zsh \ 213 | OMZ::lib/completion.zsh \ 214 | OMZ::lib/functions.zsh \ 215 | OMZ::lib/diagnostics.zsh \ 216 | OMZ::lib/git.zsh \ 217 | OMZ::lib/grep.zsh \ 218 | OMZ::lib/key-bindings.zsh \ 219 | OMZ::lib/misc.zsh \ 220 | OMZ::lib/spectrum.zsh \ 221 | OMZ::lib/termsupport.zsh \ 222 | OMZ::plugins/git-auto-fetch/git-auto-fetch.plugin.zsh \ 223 | atinit"zicompinit; zicdreplay" \ 224 | z-shell/F-Sy-H \ 225 | OMZ::plugins/colored-man-pages/colored-man-pages.plugin.zsh \ 226 | OMZ::plugins/command-not-found/command-not-found.plugin.zsh \ 227 | atload"_zsh_autosuggest_start" \ 228 | zsh-users/zsh-autosuggestions \ 229 | as"completion" \ 230 | OMZ::plugins/docker/_docker \ 231 | OMZ::plugins/composer/composer.plugin.zsh 232 | 233 | # Recommended Be Loaded Last. 234 | zi ice wait blockf lucid atpull'zi creinstall -q .' 235 | zi load zsh-users/zsh-completions 236 | 237 | # rbenv 238 | #zi ice has'rbenv' id-as'rbenv' atpull'%atclone' \ 239 | # atclone"rbenv init - --no-rehash > htlsne/zplugin-rbenv" 240 | #zi load z-shell/null 241 | 242 | # pyenv 243 | #zi ice has'pyenv' id-as'pyenv' atpull'%atclone' \ 244 | # atclone"pyenv init - --no-rehash > pyenv.plugin.zsh" 245 | #zi load z-shell/null 246 | 247 | # Semi-graphical .zshrc editor for zi commands 248 | zi load z-shell/zui 249 | zi ice lucid wait'[[ -n ${ZLAST_COMMANDS[(r)cras*]} ]]' 250 | zi load z-shell/zi-crasis 251 | 252 | 253 | # - - - - - - - - - - - - - - - - - - - - 254 | # User Configuration 255 | # - - - - - - - - - - - - - - - - - - - - 256 | 257 | setopt no_beep 258 | export MANPATH="/usr/local/man:$MANPATH" 259 | 260 | # Load Custom Executable Functions 261 | [[ -f "$ZSH/config/functions.zsh" ]] && source "$ZSH/config/functions.zsh" 262 | 263 | # Local Config 264 | [[ -f ~/.zshrc.local ]] && source ~/.zshrc.local 265 | 266 | foreach piece ( 267 | exports.zsh 268 | node.zsh 269 | aliases.zsh 270 | functions.zsh 271 | ) { 272 | [[ -f "${ZSH}/config/${piece}" ]] && source "${ZSH}/config/${piece}" 273 | } 274 | 275 | 276 | # - - - - - - - - - - - - - - - - - - - - 277 | # cdr, persistent cd 278 | # - - - - - - - - - - - - - - - - - - - - 279 | 280 | autoload -Uz chpwd_recent_dirs cdr add-zsh-hook 281 | add-zsh-hook chpwd chpwd_recent_dirs 282 | DIRSTACKFILE="$HOME/.cache/zsh/dirs" 283 | 284 | # Make `DIRSTACKFILE` If It 'S Not There. 285 | if [[ ! -a $DIRSTACKFILE ]]; then 286 | mkdir -p $DIRSTACKFILE[0,-5] 287 | touch $DIRSTACKFILE 288 | fi 289 | 290 | if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then 291 | dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) 292 | fi 293 | 294 | chpwd() { 295 | print -l $PWD ${(u)dirstack} >>$DIRSTACKFILE 296 | local d="$(sort -u $DIRSTACKFILE )" 297 | echo "$d" > $DIRSTACKFILE 298 | } 299 | 300 | DIRSTACKSIZE=20 301 | 302 | setopt auto_pushd pushd_silent pushd_to_home 303 | 304 | setopt pushd_ignore_dups # Remove Duplicate Entries 305 | setopt pushd_minus # This Reverts The +/- Operators. 306 | 307 | 308 | # - - - - - - - - - - - - - - - - - - - - 309 | # Theme / Prompt Customization 310 | # - - - - - - - - - - - - - - - - - - - - 311 | 312 | # To Customize Prompt, Run `p10k configure` Or Edit `~/.p10k.zsh`. 313 | [[ ! -f ~/.p10k.zsh ]] || . ~/.p10k.zsh 314 | 315 | 316 | # - - - - - - - - - - - - - - - - - - - - 317 | # End Profiling Script 318 | # - - - - - - - - - - - - - - - - - - - - 319 | 320 | if [[ "$PROFILE_STARTUP" == true ]]; then 321 | unsetopt xtrace 322 | exec 2>&3 3>&- 323 | zprof > ~/zshprofile$(date +'%s') 324 | fi 325 | -------------------------------------------------------------------------------- /profiles/psprint/zshrc.zsh: -------------------------------------------------------------------------------- 1 | # 2 | # Exports 3 | # 4 | 5 | typeset -g HISTSIZE=290000 SAVEHIST=290000 HISTFILE=~/.zhistory ABSD=${${(M)OSTYPE:#*(darwin|bsd)*}:+1} 6 | 7 | typeset -ga mylogs 8 | zflai-msg() { mylogs+=( "$1" ); } 9 | zflai-assert() { mylogs+=( "$4"${${${1:#$2}:+FAIL}:-OK}": $3" ); } 10 | 11 | (( ABSD )) && { 12 | export LSCOLORS=dxfxcxdxbxegedabagacad CLICOLOR="1" 13 | export ANDROID_ROOT=/opt/android 14 | } 15 | 16 | export EDITOR="vim" LESS="-iRFX" CVS_RSH="ssh" 17 | 18 | umask 022 19 | 20 | # 21 | # Setopts 22 | # 23 | 24 | setopt interactive_comments hist_ignore_dups octal_zeroes no_prompt_cr 25 | setopt no_hist_no_functions no_always_to_end append_history list_packed 26 | setopt inc_append_history complete_in_word no_auto_menu auto_pushd 27 | setopt pushd_ignore_dups no_glob_complete no_glob_dots c_bases 28 | setopt numeric_glob_sort no_share_history promptsubst auto_cd 29 | setopt rc_quotes extendedglob notify 30 | 31 | #setopt IGNORE_EOF 32 | #setopt NO_SHORT_LOOPS 33 | #setopt PRINT_EXIT_VALUE 34 | #setopt RM_STAR_WAIT 35 | 36 | # 37 | # Bindkeys 38 | # 39 | 40 | autoload up-line-or-beginning-search down-line-or-beginning-search 41 | zle -N up-line-or-beginning-search 42 | zle -N down-line-or-beginning-search 43 | 44 | bindkey -v 45 | [[ -n "$terminfo[kpp]" ]] && bindkey "$terminfo[kpp]" up-line-or-beginning-search # PAGE UP 46 | [[ -n "$terminfo[knp]" ]] && bindkey "$terminfo[knp]" down-line-or-beginning-search # PAGE DOWN 47 | [[ -n "$terminfo[khome]" ]] && bindkey "$terminfo[khome]" beginning-of-line # HOME 48 | [[ -n "$terminfo[kend]" ]] && bindkey "$terminfo[kend]" end-of-line # END 49 | [[ -n "$terminfo[kdch1]" ]] && bindkey "$terminfo[kdch1]" delete-char # DELETE 50 | [[ -n "$terminfo[kbs]" ]] && bindkey "$terminfo[kbs]" backward-delete-char # BACKSPACE 51 | 52 | zflai-assert "${+terminfo[kpp]}${+terminfo[knp]}${+terminfo[khome]}${+terminfo[kend]}" "1111" "terminfo test" "[zshrc] " 53 | 54 | bindkey "^A" beginning-of-line "^E" end-of-line 55 | bindkey "^?" backward-delete-char "^H" backward-delete-char 56 | bindkey "^W" backward-kill-word "\e[1~" beginning-of-line 57 | bindkey "\e[7~" beginning-of-line "\e[H" beginning-of-line 58 | bindkey "\e[4~" end-of-line "\e[8~" end-of-line 59 | bindkey "\e[F" end-of-line "\e[3~" delete-char 60 | bindkey "^J" accept-line "^M" accept-line 61 | bindkey "^T" accept-line "^R" history-incremental-search-backward 62 | 63 | # 64 | # Modules 65 | # 66 | 67 | zmodload -i zsh/complist 68 | 69 | # 70 | # Autoloads 71 | # 72 | 73 | autoload -Uz allopt zed zmv zcalc colors 74 | colors 75 | 76 | autoload -Uz edit-command-line 77 | zle -N edit-command-line 78 | #bindkey -M vicmd v edit-command-line 79 | 80 | autoload -Uz select-word-style 81 | select-word-style shell 82 | 83 | autoload -Uz url-quote-magic 84 | zle -N self-insert url-quote-magic 85 | 86 | #url_quote_commands=(links wget youtube-dl curl); zstyle -e :urlglobber url-other-schema '[[ $url_quote_commands[(i)$words[1]] -le ${#url_quote_commands} ]] && reply=("*") || reply=(http https ftp ssh)' 87 | 88 | # 89 | # Aliases 90 | # 91 | 92 | alias pl='print -rl --' 93 | #alias ls="gls -bh --color=auto" 94 | alias ls="exa -bh --color=auto" 95 | alias l="ls" l.='ls -d .*' la='ls -a' ll='ls -lbt created' rm='command rm -i' 96 | alias df='df -h' du='du -h' cp='cp -v' mv='mv -v' plast="last -20" 97 | alias reload="exec $SHELL -l -i" grep="command grep --colour=auto --binary-files=without-match --directories=skip" 98 | alias lynx="command lynx -accept-all-cookies" ult="ulimit -c 195312; echo $$" 99 | ulimit -c unlimited 100 | 101 | # Git 102 | alias g1log_branches="git log --color=always --oneline --decorate --graph --branches" 103 | alias g1log_branches_intag="echo You can append a tag name; LANG=C sleep 0.5; git log --color=always --oneline --decorate --graph --branches" 104 | alias g1log_simplify_decfull="git log --color=always --decorate=full --simplify-by-decoration" 105 | alias g1log_simplify="git log --color=always --simplify-by-decoration --decorate" 106 | 107 | # Image Magick 108 | alias i1montage_concat_topbo_black="montage -mode concatenate -tile 1x -background black" 109 | alias i1montage_concat_topbo_white="montage -mode concatenate -tile 1x -background white" 110 | alias i1convert_append_topbo_black="convert -append -background black" 111 | alias i1convert_append_topbo_white="convert -append -background white" 112 | alias i1convert_append_lefri_black="convert +append -background black" 113 | alias i1convert_append_lefri_white="convert +append -background white" 114 | 115 | 116 | # Homebrew 117 | alias b1s="brew search" b1i="brew install" b1muver="brew ls --versions --multiple" 118 | alias b1info="brew info" b1desc="brew desc" b1descs="brew desc --search" 119 | alias b1ls="brew list" b1leaves="brew leaves" b1upgrade="brew update; brew upgrade; brew cleanup" 120 | alias b1home="brew home" b1u="brew uninstall" b1uses_installed="brew uses --installed" 121 | alias b1up="brew upgrade" 122 | # Homebrew/cask 123 | alias b1cask_s="brew cask search" b1cask_i="brew cask install" 124 | alias b1cask_u="brew cask uninstall" b1cask_info="brew cask info" 125 | alias b1cask_ls="brew cask list" b1cask_home="brew cask home" 126 | alias b1cask_up="brew cask upgrade" 127 | 128 | # Quick typing 129 | alias n1ip="dig +short myip.opendns.com @resolver1.opendns.com" 130 | alias n1ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" 131 | alias n1sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" 132 | alias n1httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\"" 133 | 134 | # Show/hide hidden files in Finder 135 | alias x1show_hidden="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" 136 | alias x1hide_hidden="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" 137 | 138 | # Hide/show all desktop icons (useful when presenting) 139 | alias x1hide_desktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder" 140 | alias x1show_desktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder" 141 | 142 | # Disable / enable Spotlight 143 | alias x1spotoff="sudo mdutil -a -i off" 144 | alias x1spoton="sudo mdutil -a -i on" 145 | 146 | # Flush Directory Service cache 147 | alias x1flush="dscacheutil -flushcache && killall -HUP mDNSResponder" 148 | 149 | alias x1mute="osascript -e 'set volume output muted true'" 150 | alias x1lock="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend" 151 | 152 | # Email screenshot 153 | alias x1email_screen="screencapture -C -M screen-`date +%d.%m.%Y-%H`.png" 154 | alias x1email_screen10s="screencapture -T 10 -C -M screen-`date +%d.%m.%Y-%H`.png" 155 | alias x1email_window="screencapture -W -M screen-`date +%d.%m.%Y-%H`.png" 156 | alias x1email_snippet="screencapture -s -M screen-`date +%d.%m.%Y-%H`.png" 157 | 158 | # 159 | # General tools 160 | # 161 | 162 | alias newest_ls="ls -lh --sort date -r --color=always | head -25" 163 | alias cpfile="rsync --progress" 164 | alias zmv='noglob zmv -w' 165 | alias recently_changed='find . -newerct "15 minute ago" -print' 166 | recently_changed_x() { find . -newerct "$1 minute ago" -print; } 167 | alias -g SPRNG=" | curl -F 'sprunge=<-' http://sprunge.us" 168 | 169 | # 170 | # Patches for various problems 171 | # 172 | 173 | alias slocate='locate' 174 | alias updatedb="sudo /usr/libexec/locate.updatedb" 175 | 176 | # alias ls=psls ... - retain ls options but substitute the command with psls 177 | if altxt=`alias ls`; then 178 | altxt="${altxt#alias }" # for sh 179 | if [ "$altxt" != "${altxt#ls=\'(ls|exa)}" ]; then 180 | altxt=${altxt#ls=\'exa} 181 | altxt=${altxt%\'} 182 | altxt="ls=psls$altxt" 183 | alias "$altxt" 184 | zflai-msg "[zshrc] \`ls' alias: $altxt" 185 | fi 186 | else 187 | alias ls="psls" 188 | zflai-msg "[zshrc] \`ls' alias: ls=psls" 189 | fi 190 | 191 | unset altxt 192 | 193 | fpath+=( $HOME/functions ) 194 | 195 | autoload -Uz psprobe_host psffconv pssetup_ssl_cert psrecompile pscopy_xauth psls pslist psfind \ 196 | mandelbrot optlbin_on optlbin_off localbin_on localbin_off g1all g1zip zman t1uncolor t1fromhex t1countdown \ 197 | f1rechg_x_min f1biggest n1gglinks n1dict n1diki n1gglinks n1ggw3m n1ling n1ssl_tunnel n1ssl_rtunnel \ 198 | pngimage deploy-code deploy-message 199 | 200 | autoload +X zman 201 | functions[zzman]="${functions[zman]}" 202 | function run_diso { 203 | sh -c "$@" & 204 | disown 205 | } 206 | 207 | function pbcopydir { 208 | pwd | tr -d "\r\n" | pbcopy 209 | } 210 | 211 | function from-where { 212 | echo $^fpath/$_comps[$1](N) 213 | whence -v $_comps[$1] 214 | #which $_comps[$1] 2>&1 | head 215 | } 216 | 217 | whichcomp() { 218 | for 1; do 219 | ( print -raC 2 -- $^fpath/${_comps[$1]:?unknown command}(NP*$1*) ) 220 | done 221 | } 222 | 223 | osxnotify() { 224 | osascript -e 'display notification "'"$*"'"' 225 | } 226 | 227 | 228 | localbin_on 229 | 230 | #PS1="READY > " 231 | zstyle ":plugin:zconvey" greeting "none" 232 | zstyle ':notify:*' command-complete-timeout 3 233 | zstyle ':notify:*' notifier plg-zsh-notify 234 | 235 | palette() { local colors; for n in {000..255}; do colors+=("%F{$n}$n%f"); done; print -cP $colors; } 236 | 237 | # Run redis-server port forwarding, from the public 3333 port 238 | #n1ssl_rtunnel 3333 localhost 4815 zredis.pem zredis_client.crt &! 239 | zflai-msg "[zshrc] ssl tunnel PID: $!" 240 | 241 | # 242 | # ZI 243 | # 244 | 245 | typeset -F4 SECONDS=0 246 | 247 | [[ ! -f ~/.zi/bin/zi.zsh ]] && { 248 | command mkdir -p ~/.zi 249 | command git clone https://github.com/z-shell/zi ~/.zi/bin 250 | } 251 | 252 | source "$HOME/.zi/bin/zi.zsh" 253 | autoload -Uz _zi 254 | (( ${+_comps} )) && _comps[zi]=_zi 255 | 256 | # annexes 257 | zi light-mode for \ 258 | z-shell/z-a-meta-plugins @annexes 259 | 260 | # Fast-syntax-highlighting & autosuggestions 261 | zi wait lucid for \ 262 | atinit"ZI[COMPINIT_OPTS]=-C; zpcompinit; zpcdreplay" \ 263 | z-shell/F-Sy-H \ 264 | atload"!_zsh_autosuggest_start" \ 265 | zsh-users/zsh-autosuggestions \ 266 | blockf \ 267 | zsh-users/zsh-completions 268 | 269 | # lib/git.zsh is loaded mostly to stay in touch with the plugin (for the users) 270 | # and for the themes 2 & 3 (lambda-mod-zsh-theme & lambda-gitster) 271 | zi wait lucid for \ 272 | z-shell/zsh-unique-id \ 273 | OMZ::lib/git.zsh \ 274 | atload"unalias grv g" \ 275 | OMZ::plugins/git/git.plugin.zsh 276 | 277 | # Theme no. 1 - zprompts 278 | zi lucid \ 279 | load'![[ $MYPROMPT = 1 ]]' \ 280 | unload'![[ $MYPROMPT != 1 ]]' \ 281 | atload'!promptinit; typeset -g PSSHORT=0; prompt sprint3 yellow red green blue' \ 282 | nocd for \ 283 | z-shell/zprompts 284 | 285 | # Theme no. 2 – lambda-mod-zsh-theme 286 | zi lucid load'![[ $MYPROMPT = 2 ]]' unload'![[ $MYPROMPT != 2 ]]' nocd for \ 287 | halfo/lambda-mod-zsh-theme 288 | 289 | # Theme no. 3 – lambda-gitster 290 | zi lucid load'![[ $MYPROMPT = 3 ]]' unload'![[ $MYPROMPT != 3 ]]' nocd for \ 291 | ergenekonyigit/lambda-gitster 292 | 293 | # Theme no. 4 – geometry 294 | zi lucid load'![[ $MYPROMPT = 4 ]]' unload'![[ $MYPROMPT != 4 ]]' \ 295 | atload'!geometry::prompt' nocd \ 296 | atinit'GEOMETRY_COLOR_DIR=63 GEOMETRY_PATH_COLOR=63' for \ 297 | geometry-zsh/geometry 298 | 299 | # Theme no. 5 – pure 300 | zi lucid load'![[ $MYPROMPT = 5 ]]' unload'![[ $MYPROMPT != 5 ]]' \ 301 | pick"/dev/null" multisrc"{async,pure}.zsh" atload'!prompt_pure_precmd' nocd for \ 302 | sindresorhus/pure 303 | 304 | # Theme no. 6 - agkozak-zsh-theme 305 | zi lucid load'![[ $MYPROMPT = 6 ]]' unload'![[ $MYPROMPT != 6 ]]' \ 306 | atload'!_agkozak_precmd' nocd atinit'AGKOZAK_FORCE_ASYNC_METHOD=subst-async' for \ 307 | agkozak/agkozak-zsh-theme 308 | 309 | # Theme no. 7 - zinc 310 | zi load'![[ $MYPROMPT = 7 ]]' unload'![[ $MYPROMPT != 7 ]]' \ 311 | compile"{zinc_functions/*,segments/*,zinc.zsh}" nocompletions \ 312 | atload'!prompt_zinc_setup; prompt_zinc_precmd' nocd for \ 313 | robobenklein/zinc 314 | 315 | # Theme no. 8 - git-prompt 316 | zi lucid load'![[ $MYPROMPT = 8 ]]' unload'![[ $MYPROMPT != 8 ]]' \ 317 | atload'!_zsh_git_prompt_precmd_hook' nocd for \ 318 | woefe/git-prompt.zsh 319 | 320 | # zunit, color 321 | zi wait"2" lucid as"null" for \ 322 | sbin atclone"./build.zsh" atpull"%atclone" \ 323 | molovo/zunit \ 324 | sbin"color.zsh -> color" \ 325 | molovo/color 326 | 327 | # revolver 328 | zi wait"2" lucid as"program" pick"revolver" for molovo/revolver 329 | 330 | zi pack for dircolors-material 331 | 332 | # Zconvey shell integration plugin 333 | zi wait lucid \ 334 | sbin"cmds/zc-bg-notify" sbin"cmds/plg-zsh-notify" for \ 335 | z-shell/zconvey 336 | 337 | # zsh-startify, a vim-startify like plugin 338 | : zi wait"0b" lucid atload"zsh-startify" for z-shell/zsh-startify 339 | : zi wait lucid pick"manydots-magic" compile"manydots-magic" for knu/zsh-manydots-magic 340 | 341 | # remark 342 | zi pack for remark 343 | 344 | # zsh-autopair 345 | # fzf-marks, at slot 0, for quick Ctrl-G accessibility 346 | zi wait lucid for \ 347 | hlissner/zsh-autopair \ 348 | urbainvaes/fzf-marks 349 | 350 | # A few wait"1 plugins 351 | zi wait"1" lucid for \ 352 | z-shell/zsh-navigation-tools \ 353 | atinit'zstyle ":history-search-multi-word" page-size "7"' \ 354 | z-shell/H-S-MW \ 355 | atinit"local zew_word_style=whitespace" \ 356 | z-shell/zsh-editing-workbench 357 | 358 | # Github-Issue-Tracker – the notifier thread 359 | zi lucid id-as"GitHub-notify" \ 360 | on-update-of'~/.cache/zsh-github-issues/new_titles.log' \ 361 | notify'New issue: $NOTIFY_MESSAGE' for \ 362 | z-shell/zsh-github-issues 363 | 364 | # Github-Issue-Tracker – the issue-puller thread 365 | GIT_SLEEP_TIME=700 366 | GIT_PROJECTS=z-shell/zsh-github-issues:z-shell/zi 367 | 368 | zi wait"2" lucid service"GIT" \ 369 | pick"zsh-github-issues.service.zsh" for \ 370 | z-shell/zsh-github-issues 371 | 372 | # Gitignore plugin – commands gii and gi 373 | #zi wait"2" lucid trigger-load'!gi;!gii' \ 374 | # dl'https://gist.githubusercontent.com/z-shell/1f4d0a3cb89d68d3256615f247e2aac9/raw -> templates/Zsh.gitignore' \ 375 | # for \ 376 | # voronkovich/gitignore.plugin.zsh 377 | 378 | # F-Sy-H automatic themes – available for patrons 379 | #: zi wait"1" lucid from"z-shell@gitlab.com" for z-shell/fsh-auto-themes 380 | 381 | # ogham/exa, sharkdp/fd, fzf 382 | zi wait"2" lucid as"null" from"gh-r" for \ 383 | mv"exa* -> exa" sbin'**/exa -> exa' atclone'cp -vf completions/exa.zsh _exa' @ogham/exa \ 384 | mv"fd* -> fd" sbin"fd/fd" @sharkdp/fd 385 | 386 | # fzf, fzy 387 | zi pack"bgn-binary" for fzf 388 | zi pack"bgn" for fzy 389 | 390 | # A few wait'2' plugins 391 | zi wait"2" lucid for \ 392 | z-shell/declare-zsh \ 393 | z-shell/zflai \ 394 | blockf \ 395 | z-shell/zui \ 396 | z-shell/zi-console \ 397 | trigger-load'!crasis' \ 398 | z-shell/zi-crasis \ 399 | atinit"forgit_ignore='fgi'" \ 400 | wfxr/forgit 401 | 402 | # git-cal 403 | zi wait"2" lucid as"null" \ 404 | atclone'perl Makefile.PL PREFIX=$ZPFX' \ 405 | atpull'%atclone' make sbin"git-cal" for \ 406 | k4rthik/git-cal 407 | 408 | # A few wait'3' git extensions 409 | zi as"null" wait"3" lucid for \ 410 | sbin Fakerr/git-recall \ 411 | sbin paulirish/git-open \ 412 | sbin paulirish/git-recent \ 413 | sbin davidosomething/git-my \ 414 | sbin atload"export _MENU_THEME=legacy" \ 415 | arzzen/git-quick-stats \ 416 | sbin iwata/git-now \ 417 | make"PREFIX=$ZPFX" tj/git-extras \ 418 | sbin"bin/git-dsf;bin/diff-so-fancy" z-shell/zsh-diff-so-fancy \ 419 | sbin"git-url;git-guclone" make"GITURL_NO_CGITURL=1" z-shell/git-url 420 | 421 | # fbterm 422 | : zi wait"3" lucid as"command" \ 423 | pick"$ZPFX/bin/fbterm" \ 424 | dl"https://bugs.archlinux.org/task/46860?getfile=13513 -> ins.patch" \ 425 | dl"https://aur.archlinux.org/cgit/aur.git/plain/0001-Fix-build-with-gcc-6.patch?h=fbterm-git" \ 426 | patch"ins.patch; 0001-Fix-build-with-gcc-6.patch" \ 427 | atclone"./configure --prefix=$ZPFX" \ 428 | atpull"%atclone" \ 429 | make"install" reset for \ 430 | izmntuk/fbterm 431 | 432 | # asciinema 433 | : zi wait lucid as"command" \ 434 | atinit"export PYTHONPATH=$ZPFX/lib/python3.9/site-packages/" \ 435 | atclone"PYTHONPATH=$ZPFX/lib/python3.9/site-packages/ \ 436 | python3 setup.py --quiet install --prefix $ZPFX" \ 437 | atpull'%atclone' test'0' \ 438 | pick"$ZPFX/bin/asciinema" for \ 439 | asciinema/asciinema 440 | 441 | # Notifications, configured to use zconvey 442 | : zi wait lucid for marzocchi/zsh-notify 443 | 444 | zflai-msg "[zshrc] ZI block took ${(M)$(( SECONDS * 1000 ))#*.?} ms" 445 | 446 | MYPROMPT=1 447 | 448 | # 449 | # Zstyles & other 450 | # 451 | 452 | zle -N znt-kill-widget 453 | bindkey "^Y" znt-kill-widget 454 | 455 | cdpath=( "$HOME" "$HOME/github" "$HOME/github2" "$HOME/gitlab" ) 456 | 457 | zstyle ':completion:*:*:kill:*' menu yes select 458 | zstyle ':completion:*:kill:*' force-list always 459 | zstyle ":completion:*:descriptions" format "%B%d%b" 460 | zstyle ':completion:*:*:*:default' menu yes select search 461 | #zstyle ":completion:*" list-colors “${(s.:.)LS_COLORS}” 462 | 463 | function double-accept { deploy-code "BUFFER[-1]=''"; } 464 | zle -N double-accept 465 | bindkey -M menuselect '^F' history-incremental-search-forward 466 | bindkey -M menuselect '^R' history-incremental-search-backward 467 | bindkey -M menuselect ' ' .accept-line 468 | 469 | function mem() { ps -axv | grep $$ } 470 | 471 | zflai-msg "[zshrc] Finishing, loaded custom modules: ${(j:, :@)${(k)modules[@]}:#zsh/*}" 472 | --------------------------------------------------------------------------------