aboutsummaryrefslogtreecommitdiff
path: root/config/zsh
diff options
context:
space:
mode:
authorMatt Singleton <matt@xcolour.net>2021-12-08 12:10:29 -0600
committerMatt Singleton <matt@xcolour.net>2021-12-08 12:10:29 -0600
commitb3660395859f6cd44d75a2b4cb1ad48856458be2 (patch)
treea49e4eba4baa51c0b175793928571fb6f78304fc /config/zsh
parentae7f2d461d45b666e0a4442fca2679e9ff023302 (diff)
clean out some completion cruft
Diffstat (limited to 'config/zsh')
-rw-r--r--config/zsh/50-completion.zsh32
1 files changed, 3 insertions, 29 deletions
diff --git a/config/zsh/50-completion.zsh b/config/zsh/50-completion.zsh
index d62dd3b..23cb052 100644
--- a/config/zsh/50-completion.zsh
+++ b/config/zsh/50-completion.zsh
@@ -1,7 +1,7 @@
# initialize the completion system
autoload -U compinit
-zmodload zsh/complist
compinit -d "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompdump"
+zmodload zsh/complist
# complete only after the second consecutive tab
setopt auto_menu
@@ -12,42 +12,16 @@ zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# use menu selection by default
zstyle ':completion:*:default' menu select
-# custom completion list for processes (just current user's)
-zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
-# special colors for kill completion listing
-zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
-
# disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
cdpath=(.)
-# use /etc/hosts and known_hosts for hostname completion
-[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
-[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
-hosts=(
- "$_ssh_hosts[@]"
- "$_etc_hosts[@]"
- `hostname`
- localhost
-)
-zstyle ':completion:*:hosts' hosts $hosts
+# don't autocomplete local users for (ssh|ftp|scp|rsync)
+zstyle ':completion:*:*:(ssh|ftp|scp|rsync):*' users
# Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion:*' cache-path "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompcache"
-# Don't complete uninteresting users
-zstyle ':completion:*:*:*:users' ignored-patterns \
- adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
- dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
- hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
- mailman mailnull mldonkey mysql nagios \
- named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
- operator pcap postfix postgres privoxy pulse pvm quagga radvd \
- rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs
-
-# ... unless we really want to.
-zstyle ':completion:*' single-ignored show
-
# always rehash commands list
zstyle ':completion:*:commands' rehash 1