Complete man pages
authorSergey Matveev <stargrave@stargrave.org>
Sun, 31 May 2020 11:23:03 +0000 (14:23 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 31 May 2020 17:36:07 +0000 (20:36 +0300)
zsh/.zshrc

index 4aa6a4ff9c01b87016eaa5bbfc87710b754ddf1e..0756acccf4c46ebd56138eff6ad1fa52018fcd75 100644 (file)
@@ -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%%\=*}"