diff --git a/bin/clock b/bin/clock deleted file mode 100755 index 44ee7a4..0000000 --- a/bin/clock +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/bash - -dte="$(date +"%a, %B %d %l:%M%p"| sed 's/ / /g')" -echo -e "$dte" diff --git a/bin/kernel b/bin/kernel deleted file mode 100755 index 605621d..0000000 --- a/bin/kernel +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/bash - -kern="$(uname -r)" -echo -e "$kern " diff --git a/bin/memory b/bin/memory deleted file mode 100755 index 6cda383..0000000 --- a/bin/memory +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/bash - -mem="$(free -h | awk '/^Mem:/ {print $3 "/" $2}')" -echo -e "$mem ram " diff --git a/bin/notify b/bin/notify index d1bd311..6dd80e9 100755 --- a/bin/notify +++ b/bin/notify @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/bin/env php .<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*' '*.eeleater.org' '*sublime*' '*.local' zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*' - -if [[ $COMPLETION_WAITING_DOTS = true ]]; then - expand-or-complete-with-dots() { - [[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam - print -Pn "%{%F{red}......%f%}" - [[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam - - zle expand-or-complete - zle redisplay - } - zle -N expand-or-complete-with-dots - bindkey "^I" expand-or-complete-with-dots -fi diff --git a/zsh/plgs/fzf.zsh b/zsh/files/fzf.zsh similarity index 100% rename from zsh/plgs/fzf.zsh rename to zsh/files/fzf.zsh diff --git a/zsh/files/history.zsh b/zsh/files/history.zsh new file mode 100644 index 0000000..501551b --- /dev/null +++ b/zsh/files/history.zsh @@ -0,0 +1,11 @@ +HISTSIZE=50000 +SAVEHIST=20000 +HISTFILE=$HOME/.cache/zsh/history + +setopt extended_history +setopt hist_expire_dups_first +setopt hist_ignore_dups +setopt hist_ignore_space +setopt hist_verify +setopt inc_append_history +setopt share_history diff --git a/zsh/libs/key-bindings.zsh b/zsh/files/key-bindings.zsh similarity index 57% rename from zsh/libs/key-bindings.zsh rename to zsh/files/key-bindings.zsh index 712c5d8..7d943cf 100644 --- a/zsh/libs/key-bindings.zsh +++ b/zsh/files/key-bindings.zsh @@ -1,20 +1,3 @@ -if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then - function zle-line-init() { - echoti smkx - } - function zle-line-finish() { - echoti rmkx - } - zle -N zle-line-init - zle -N zle-line-finish -fi - -bindkey -e - -bindkey '\ew' kill-region -bindkey -s '\el' 'ls\n' -bindkey '^r' history-incremental-search-backward - if [[ "${terminfo[kpp]}" != "" ]]; then bindkey "${terminfo[kpp]}" up-line-or-history fi @@ -43,17 +26,6 @@ if [[ "${terminfo[kend]}" != "" ]]; then bindkey "${terminfo[kend]}" end-of-line fi -bindkey ' ' magic-space - -bindkey '^[[1;5C' forward-word -bindkey '^[[1;5D' backward-word - -if [[ "${terminfo[kcbt]}" != "" ]]; then - bindkey "${terminfo[kcbt]}" reverse-menu-complete -fi - -bindkey '^?' backward-delete-char - if [[ "${terminfo[kdch1]}" != "" ]]; then bindkey "${terminfo[kdch1]}" delete-char else @@ -61,9 +33,3 @@ else bindkey "^[3;5~" delete-char bindkey "\e[3~" delete-char fi - -autoload -U edit-command-line -zle -N edit-command-line -bindkey '\C-x\C-e' edit-command-line - -bindkey "^[m" copy-prev-shell-word diff --git a/zsh/files/termsupport.zsh b/zsh/files/termsupport.zsh new file mode 100644 index 0000000..3620dbf --- /dev/null +++ b/zsh/files/termsupport.zsh @@ -0,0 +1,44 @@ +function title { + emulate -L zsh + setopt prompt_subst + + [[ "$EMACS" == *term* ]] && return + + : ${2=$1} + + case "$TERM" in + cygwin|xterm*|putty*|rxvt*|ansi) + print -Pn "\e]2;$2:q\a" + print -Pn "\e]1;$1:q\a" + ;; + screen*|tmux*) + print -Pn "\ek$1:q\e\\" + ;; + *) + if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then + echoti tsl + print -Pn "$1" + echoti fsl + fi + ;; + esac +} + +function omz_termsupport_precmd { + emulate -L zsh + + title '%15<..<%~%<<' '%n@%m: %~' +} + +function omz_termsupport_preexec { + emulate -L zsh + setopt extended_glob + + local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%} + local LINE="${2:gs/%/%%}" + + title '$CMD' '%100>...>$LINE%<<' +} + +precmd_functions+=(omz_termsupport_precmd) +preexec_functions+=(omz_termsupport_preexec) diff --git a/zsh/libs/directories.zsh b/zsh/libs/directories.zsh deleted file mode 100644 index faea546..0000000 --- a/zsh/libs/directories.zsh +++ /dev/null @@ -1,3 +0,0 @@ -setopt auto_pushd -setopt pushd_ignore_dups -setopt pushdminus diff --git a/zsh/libs/functions.zsh b/zsh/libs/functions.zsh deleted file mode 100644 index 93ade7b..0000000 --- a/zsh/libs/functions.zsh +++ /dev/null @@ -1,121 +0,0 @@ -function take() { - mkdir -p $@ && cd ${@:$#} -} - -function open_command() { - local open_cmd - - case "$OSTYPE" in - darwin*) open_cmd='open' ;; - cygwin*) open_cmd='cygstart' ;; - linux*) [[ "$(uname -r)" != *icrosoft* ]] && open_cmd='nohup xdg-open' || { - open_cmd='cmd.exe /c start ""' - [[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 } - } ;; - msys*) open_cmd='start ""' ;; - *) echo "Platform $OSTYPE not supported" - return 1 - ;; - esac - - ${=open_cmd} "$@" &>/dev/null -} - -function alias_value() { - (( $+aliases[$1] )) && echo $aliases[$1] -} - -function try_alias_value() { - alias_value "$1" || echo "$1" -} - -function default() { - (( $+parameters[$1] )) && return 0 - typeset -g "$1"="$2" && return 3 -} - -function env_default() { - (( ${${(@f):-$(typeset +xg)}[(I)$1]} )) && return 0 - export "$1=$2" && return 3 -} - -zmodload zsh/langinfo - -function omz_urlencode() { - emulate -L zsh - zparseopts -D -E -a opts r m P - - local in_str=$1 - local url_str="" - local spaces_as_plus - if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi - local str="$in_str" - - local encoding=$langinfo[CODESET] - local safe_encodings - safe_encodings=(UTF-8 utf8 US-ASCII) - if [[ -z ${safe_encodings[(r)$encoding]} ]]; then - str=$(echo -E "$str" | iconv -f $encoding -t UTF-8) - if [[ $? != 0 ]]; then - echo "Error converting string from $encoding to UTF-8" >&2 - return 1 - fi - fi - - local i byte ord LC_ALL=C - export LC_ALL - local reserved=';/?:@&=+$,' - local mark='_.!~*''()-' - local dont_escape="[A-Za-z0-9" - if [[ -z $opts[(r)-r] ]]; then - dont_escape+=$reserved - fi - - if [[ -z $opts[(r)-m] ]]; then - dont_escape+=$mark - fi - dont_escape+="]" - - local url_str="" - for (( i = 1; i <= ${#str}; ++i )); do - byte="$str[i]" - if [[ "$byte" =~ "$dont_escape" ]]; then - url_str+="$byte" - else - if [[ "$byte" == " " && -n $spaces_as_plus ]]; then - url_str+="+" - else - ord=$(( [##16] #byte )) - url_str+="%$ord" - fi - fi - done - echo -E "$url_str" -} - -function omz_urldecode { - emulate -L zsh - local encoded_url=$1 - - local caller_encoding=$langinfo[CODESET] - local LC_ALL=C - export LC_ALL - - local tmp=${encoded_url:gs/+/ /} - tmp=${tmp:gs/\\/\\\\/} - tmp=${tmp:gs/%/\\x/} - local decoded - eval "decoded=\$'$tmp'" - - local safe_encodings - safe_encodings=(UTF-8 utf8 US-ASCII) - if [[ -z ${safe_encodings[(r)$caller_encoding]} ]]; then - decoded=$(echo -E "$decoded" | iconv -f UTF-8 -t $caller_encoding) - if [[ $? != 0 ]]; then - echo "Error converting string from UTF-8 to $caller_encoding" >&2 - return 1 - fi - fi - - echo -E "$decoded" -} diff --git a/zsh/libs/grep.zsh b/zsh/libs/grep.zsh deleted file mode 100644 index 8269071..0000000 --- a/zsh/libs/grep.zsh +++ /dev/null @@ -1,23 +0,0 @@ -grep-flag-available() { - echo | grep $1 "" >/dev/null 2>&1 -} - -GREP_OPTIONS="" - -if grep-flag-available --color=auto; then - GREP_OPTIONS+=" --color=auto" -fi - -VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}" - -if grep-flag-available --exclude-dir=.cvs; then - GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS" -elif grep-flag-available --exclude=.cvs; then - GREP_OPTIONS+=" --exclude=$VCS_FOLDERS" -fi - -alias grep="grep $GREP_OPTIONS" - -unset GREP_OPTIONS -unset VCS_FOLDERS -unfunction grep-flag-available diff --git a/zsh/libs/history.zsh b/zsh/libs/history.zsh deleted file mode 100644 index 415e614..0000000 --- a/zsh/libs/history.zsh +++ /dev/null @@ -1,33 +0,0 @@ -function omz_history { - local clear list - zparseopts -E c=clear l=list - - if [[ -n "$clear" ]]; then - echo -n >| "$HISTFILE" - echo >&2 History file deleted. Reload the session to see its effects. - elif [[ -n "$list" ]]; then - builtin fc "$@" - else - [[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1 - fi -} - -case ${HIST_STAMPS-} in - "mm/dd/yyyy") alias history='omz_history -f' ;; - "dd.mm.yyyy") alias history='omz_history -E' ;; - "yyyy-mm-dd") alias history='omz_history -i' ;; - "") alias history='omz_history' ;; - *) alias history="omz_history -t '$HIST_STAMPS'" ;; -esac - -HISTSIZE=50000 -SAVEHIST=10000 -HISTFILE=$HOME/.cache/zsh/history - -setopt extended_history -setopt hist_expire_dups_first -setopt hist_ignore_dups -setopt hist_ignore_space -setopt hist_verify -setopt inc_append_history -setopt share_history diff --git a/zsh/libs/misc.zsh b/zsh/libs/misc.zsh deleted file mode 100644 index 884b610..0000000 --- a/zsh/libs/misc.zsh +++ /dev/null @@ -1,18 +0,0 @@ -autoload -Uz is-at-least - -if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then - for d in $fpath; do - if [[ -e "$d/url-quote-magic" ]]; then - if is-at-least 5.1; then - autoload -Uz bracketed-paste-magic - zle -N bracketed-paste bracketed-paste-magic - fi - autoload -Uz url-quote-magic - zle -N self-insert url-quote-magic - break - fi - done -fi - -setopt long_list_jobs -setopt interactivecomments diff --git a/zsh/libs/termsupport.zsh b/zsh/libs/termsupport.zsh deleted file mode 100644 index bf7fb76..0000000 --- a/zsh/libs/termsupport.zsh +++ /dev/null @@ -1,79 +0,0 @@ -function title { - emulate -L zsh - setopt prompt_subst - - [[ "$EMACS" == *term* ]] && return - - : ${2=$1} - - case "$TERM" in - cygwin|xterm*|putty*|rxvt*|ansi) - print -Pn "\e]2;$2:q\a" - print -Pn "\e]1;$1:q\a" - ;; - screen*|tmux*) - print -Pn "\ek$1:q\e\\" - ;; - *) - if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then - print -Pn "\e]2;$2:q\a" - print -Pn "\e]1;$1:q\a" - else - if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then - echoti tsl - print -Pn "$1" - echoti fsl - fi - fi - ;; - esac -} - -ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" -ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" - -if [[ "$TERM_PROGRAM" == Apple_Terminal ]]; then - ZSH_THEME_TERM_TITLE_IDLE="%n@%m" -fi - -function omz_termsupport_precmd { - emulate -L zsh - - if [[ "$DISABLE_AUTO_TITLE" == true ]]; then - return - fi - - title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE -} - -function omz_termsupport_preexec { - emulate -L zsh - setopt extended_glob - - if [[ "$DISABLE_AUTO_TITLE" == true ]]; then - return - fi - - local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%} - local LINE="${2:gs/%/%%}" - - title '$CMD' '%100>...>$LINE%<<' -} - -precmd_functions+=(omz_termsupport_precmd) -preexec_functions+=(omz_termsupport_preexec) - - -if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then - function update_terminalapp_cwd() { - emulate -L zsh - - local URL_PATH="$(omz_urlencode -P $PWD)" - [[ $? != 0 ]] && return 1 - - printf '\e]7;%s\a' "file://$HOST$URL_PATH" - } - - precmd_functions+=(update_terminalapp_cwd) - update_terminalapp_cwd -fi diff --git a/zsh/libs/tmux.zsh b/zsh/libs/tmux.zsh deleted file mode 100644 index aa1420c..0000000 --- a/zsh/libs/tmux.zsh +++ /dev/null @@ -1,7 +0,0 @@ -# ALIASES -alias ta='tmux attach -t' -alias tad='tmux attach -d -t' -alias ts='tmux new-session -s' -alias tl='tmux list-sessions' -alias tksv='tmux kill-server' -alias tkss='tmux kill-session -t' diff --git a/zsh/plgs/aliases.zsh b/zsh/plgs/aliases.zsh deleted file mode 100644 index 68f005a..0000000 --- a/zsh/plgs/aliases.zsh +++ /dev/null @@ -1,11 +0,0 @@ -alias ls='exa -al --color=always --group-directories-first' -alias la='exa -a --color=always --group-directories-first' -alias ll='exa -l --color=always --group-directories-first' -alias lt='exa -aT --color=always --group-directories-first' - -alias rm='rm -i' -alias cp='cp -i' -alias mv='mv -i' - -alias duplHostKeys='cat ~/.ssh/known_hosts | egrep -v "mesh.eu|inetbone.net" | cut -d" " -f3 | sort | uniq -d' -alias tb="nc termbin.com 9999" diff --git a/zsh/plgs/appup.zsh b/zsh/plgs/appup.zsh deleted file mode 100644 index 31b3d3f..0000000 --- a/zsh/plgs/appup.zsh +++ /dev/null @@ -1,141 +0,0 @@ -# Docker -_appup_docker () { - if hash docker-compose >/dev/null 2>&1; then - # Check if docker has been started - if [ "${APPUP_CHECK_STARTED:-true}" = true ]; then - if hash docker-machine >/dev/null 2>&1 && [ "${APPUP_DOCKER_MACHINE:-true}" = true ]; then - if docker-machine status | grep -qi "Stopped"; then - read -r -k 1 "REPLY?Docker Machine is not running, would you like to start it? [y/N] " - echo "" - - if [[ "$REPLY" == "y" ]]; then - docker-machine start default && eval $(docker-machine env default) - echo "" - else - return 0 - fi - fi - elif docker ps 2>&1 | grep -qi "Is the docker daemon running?"; then - read -r -k 1 "REPLY?Docker for Mac is not running, would you like to start it? [y/N] " - echo "" - - if [[ "$REPLY" == "y" ]]; then - open -a Docker - - echo "" - echo "Waiting for docker to start.." - echo "" - - # Wait for it to start - while true; do - if docker ps 2>&1 | grep -qi "Is the docker daemon running?" || docker ps 2>&1 | grep -qi "connection refused"; then - sleep 5 - else - break - fi - done - else - return0 - fi - fi - fi - - # Check YAML extension - compose_file='' - compose_project_file='' - - if [ -e "docker-compose.yml" ]; then - compose_file='docker-compose.yml' - elif [ -e "docker-compose.yaml" ]; then - compose_file='docker-compose.yaml' - fi - - # will look for docker-compose..yml - if [ -n "$2" ]; then - if [ -e "docker-compose.$2.yml" ]; then - compose_project_file="docker-compose.$2.yml" - elif [ -e "docker-compose.$2.yaml" ]; then - compose_project_file="docker-compose.$2.yaml" - fi - - if [ -n "$compose_project_file" ]; then - # Override project name from custom env - if [ -e ".env.$2" ]; then - project=$(source ".env.$2"; echo $COMPOSE_PROJECT_NAME) - - if [ -n $project ]; then - docker-compose -p "${project}" -f "$compose_file" -f "$compose_project_file" $1 "${@:3}" - return - fi - fi - - docker-compose -f "$compose_file" -f "$compose_project_file" $1 "${@:3}" - return - fi - fi - - docker-compose $1 "${@:2}" - else - echo >&2 "Docker compose file found but docker-compose is not installed." - fi -} - -# Vagrant -_appup_vagrant () { - if hash vagrant >/dev/null 2>&1; then - vagrant $1 "${@:2}" - else - echo >&2 "Vagrant file found but vagrant is not installed." - fi -} - -# Commands -up () { - if [ -e "docker-compose.yml" ] || [ -e "docker-compose.yaml" ]; then - _appup_docker up "$@" - elif [ -e "Vagrantfile" ]; then - _appup_vagrant up "$@" - elif hash up >/dev/null 2>&1; then - env up "$@" - fi -} - -down () { - if [ -e "docker-compose.yml" ] || [ -e "docker-compose.yaml" ]; then - _appup_docker down "$@" - elif [ -e "Vagrantfile" ]; then - _appup_vagrant destroy "$@" - elif hash down >/dev/null 2>&1; then - env down "$@" - fi -} - -start () { - if [ -e "docker-compose.yml" ] || [ -e "docker-compose.yaml" ]; then - _appup_docker start "$@" - elif [ -e "Vagrantfile" ]; then - _appup_vagrant up "$@" - elif hash start >/dev/null 2>&1; then - env start "$@" - fi -} - -restart () { - if [ -e "docker-compose.yml" ] || [ -e "docker-compose.yaml" ]; then - _appup_docker restart "$@" - elif [ -e "Vagrantfile" ]; then - _appup_vagrant reload "$@" - elif hash start >/dev/null 2>&1; then - env start "$@" - fi -} - -stop () { - if [ -e "docker-compose.yml" ] || [ -e "docker-compose.yaml" ]; then - _appup_docker stop "$@" - elif [ -e "Vagrantfile" ]; then - _appup_vagrant halt "$@" - elif hash stop >/dev/null 2>&1; then - env stop "$@" - fi -} diff --git a/zsh/plgs/colorman.zsh b/zsh/plgs/colorman.zsh deleted file mode 100644 index aafd5d6..0000000 --- a/zsh/plgs/colorman.zsh +++ /dev/null @@ -1,18 +0,0 @@ -function colored() { - command env \ - LESS_TERMCAP_mb=$(printf "\e[1;31m") \ - LESS_TERMCAP_md=$(printf "\e[1;31m") \ - LESS_TERMCAP_me=$(printf "\e[0m") \ - LESS_TERMCAP_se=$(printf "\e[0m") \ - LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ - LESS_TERMCAP_ue=$(printf "\e[0m") \ - LESS_TERMCAP_us=$(printf "\e[1;32m") \ - PAGER="${commands[less]:-$PAGER}" \ - _NROFF_U=1 \ - PATH="$HOME/bin:$PATH" "$@" -} - -# Colorize man and dman/debman (from debian-goodies) -function man dman debman { - colored $0 "$@" -} diff --git a/zsh/plgs/extract.zsh b/zsh/plgs/extract.zsh deleted file mode 100644 index a5594b8..0000000 --- a/zsh/plgs/extract.zsh +++ /dev/null @@ -1,82 +0,0 @@ -alias x=extract - -extract() { - local remove_archive - local success - local extract_dir - - if (( $# == 0 )); then - cat <<-'EOF' >&2 - Usage: extract [-option] [file ...] - - Options: - -r, --remove Remove archive after unpacking. - EOF - fi - - remove_archive=1 - if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then - remove_archive=0 - shift - fi - - while (( $# > 0 )); do - if [[ ! -f "$1" ]]; then - echo "extract: '$1' is not a valid file" >&2 - shift - continue - fi - - success=0 - extract_dir="${1:t:r}" - case "${1:l}" in - (*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;; - (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; - (*.tar.xz|*.txz) - tar --xz --help &> /dev/null \ - && tar --xz -xvf "$1" \ - || xzcat "$1" | tar xvf - ;; - (*.tar.zma|*.tlz) - tar --lzma --help &> /dev/null \ - && tar --lzma -xvf "$1" \ - || lzcat "$1" | tar xvf - ;; - (*.tar.zst|*.tzst) - tar --zstd --help &> /dev/null \ - && tar --zstd -xvf "$1" \ - || zstdcat "$1" | tar xvf - ;; - (*.tar) tar xvf "$1" ;; - (*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;; - (*.tar.lz4) lz4 -c -d "$1" | tar xvf - ;; - (*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;; - (*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;; - (*.bz2) bunzip2 "$1" ;; - (*.xz) unxz "$1" ;; - (*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;; - (*.lz4) lz4 -d "$1" ;; - (*.lzma) unlzma "$1" ;; - (*.z) uncompress "$1" ;; - (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; - (*.rar) unrar x -ad "$1" ;; - (*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;; - (*.7z) 7za x "$1" ;; - (*.deb) - mkdir -p "$extract_dir/control" - mkdir -p "$extract_dir/data" - cd "$extract_dir"; ar vx "../${1}" > /dev/null - cd control; tar xzvf ../control.tar.gz - cd ../data; extract ../data.tar.* - cd ..; rm *.tar.* debian-binary - cd .. - ;; - (*.zst) unzstd "$1" ;; - (*) - echo "extract: '$1' cannot be extracted" >&2 - success=1 - ;; - esac - - (( success = $success > 0 ? $success : $? )) - (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1" - shift - done -} diff --git a/zsh/plgs/gitignore.zsh b/zsh/plgs/gitignore.zsh deleted file mode 100644 index 15e38d3..0000000 --- a/zsh/plgs/gitignore.zsh +++ /dev/null @@ -1,12 +0,0 @@ -function gi() { curl -fL https://www.gitignore.io/api/${(j:,:)@} } - -_gitignoreio_get_command_list() { - curl -sfL https://www.gitignore.io/api/list | tr "," "\n" -} - -_gitignoreio () { - compset -P '*,' - compadd -S '' `_gitignoreio_get_command_list` -} - -compdef _gitignoreio gi diff --git a/zsh/plgs/systemctl.zsh b/zsh/plgs/systemctl.zsh deleted file mode 100644 index c37748c..0000000 --- a/zsh/plgs/systemctl.zsh +++ /dev/null @@ -1,5 +0,0 @@ -cmds=(status show start stop reload restart enable disable daemon-reload) - -for cmd in $cmds; do - alias sc-$cmd="sudo systemctl $cmd" -done