From 5f32ba20770f9f8223cc462d478da3ce255f77fc Mon Sep 17 00:00:00 2001 From: kernc Date: Mon, 24 Feb 2014 23:17:42 +0100 Subject: [PATCH] completion**users ignored-patterns more robust Calculates ignored users at runtime by looking at passwd database and stripping all users with UID < 500. This should work on most unices except perhaps Solaris, which supposedly starts normal users at UID=100. By my timings, this makes it only some 0.010s slower. --- modules/completion/init.zsh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index 3ffad633..fa8a9572 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -99,14 +99,8 @@ zstyle -e ':completion:*:hosts' hosts 'reply=( )' # 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 '_*' +zstyle ':completion:*:*:*:users' ignored-patterns nobody '_*' \ + $(awk -F':' '$3 < 500 && $1 != "root" {printf "%s ", $1}' /etc/passwd) # ... unless we really want to. zstyle '*' single-ignored show