How to make zsh pass the manual section to the man command when the `separate-sections` style is set?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












When asking for a completion by pressing Tab on the zsh command line, the matches can be grouped according to their tag provided that the group-name style is set to an empty string:



autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*:descriptions' format '%d'


In the case of the $ man command, the matches can be divided further if the separate-sections style is set to true for the manuals tag:



autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*:descriptions' format '%d'
zstyle ':completion:*:manuals' separate-sections true


As a result, if I press Tab after $ man write, the completion system suggests these matches:



$ man write
manual page, section 1 (general commands)
write
manual page, section 2 (system calls)
write writev


And if I select the write match in the first list, $ man opens the write page in the first section of the manual.



But if I select the write match in the second list, $ man still opens the write page in the first section, while the description of the list mentions the second section of the manual.



Is it possible to make zsh pass the relevant manual section to the man command when the separate-sections style is set?



I'm using zsh 5.6.2-dev-0 (x86_64-pc-linux-gnu).









share

























    up vote
    0
    down vote

    favorite












    When asking for a completion by pressing Tab on the zsh command line, the matches can be grouped according to their tag provided that the group-name style is set to an empty string:



    autoload -Uz compinit
    compinit
    zstyle ':completion:*' menu select
    zstyle ':completion:*' group-name ''
    zstyle ':completion:*:descriptions' format '%d'


    In the case of the $ man command, the matches can be divided further if the separate-sections style is set to true for the manuals tag:



    autoload -Uz compinit
    compinit
    zstyle ':completion:*' menu select
    zstyle ':completion:*' group-name ''
    zstyle ':completion:*:descriptions' format '%d'
    zstyle ':completion:*:manuals' separate-sections true


    As a result, if I press Tab after $ man write, the completion system suggests these matches:



    $ man write
    manual page, section 1 (general commands)
    write
    manual page, section 2 (system calls)
    write writev


    And if I select the write match in the first list, $ man opens the write page in the first section of the manual.



    But if I select the write match in the second list, $ man still opens the write page in the first section, while the description of the list mentions the second section of the manual.



    Is it possible to make zsh pass the relevant manual section to the man command when the separate-sections style is set?



    I'm using zsh 5.6.2-dev-0 (x86_64-pc-linux-gnu).









    share























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      When asking for a completion by pressing Tab on the zsh command line, the matches can be grouped according to their tag provided that the group-name style is set to an empty string:



      autoload -Uz compinit
      compinit
      zstyle ':completion:*' menu select
      zstyle ':completion:*' group-name ''
      zstyle ':completion:*:descriptions' format '%d'


      In the case of the $ man command, the matches can be divided further if the separate-sections style is set to true for the manuals tag:



      autoload -Uz compinit
      compinit
      zstyle ':completion:*' menu select
      zstyle ':completion:*' group-name ''
      zstyle ':completion:*:descriptions' format '%d'
      zstyle ':completion:*:manuals' separate-sections true


      As a result, if I press Tab after $ man write, the completion system suggests these matches:



      $ man write
      manual page, section 1 (general commands)
      write
      manual page, section 2 (system calls)
      write writev


      And if I select the write match in the first list, $ man opens the write page in the first section of the manual.



      But if I select the write match in the second list, $ man still opens the write page in the first section, while the description of the list mentions the second section of the manual.



      Is it possible to make zsh pass the relevant manual section to the man command when the separate-sections style is set?



      I'm using zsh 5.6.2-dev-0 (x86_64-pc-linux-gnu).









      share













      When asking for a completion by pressing Tab on the zsh command line, the matches can be grouped according to their tag provided that the group-name style is set to an empty string:



      autoload -Uz compinit
      compinit
      zstyle ':completion:*' menu select
      zstyle ':completion:*' group-name ''
      zstyle ':completion:*:descriptions' format '%d'


      In the case of the $ man command, the matches can be divided further if the separate-sections style is set to true for the manuals tag:



      autoload -Uz compinit
      compinit
      zstyle ':completion:*' menu select
      zstyle ':completion:*' group-name ''
      zstyle ':completion:*:descriptions' format '%d'
      zstyle ':completion:*:manuals' separate-sections true


      As a result, if I press Tab after $ man write, the completion system suggests these matches:



      $ man write
      manual page, section 1 (general commands)
      write
      manual page, section 2 (system calls)
      write writev


      And if I select the write match in the first list, $ man opens the write page in the first section of the manual.



      But if I select the write match in the second list, $ man still opens the write page in the first section, while the description of the list mentions the second section of the manual.



      Is it possible to make zsh pass the relevant manual section to the man command when the separate-sections style is set?



      I'm using zsh 5.6.2-dev-0 (x86_64-pc-linux-gnu).







      zsh





      share












      share










      share



      share










      asked 3 mins ago









      user938271

      17917




      17917

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477656%2fhow-to-make-zsh-pass-the-manual-section-to-the-man-command-when-the-separate-se%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477656%2fhow-to-make-zsh-pass-the-manual-section-to-the-man-command-when-the-separate-se%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?