From 674f8cd7c1ac3e04fef048905a16f11472799958 Mon Sep 17 00:00:00 2001 From: maudin Date: Tue, 8 Jun 2021 11:21:44 +0200 Subject: [PATCH] add emacs tramp command and completion --- hybris.completions | 3 +++ hybris.zsh | 1 + 2 files changed, 4 insertions(+) diff --git a/hybris.completions b/hybris.completions index a420e95..b2a534d 100644 --- a/hybris.completions +++ b/hybris.completions @@ -1,3 +1,6 @@ # Some completions compctl -K _completemarks j compdef _path_commands catwhich + +_complete_tramp() {reply=($(ls $INFRA/host && grep "^ [^ ]" ~/dev/robespierre/infra/hosts/all.yml | sed 's/^ *\(.*\):$/\1/'))} +compctl -K _complete_tramp tramp diff --git a/hybris.zsh b/hybris.zsh index 1a6e715..1cd7d66 100644 --- a/hybris.zsh +++ b/hybris.zsh @@ -19,6 +19,7 @@ dchroot() {docker run --rm --privileged -ti $@ debian:stretch /bin/bash} dontknow() {echo -n "¯\\_(ツ)_/¯" | xclip} dualscreen() {[ $# -eq 1 ] && xrandr --auto && xrandr --output $1 --primary --output eDP1 --left-of $1} 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 $@} ips() {i=0; while [ $i -lt 10 ]; do curl -s ipinfo.io | jq '.ip'; i=$(($i + 1)); done | sort | uniq -c} j() {if [ $# -eq 0 ]; then marks; else jump $@; fi}