From 81ab085c17b9abe6b89d5f37a703ff8bd38d8734 Mon Sep 17 00:00:00 2001 From: maudin Date: Mon, 9 Dec 2024 17:42:00 +0100 Subject: [PATCH] clean --- bearstech.zsh | 23 ++++--------------- hybris.completions | 11 ---------- hybris.plugins | 14 ------------ hybris.theme | 7 ------ hybris.zsh | 55 ---------------------------------------------- maudin.plugins | 2 -- maudin.zsh | 5 ----- root.completions | 2 -- root.plugins | 7 ------ root.theme | 7 ------ root.zsh | 19 ---------------- zshrc | 10 +++++---- 12 files changed, 10 insertions(+), 152 deletions(-) delete mode 100644 hybris.completions delete mode 100644 hybris.plugins delete mode 100644 hybris.theme delete mode 100644 hybris.zsh delete mode 100644 root.completions delete mode 100644 root.plugins delete mode 100644 root.theme delete mode 100644 root.zsh diff --git a/bearstech.zsh b/bearstech.zsh index 6ec62f8..fa49f2d 100644 --- a/bearstech.zsh +++ b/bearstech.zsh @@ -1,28 +1,13 @@ # Some exports -export INFRA=/home/hybris/dev/bearstech/infra -export PATH=$INFRA/bin:$INFRA/../xen:$PATH -export ANSIBLE_BEARSTECH_LOG_DIR=/var/log/ansible-bearstech +export INFRA=/home/${USER}/dev/bearstech/infra +export PATH=$INFRA/bin:$INFRA/service/xen:$PATH # Everyday aliases -bt-alerts() {ssh root@pidou monshow | grep -v "none$" | grep -v "^ " | grep -v "^$"} -bt-each() {$INFRA/bin/foreach $@} -bt-host() {cat $INFRA/host/$1} -bt-known_hosts() {scp cloud@pompon:.ssh/known_hosts ~/.ssh/known_hosts.bearstech} +bt-alerts() {ssh root@${1:-pidou} monshow | grep -v "none$"} bt-release() {ssh root@$1 cat /etc/debian_version} -# Google Cloud -# The next line updates PATH for the Google Cloud SDK. -source ~/dev/bearstech/google-cloud-sdk/path.zsh.inc -# The next line enables shell command completion for gcloud. -source ~/dev/bearstech/google-cloud-sdk/completion.zsh.inc - -# OVH cloud -nova-env() {source $INFRA/cloud/ovh-$1.env} - # Some completion functions _complete_bt-host() {reply=($(ls $INFRA/host))} -_complete_nova-env() {reply=($(ls $INFRA/cloud/ovh-*.env | sed "s@$INFRA/cloud/ovh-\(.*\).env@\1@"))} compctl -K _complete_bt-host bt-dom0 -compctl -K _complete_bt-host bt-host +compctl -K _complete_bt-host infra host compctl -K _complete_bt-host bt-release -compctl -K _complete_nova-env nova-env diff --git a/hybris.completions b/hybris.completions deleted file mode 100644 index b1212b3..0000000 --- a/hybris.completions +++ /dev/null @@ -1,11 +0,0 @@ -# Bookmarks completion using jump plugin -compctl -K _completemarks j - -# Path completion on catwich -compdef _path_commands catwhich - -# Hostname completion on various ssh commands -function _myssh() {compadd $(ls $INFRA/host); compadd $(ls $ROBESPIERRE/ansible/inventory | sed 's/\.yml$//')} -compdef _myssh r -compdef _myssh ra -compdef _myssh tramp diff --git a/hybris.plugins b/hybris.plugins deleted file mode 100644 index ebcb4eb..0000000 --- a/hybris.plugins +++ /dev/null @@ -1,14 +0,0 @@ -# Bearstech configuration -zgen load https://gitea.audin.me/hybris/zsh bearstech.zsh - -# specify plugins here -zgen oh-my-zsh -zgen oh-my-zsh plugins/colored-man-pages -zgen oh-my-zsh plugins/colorize -zgen oh-my-zsh plugins/extract -zgen oh-my-zsh plugins/git -zgen oh-my-zsh plugins/jump -zgen oh-my-zsh plugins/keychain -zgen oh-my-zsh plugins/rsync -zgen oh-my-zsh plugins/systemadmin -zgen oh-my-zsh plugins/z diff --git a/hybris.theme b/hybris.theme deleted file mode 100644 index ec93083..0000000 --- a/hybris.theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%{${fg_bold[green]}%}%n%{$reset_color%}%{${fg[green]}%}@%m $%{$reset_color%} ' -RPROMPT='%{$fg[white]%}%~$(git_prompt_info)%{$reset_color%}%(?,,%{${fg_bold[red]}%} [%?]%{$reset_color%})' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg_bold[green]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[green]%})%{$fg_bold[red]%}!%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%})" diff --git a/hybris.zsh b/hybris.zsh deleted file mode 100644 index 74f297c..0000000 --- a/hybris.zsh +++ /dev/null @@ -1,55 +0,0 @@ -# keychain -zstyle :omz:plugins:keychain agents gpg,ssh -zstyle :omz:plugins:keychain identities id_rsa id_ed25519 D79CA887 -zstyle :omz:plugins:keychain options --quiet - -# bip at command end, ensure correct window title -function precmd() { - echo -n -e "\a" - echo -en "\033]0;${USER}@$(hostname)\007" -} - -# history file -unsetopt share_history -setopt INC_APPEND_HISTORY -setopt HIST_EXPIRE_DUPS_FIRST -HISTSIZE=500000 -SAVEHIST=500000 - -# Disable reserved word foreach -disable -r foreach - -# Everyday aliases -catwhich() {echo "\e[35mPath: $(which $1)\n\e[39m"; cat $(which $1)} -dontknow() {echo -n "¯\\_(ツ)_/¯" | xclip} -e() {emacsclient -n $@ > /dev/null 2>&1} -tramp() {emacsclient -n $(for x in $@; do echo /root@$x:README; done) > /dev/null 2>&1} -fd() {fdfind -H -I -L $@} -unifi-balance() {ssh ubnt@192.168.42.1 /opt/vyatta/bin/vyatta-op-cmd-wrapper 'show load-balance watchdog' 2> /dev/null} -j() {if [ $# -eq 0 ]; then marks; else jump $@; fi} -loop() {while [ 1 ]; do sh -c "$@"; done} -noprompt() {if [ "$PROMPT" != '$ ' ]; then export PROMPT='$ '; export RPROMPT=''; else source ~/.zgen/https-COLON--SLASH--SLASH-gitea.audin.me-SLASH-hybris/zsh-master/hybris.theme; fi} -open_ports() {if [ $# -eq 1 ] && [ $1 = "public" ]; then sudo netstat -tulpen 2> /dev/null | grep "LISTEN" | grep -v "127.0.0.1"; else sudo netstat -tulpen 2> /dev/null | grep "LISTEN"; fi} -r() {if [ $# -gt 0 ]; then for h in $@; do ssh root@$h; done; else sudo su -; fi} -ra() {if [ $# -gt 0 ]; then for h in $@; do ssh -A root@$h; done; else sudo su -; fi} - -# Usefull bindings -bindkey "^[Od" backward-word -bindkey "^[Oc" forward-word - -# Some exports -export DISABLE_AUTO_TITLE=true -export EDITOR=emacsclient -export LESS=-cex2MRX -export LESSOPEN='|~/.lessfilter %s' -export LOGCHECK=60 -export READNULLCMD=${PAGER:-/usr/bin/pager} -export WATCH=all -export WATCHFMT="%n has %a %l from %M" -export ROBESPIERRE=/home/hybris/dev/robespierre/infra -export PATH=$ROBESPIERRE/bin:$HOME/.scripts:$PATH - -# Fix for compdef, taken from https://github.com/seletskiy/zsh-zgen-compinit-tweak -autoload -Uz compinit && compinit -C -alias compinit='compinit-zgen' -function compinit-zgen() { grep -q ".zgen" <<< "${@}" && \compinit "${@}" } diff --git a/maudin.plugins b/maudin.plugins index ebcb4eb..743fae3 100644 --- a/maudin.plugins +++ b/maudin.plugins @@ -10,5 +10,3 @@ zgen oh-my-zsh plugins/git zgen oh-my-zsh plugins/jump zgen oh-my-zsh plugins/keychain zgen oh-my-zsh plugins/rsync -zgen oh-my-zsh plugins/systemadmin -zgen oh-my-zsh plugins/z diff --git a/maudin.zsh b/maudin.zsh index ec7c202..b1cc3ba 100644 --- a/maudin.zsh +++ b/maudin.zsh @@ -20,14 +20,10 @@ SAVEHIST=500000 disable -r foreach # Everyday aliases -catwhich() {echo "\e[35mPath: $(which $1)\n\e[39m"; cat $(which $1)} dontknow() {echo -n "¯\\_(ツ)_/¯" | xclip} e() {emacsclient -n $@ > /dev/null 2>&1} tramp() {emacsclient -n $(for x in $@; do echo /root@$x:README; done) > /dev/null 2>&1} -fd() {fdfind -H -I -L $@} -unifi-balance() {ssh ubnt@192.168.42.1 /opt/vyatta/bin/vyatta-op-cmd-wrapper 'show load-balance watchdog' 2> /dev/null} j() {if [ $# -eq 0 ]; then marks; else jump $@; fi} -loop() {while [ 1 ]; do sh -c "$@"; done} noprompt() {if [ "$PROMPT" != '$ ' ]; then export PROMPT='$ '; export RPROMPT=''; else source ~/.zgen/https-COLON--SLASH--SLASH-gitea.audin.me-SLASH-hybris/zsh-master/hybris.theme; fi} open_ports() {if [ $# -eq 1 ] && [ $1 = "public" ]; then sudo netstat -tulpen 2> /dev/null | grep "LISTEN" | grep -v "127.0.0.1"; else sudo netstat -tulpen 2> /dev/null | grep "LISTEN"; fi} r() {if [ $# -gt 0 ]; then for h in $@; do ssh root@$h; done; else sudo su -; fi} @@ -46,7 +42,6 @@ export LOGCHECK=60 export READNULLCMD=${PAGER:-/usr/bin/pager} export WATCH=all export WATCHFMT="%n has %a %l from %M" -export ROBESPIERRE=/home/hybris/dev/robespierre/infra export PATH=$ROBESPIERRE/bin:$HOME/.scripts:$PATH # Fix for compdef, taken from https://github.com/seletskiy/zsh-zgen-compinit-tweak diff --git a/root.completions b/root.completions deleted file mode 100644 index 014ce34..0000000 --- a/root.completions +++ /dev/null @@ -1,2 +0,0 @@ -# Some completions -compctl -K _completemarks j diff --git a/root.plugins b/root.plugins deleted file mode 100644 index 1b614a6..0000000 --- a/root.plugins +++ /dev/null @@ -1,7 +0,0 @@ -# specify plugins here -zgen oh-my-zsh -zgen oh-my-zsh plugins/colored-man-pages -zgen oh-my-zsh plugins/colorize -zgen oh-my-zsh plugins/git -zgen oh-my-zsh plugins/jump -zgen oh-my-zsh plugins/systemadmin diff --git a/root.theme b/root.theme deleted file mode 100644 index 3e943da..0000000 --- a/root.theme +++ /dev/null @@ -1,7 +0,0 @@ -PROMPT='%U%{${fg_bold[white]}%}%n%{$reset_color%}%u%{${fg[white]}%}@%m $%{$reset_color%} ' -RPROMPT='%{$fg[white]%}%~$(git_prompt_info)%{$reset_color%}%(?,,%{${fg_bold[red]}%} [%?]%{$reset_color%})' - -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg_bold[green]%}(" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[green]%})%{$fg_bold[red]%}!%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%})" diff --git a/root.zsh b/root.zsh deleted file mode 100644 index e401c5d..0000000 --- a/root.zsh +++ /dev/null @@ -1,19 +0,0 @@ -# bip at command end, resize font -function precmd() { - echo -n -e "\a" -} - -# do not share history between terms... -unsetopt share_history - -# Everyday aliases -j() {if [ $# -eq 0 ]; then marks; else jump $@; fi} - -# Some exports -export EDITOR=emacs -export LESS=-cex2MRX -export LESSOPEN='|~/.lessfilter %s' -export LOGCHECK=60 -export READNULLCMD=${PAGER:-/usr/bin/pager} -export WATCH=all -export WATCHFMT="%n has %a %l from %M" diff --git a/zshrc b/zshrc index df2bbac..ba31dd8 100644 --- a/zshrc +++ b/zshrc @@ -1,16 +1,18 @@ # Load zgen source "${HOME}/.zgen/zgen.zsh" +zsh_config_repo=https://forgejo.audin.me/maudin/zsh + # Plugins and configuration generator if ! zgen saved; then # Configuration - zgen load https://gitea.audin.me/hybris/zsh ${USER}.zsh + zgen load ${zsh_config_repo} ${USER}.zsh # Plugins - zgen load https://gitea.audin.me/hybris/zsh ${USER}.plugins + zgen load ${zsh_config_repo} ${USER}.plugins # Theme - zgen load https://gitea.audin.me/hybris/zsh ${USER}.theme + zgen load ${zsh_config_repo} ${USER}.theme # Completions - zgen load https://gitea.audin.me/hybris/zsh ${USER}.completions + zgen load ${zsh_config_repo} ${USER}.completions # generate the init script from plugins above zgen save