From 223c1ee1699511be2400bc6de9d06f035f8e05c2 Mon Sep 17 00:00:00 2001 From: maudin Date: Mon, 9 Dec 2024 18:17:46 +0100 Subject: [PATCH] more clean --- README.md | 4 ++-- bearstech.zsh | 13 ------------- maudin.completions | 9 +++++---- maudin.plugins | 3 --- maudin.zsh | 12 ++++++++++-- 5 files changed, 17 insertions(+), 24 deletions(-) delete mode 100644 bearstech.zsh diff --git a/README.md b/README.md index cbf8b07..d731711 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Zsh configuration using zgen. ``` $ git clone https://github.com/tarjoilija/zgen.git "${HOME}/.zgen" $ source ${HOME}/.zgen/zgen.zsh -$ zgen clone https://gitea.audin.me/hybris/zsh -$ ln -s ${HOME}/.zgen/https-COLON--SLASH--SLASH-gitea.audin.me-SLASH-hybris/zsh-master/zshrc $HOME/.zshrc +$ zgen clone https://forgejo.audin.me/hybris/zsh.git main +$ ln -s ${HOME}/.zgen/https-COLON--SLASH--SLASH-forgejo.audin.me-SLASH-maudin/zsh.git-main/zshrc $HOME/.zshrc $ zgen reset $ source ${HOME}/.zshrc ``` diff --git a/bearstech.zsh b/bearstech.zsh deleted file mode 100644 index fa49f2d..0000000 --- a/bearstech.zsh +++ /dev/null @@ -1,13 +0,0 @@ -# Some exports -export INFRA=/home/${USER}/dev/bearstech/infra -export PATH=$INFRA/bin:$INFRA/service/xen:$PATH - -# Everyday aliases -bt-alerts() {ssh root@${1:-pidou} monshow | grep -v "none$"} -bt-release() {ssh root@$1 cat /etc/debian_version} - -# Some completion functions -_complete_bt-host() {reply=($(ls $INFRA/host))} -compctl -K _complete_bt-host bt-dom0 -compctl -K _complete_bt-host infra host -compctl -K _complete_bt-host bt-release diff --git a/maudin.completions b/maudin.completions index b1212b3..a9a933b 100644 --- a/maudin.completions +++ b/maudin.completions @@ -1,11 +1,12 @@ # 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$//')} +function _myssh() {compadd $(ls $INFRA/host))} compdef _myssh r compdef _myssh ra compdef _myssh tramp + +_complete_bt-host() {reply=($(ls $INFRA/host))} +compctl -K _complete_bt-host infra host +compctl -K _complete_bt-host debian-release diff --git a/maudin.plugins b/maudin.plugins index 743fae3..d38bc8e 100644 --- a/maudin.plugins +++ b/maudin.plugins @@ -1,6 +1,3 @@ -# 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 diff --git a/maudin.zsh b/maudin.zsh index b1cc3ba..145d10a 100644 --- a/maudin.zsh +++ b/maudin.zsh @@ -6,7 +6,6 @@ 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 @@ -20,6 +19,8 @@ SAVEHIST=500000 disable -r foreach # Everyday aliases +bt-alerts() {ssh root@${1:-pidou} monshow | grep -v "none$"} +debian-release() {ssh root@$1 cat /etc/debian_version} 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} @@ -36,13 +37,20 @@ bindkey "^[Oc" forward-word # Some exports export DISABLE_AUTO_TITLE=true export EDITOR=emacsclient +export INFRA=/home/${USER}/dev/bearstech/infra 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 PATH=$ROBESPIERRE/bin:$HOME/.scripts:$PATH +export PATH=$HOME/.scripts:$INFRA/bin:$INFRA/service/xen:$PATH + +# Some completion functions +_complete_bt-host() {reply=($(ls $INFRA/host))} +compctl -K _complete_bt-host bt-dom0 +compctl -K _complete_bt-host infra host +compctl -K _complete_bt-host bt-release # Fix for compdef, taken from https://github.com/seletskiy/zsh-zgen-compinit-tweak autoload -Uz compinit && compinit -C