added new, better ssh functionality

This commit is contained in:
eeleater 2025-03-24 16:26:14 +01:00
parent 0d02d90080
commit d310fd8f9b
2 changed files with 7 additions and 2 deletions

View file

@ -40,7 +40,7 @@ eval "$(mise activate zsh)"
# source files # source files
source "$ZDOTDIR"/files/aliases.zsh source "$ZDOTDIR"/files/aliases.zsh
source "$ZDOTDIR"/files/sshcomp.zsh #source "$ZDOTDIR"/files/sshcomp.zsh
# local overrides # local overrides
for sourced in "$XDG_DATA_HOME"/zsh/*; do source $sourced; done for sourced in "$XDG_DATA_HOME"/zsh/*; do source $sourced; done

View file

@ -12,5 +12,10 @@ zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*:hosts-domain' ignored-pattern
zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.*' '255.255.255.255' '::1' 'fe80::*' 'ff02::*' zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.*' '255.255.255.255' '::1' 'fe80::*' 'ff02::*'
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
hosts=( "$_ssh_hosts[@]" ) [ -r ~/.ssh/known_hosts_priv ] && _ssh_hosts_priv=(${${${${(f)"$(<$HOME/.ssh/known_hosts_priv)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts_priv=()
[ -r ~/.ssh/known_hosts_work_ojs ] && _ssh_hosts_ojs=(${${${${(f)"$(<$HOME/.ssh/known_hosts_work_ojs)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts_ojs=()
[ -r ~/.ssh/known_hosts_work_danrw ] && _ssh_hosts_work_danrw=(${${${${(f)"$(<$HOME/.ssh/known_hosts_work_danrw)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts_work_danrw=()
[ -r ~/.ssh/known_hosts_misc ] && _ssh_hosts_work_misc=(${${${${(f)"$(<$HOME/.ssh/known_hosts_misc)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts_work_misc=()
[ -r ~/.ssh/known_hosts_work_lzv ] && _ssh_hosts_work_lzv=(${${${${(f)"$(<$HOME/.ssh/known_hosts_work_lzv)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts_work_lzv=()
hosts=( "$_ssh_hosts[@]" "$_ssh_hosts_priv[@]" "$_ssh_hosts_work_ojs[@]" "$_ssh_hosts_work_danrw[@]" "$_ssh_hosts_misc[@]" "$_ssh_hosts_work_lzv[@]" )
zstyle ':completion:*:hosts' hosts $hosts zstyle ':completion:*:hosts' hosts $hosts