mirror of
https://github.com/Matir/skel.git
synced 2026-05-26 13:35:42 -07:00
Refactor zshrc.
This commit is contained in:
19
zshrc
19
zshrc
@@ -44,23 +44,8 @@ bindkey '^[[B' history-search-forward
|
||||
bindkey '^[[1;5C' forward-word
|
||||
bindkey '^[[1;5D' backward-word
|
||||
|
||||
# SSH autocompletion
|
||||
# ssh, scp, ping, host
|
||||
# https://github.com/tehmaze/maze.io/blob/master/maze/_post/2008/08-03-remote-tabcompletion-using-openssh-and-zsh.md
|
||||
zstyle ':completion:*:scp:*' tag-order 'hosts:-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:*' tag-order users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
|
||||
zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr
|
||||
zstyle ':completion:*:(ssh|scp):*:hosts-host' ignored-patterns '*.*' loopback localhost
|
||||
zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^*.*' '*@*'
|
||||
zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->'
|
||||
zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns adm bin daemon halt lp named shutdown sync
|
||||
zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=(
|
||||
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
|
||||
/dev/null)"}%%[# ]*}//,/ }
|
||||
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
|
||||
${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
|
||||
)'
|
||||
# Source extras
|
||||
for file in $HOME/.zshrc.d/* ; do source "$file" ; done
|
||||
|
||||
# Load any local settings
|
||||
if [ -e $HOME/.zshrc.local ] ; then source $HOME/.zshrc.local ; fi
|
||||
|
||||
6
zshrc.d/remove-wine-files
Normal file
6
zshrc.d/remove-wine-files
Normal file
@@ -0,0 +1,6 @@
|
||||
remove-wine-associations() {
|
||||
rm ~/.local/share/applications/wine*.desktop
|
||||
update-desktop-database ~/.local/share/applications
|
||||
rm ~/.local/share/mime/packages/x-wine*.xml
|
||||
update-mime-database ~/.local/share/mime
|
||||
}
|
||||
17
zshrc.d/ssh-completion
Normal file
17
zshrc.d/ssh-completion
Normal file
@@ -0,0 +1,17 @@
|
||||
# SSH autocompletion
|
||||
# ssh, scp, ping, host
|
||||
# https://github.com/tehmaze/maze.io/blob/master/maze/_post/2008/08-03-remote-tabcompletion-using-openssh-and-zsh.md
|
||||
zstyle ':completion:*:scp:*' tag-order 'hosts:-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:*' tag-order users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
|
||||
zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr
|
||||
zstyle ':completion:*:(ssh|scp):*:hosts-host' ignored-patterns '*.*' loopback localhost
|
||||
zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^*.*' '*@*'
|
||||
zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->'
|
||||
zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns adm bin daemon halt lp named shutdown sync
|
||||
zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=(
|
||||
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
|
||||
/dev/null)"}%%[# ]*}//,/ }
|
||||
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
|
||||
${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
|
||||
)'
|
||||
Reference in New Issue
Block a user