added sshcompfix.zsh
This commit is contained in:
parent
148a137290
commit
06864e10c9
2 changed files with 15 additions and 9 deletions
14
dot_config/zsh/sshcompfix.zsh
Normal file
14
dot_config/zsh/sshcompfix.zsh
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# use known_hosts for completion
|
||||||
|
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'
|
||||||
|
|
||||||
|
# order stuff
|
||||||
|
zstyle ':completion:*:(scp|ssh):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
|
||||||
|
zstyle ':completion:*:scp:*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
|
||||||
|
zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr
|
||||||
|
|
||||||
|
# ignored patterns
|
||||||
|
zstyle ':completion:*:*:*:users' ignored-patterns '*'
|
||||||
|
zstyle ':completion:*:*:*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost localhost4 localhost6 ip6-localhost broadcasthost
|
||||||
|
zstyle ':completion:*:*:*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*' '*localdomain*' '*.eeleater.org' '*.local'
|
||||||
|
zstyle ':completion:*:*:*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
|
||||||
|
|
10
dot_zshrc
10
dot_zshrc
|
@ -1,5 +1,4 @@
|
||||||
# Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md
|
# Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md
|
||||||
|
|
||||||
zstyle ':z4h:' auto-update 'no'
|
zstyle ':z4h:' auto-update 'no'
|
||||||
zstyle ':z4h:' auto-update-days '28'
|
zstyle ':z4h:' auto-update-days '28'
|
||||||
|
|
||||||
|
@ -57,14 +56,7 @@ zle -N run_ranger
|
||||||
bindkey '^f' run_ranger
|
bindkey '^f' run_ranger
|
||||||
|
|
||||||
# fix ssh completions
|
# fix ssh completions
|
||||||
zstyle ':completion:*:*:*:users' ignored-patterns '*'
|
z4h source $HOME/.config/zsh/sshcompfix.zsh
|
||||||
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'
|
|
||||||
zstyle ':completion:*:(scp|ssh):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
|
|
||||||
zstyle ':completion:*:scp:*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
|
|
||||||
zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr
|
|
||||||
zstyle ':completion:*:*:*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost localhost4 localhost6 ip6-localhost broadcasthost
|
|
||||||
zstyle ':completion:*:*:*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*' '*localdomain*' '*.eeleater.org' '*.local'
|
|
||||||
zstyle ':completion:*:*:*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
|
|
||||||
|
|
||||||
# Define named directories: ~wsl <=> Windows home directory on WSL.
|
# Define named directories: ~wsl <=> Windows home directory on WSL.
|
||||||
[[ -z $z4h_win_home ]] || hash -d wsl=$z4h_win_home
|
[[ -z $z4h_win_home ]] || hash -d wsl=$z4h_win_home
|
||||||
|
|
Loading…
Add table
Reference in a new issue