From: Sergey Matveev <stargrave@stargrave.org>
Date: Sun, 31 May 2020 11:23:03 +0000 (+0300)
Subject: Complete man pages
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=1870931657239216f097193281d52014d34fa903;p=dotfiles.git

Complete man pages
---

diff --git a/zsh/.zshrc b/zsh/.zshrc
index 4aa6a4f..0756acc 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -152,7 +152,8 @@ alias zc="zcalc"
 zstyle ":completion:*:functions" ignored-patterns "_*"
 zstyle ":completion:*" matcher-list "" 'm:{a-z\-}={A-Z\_}' 'r:|?=** m:{a-z\-}={A-Z\_}'
 _mycomp () {
-    [ $CURRENT -eq 1 ] && _command_names || _files && return 0
+    [ "$words[1]" != "man" ] || { _man && return 0 }
+    [ $CURRENT -eq 1 ] && _command_names ||  _files && return 0
     # MAGIC_EQUAL_SUBST {{{
     [[ "$PREFIX" = *\=* ]] || return 1
     compstate[parameter]="${PREFIX%%\=*}"