Open man section 3

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











up vote
1
down vote

favorite












I'm using Vim to develop C on Linux.
When I press K in order to open man page for the underlying word, I don't have control on which man section is opened.
Is there a way to specify that somewhere ?










share|improve this question























  • Wonderful suggestions: I ended up adding this set keywordprg=man 3 -s to my .vimrc
    – stdcall
    45 mins ago















up vote
1
down vote

favorite












I'm using Vim to develop C on Linux.
When I press K in order to open man page for the underlying word, I don't have control on which man section is opened.
Is there a way to specify that somewhere ?










share|improve this question























  • Wonderful suggestions: I ended up adding this set keywordprg=man 3 -s to my .vimrc
    – stdcall
    45 mins ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm using Vim to develop C on Linux.
When I press K in order to open man page for the underlying word, I don't have control on which man section is opened.
Is there a way to specify that somewhere ?










share|improve this question















I'm using Vim to develop C on Linux.
When I press K in order to open man page for the underlying word, I don't have control on which man section is opened.
Is there a way to specify that somewhere ?







key-bindings






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 21 mins ago









muru

16.5k641100




16.5k641100










asked 3 hours ago









stdcall

284512




284512











  • Wonderful suggestions: I ended up adding this set keywordprg=man 3 -s to my .vimrc
    – stdcall
    45 mins ago

















  • Wonderful suggestions: I ended up adding this set keywordprg=man 3 -s to my .vimrc
    – stdcall
    45 mins ago
















Wonderful suggestions: I ended up adding this set keywordprg=man 3 -s to my .vimrc
– stdcall
45 mins ago





Wonderful suggestions: I ended up adding this set keywordprg=man 3 -s to my .vimrc
– stdcall
45 mins ago











3 Answers
3






active

oldest

votes

















up vote
3
down vote



accepted










Quoting from the documentation



 When 'keywordprg' is equal to "man -s", a count
before "K" is inserted after the "-s". If there is
no count, the "-s" is removed.


man -s seems to be the default for the 'keywordprg' setting, so simplying using a count before typing K seems to do the trick.



(Tested successfully with 2K and 3K and the cursor being on open).






share|improve this answer


















  • 2




    Damn I was 43 seconds too late! :)
    – statox♦
    2 hours ago

















up vote
3
down vote













From :h K:



 *K*
K Run a program to lookup the keyword under the
cursor. [...]
Special cases:
- When 'keywordprg' is equal to "man" or starts with
":", a [count] before "K" is inserted after
keywordprg and before the keyword. For example,
using "2K" while the cursor is on "mkdir", results
in:
!man 2 mkdir
- When 'keywordprg' is equal to "man -s", a count
before "K" is inserted after the "-s". If there is
no count, the "-s" is removed.


So 3K should do the trick






share|improve this answer



























    up vote
    0
    down vote













    If you're on Linux, you're likely using mandb's man, and you can control the order in which sections are searched. See man 1 man:




    MANSECT

    If $MANSECT is set, its value is a colon-delimited list of sections
    and it is used to determine which manual sections to search and in
    what order. The default is "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6
    7", unless overridden by the SECTION directive in /etc/manpath.config.




    So another option is to set in your shell initialisation files:



    MANSECT=3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7
    export MANSECT


    Or in your vimrc:



    let $MANSECT="3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7"


    (Also, depending on what you're programming, section 2 might also need a higher priority.)



    (Or, as the manpage says, set system-wide in /etc/manpath.config.)



    This also works for FreeBSD's man.





    share




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "599"
      ;
      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%2fvi.stackexchange.com%2fquestions%2f17641%2fopen-man-section-3%23new-answer', 'question_page');

      );

      Post as a guest






























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      3
      down vote



      accepted










      Quoting from the documentation



       When 'keywordprg' is equal to "man -s", a count
      before "K" is inserted after the "-s". If there is
      no count, the "-s" is removed.


      man -s seems to be the default for the 'keywordprg' setting, so simplying using a count before typing K seems to do the trick.



      (Tested successfully with 2K and 3K and the cursor being on open).






      share|improve this answer


















      • 2




        Damn I was 43 seconds too late! :)
        – statox♦
        2 hours ago














      up vote
      3
      down vote



      accepted










      Quoting from the documentation



       When 'keywordprg' is equal to "man -s", a count
      before "K" is inserted after the "-s". If there is
      no count, the "-s" is removed.


      man -s seems to be the default for the 'keywordprg' setting, so simplying using a count before typing K seems to do the trick.



      (Tested successfully with 2K and 3K and the cursor being on open).






      share|improve this answer


















      • 2




        Damn I was 43 seconds too late! :)
        – statox♦
        2 hours ago












      up vote
      3
      down vote



      accepted







      up vote
      3
      down vote



      accepted






      Quoting from the documentation



       When 'keywordprg' is equal to "man -s", a count
      before "K" is inserted after the "-s". If there is
      no count, the "-s" is removed.


      man -s seems to be the default for the 'keywordprg' setting, so simplying using a count before typing K seems to do the trick.



      (Tested successfully with 2K and 3K and the cursor being on open).






      share|improve this answer














      Quoting from the documentation



       When 'keywordprg' is equal to "man -s", a count
      before "K" is inserted after the "-s". If there is
      no count, the "-s" is removed.


      man -s seems to be the default for the 'keywordprg' setting, so simplying using a count before typing K seems to do the trick.



      (Tested successfully with 2K and 3K and the cursor being on open).







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited 2 hours ago

























      answered 2 hours ago









      Christian Brabandt

      14.3k2342




      14.3k2342







      • 2




        Damn I was 43 seconds too late! :)
        – statox♦
        2 hours ago












      • 2




        Damn I was 43 seconds too late! :)
        – statox♦
        2 hours ago







      2




      2




      Damn I was 43 seconds too late! :)
      – statox♦
      2 hours ago




      Damn I was 43 seconds too late! :)
      – statox♦
      2 hours ago










      up vote
      3
      down vote













      From :h K:



       *K*
      K Run a program to lookup the keyword under the
      cursor. [...]
      Special cases:
      - When 'keywordprg' is equal to "man" or starts with
      ":", a [count] before "K" is inserted after
      keywordprg and before the keyword. For example,
      using "2K" while the cursor is on "mkdir", results
      in:
      !man 2 mkdir
      - When 'keywordprg' is equal to "man -s", a count
      before "K" is inserted after the "-s". If there is
      no count, the "-s" is removed.


      So 3K should do the trick






      share|improve this answer
























        up vote
        3
        down vote













        From :h K:



         *K*
        K Run a program to lookup the keyword under the
        cursor. [...]
        Special cases:
        - When 'keywordprg' is equal to "man" or starts with
        ":", a [count] before "K" is inserted after
        keywordprg and before the keyword. For example,
        using "2K" while the cursor is on "mkdir", results
        in:
        !man 2 mkdir
        - When 'keywordprg' is equal to "man -s", a count
        before "K" is inserted after the "-s". If there is
        no count, the "-s" is removed.


        So 3K should do the trick






        share|improve this answer






















          up vote
          3
          down vote










          up vote
          3
          down vote









          From :h K:



           *K*
          K Run a program to lookup the keyword under the
          cursor. [...]
          Special cases:
          - When 'keywordprg' is equal to "man" or starts with
          ":", a [count] before "K" is inserted after
          keywordprg and before the keyword. For example,
          using "2K" while the cursor is on "mkdir", results
          in:
          !man 2 mkdir
          - When 'keywordprg' is equal to "man -s", a count
          before "K" is inserted after the "-s". If there is
          no count, the "-s" is removed.


          So 3K should do the trick






          share|improve this answer












          From :h K:



           *K*
          K Run a program to lookup the keyword under the
          cursor. [...]
          Special cases:
          - When 'keywordprg' is equal to "man" or starts with
          ":", a [count] before "K" is inserted after
          keywordprg and before the keyword. For example,
          using "2K" while the cursor is on "mkdir", results
          in:
          !man 2 mkdir
          - When 'keywordprg' is equal to "man -s", a count
          before "K" is inserted after the "-s". If there is
          no count, the "-s" is removed.


          So 3K should do the trick







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 hours ago









          statox♦

          24.8k660127




          24.8k660127




















              up vote
              0
              down vote













              If you're on Linux, you're likely using mandb's man, and you can control the order in which sections are searched. See man 1 man:




              MANSECT

              If $MANSECT is set, its value is a colon-delimited list of sections
              and it is used to determine which manual sections to search and in
              what order. The default is "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6
              7", unless overridden by the SECTION directive in /etc/manpath.config.




              So another option is to set in your shell initialisation files:



              MANSECT=3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7
              export MANSECT


              Or in your vimrc:



              let $MANSECT="3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7"


              (Also, depending on what you're programming, section 2 might also need a higher priority.)



              (Or, as the manpage says, set system-wide in /etc/manpath.config.)



              This also works for FreeBSD's man.





              share
























                up vote
                0
                down vote













                If you're on Linux, you're likely using mandb's man, and you can control the order in which sections are searched. See man 1 man:




                MANSECT

                If $MANSECT is set, its value is a colon-delimited list of sections
                and it is used to determine which manual sections to search and in
                what order. The default is "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6
                7", unless overridden by the SECTION directive in /etc/manpath.config.




                So another option is to set in your shell initialisation files:



                MANSECT=3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7
                export MANSECT


                Or in your vimrc:



                let $MANSECT="3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7"


                (Also, depending on what you're programming, section 2 might also need a higher priority.)



                (Or, as the manpage says, set system-wide in /etc/manpath.config.)



                This also works for FreeBSD's man.





                share






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  If you're on Linux, you're likely using mandb's man, and you can control the order in which sections are searched. See man 1 man:




                  MANSECT

                  If $MANSECT is set, its value is a colon-delimited list of sections
                  and it is used to determine which manual sections to search and in
                  what order. The default is "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6
                  7", unless overridden by the SECTION directive in /etc/manpath.config.




                  So another option is to set in your shell initialisation files:



                  MANSECT=3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7
                  export MANSECT


                  Or in your vimrc:



                  let $MANSECT="3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7"


                  (Also, depending on what you're programming, section 2 might also need a higher priority.)



                  (Or, as the manpage says, set system-wide in /etc/manpath.config.)



                  This also works for FreeBSD's man.





                  share












                  If you're on Linux, you're likely using mandb's man, and you can control the order in which sections are searched. See man 1 man:




                  MANSECT

                  If $MANSECT is set, its value is a colon-delimited list of sections
                  and it is used to determine which manual sections to search and in
                  what order. The default is "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6
                  7", unless overridden by the SECTION directive in /etc/manpath.config.




                  So another option is to set in your shell initialisation files:



                  MANSECT=3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7
                  export MANSECT


                  Or in your vimrc:



                  let $MANSECT="3:3posix:3pm:3perl:3am:1:n:l:8:2:5:4:9:6:7"


                  (Also, depending on what you're programming, section 2 might also need a higher priority.)



                  (Or, as the manpage says, set system-wide in /etc/manpath.config.)



                  This also works for FreeBSD's man.






                  share











                  share


                  share










                  answered 6 mins ago









                  muru

                  16.5k641100




                  16.5k641100



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17641%2fopen-man-section-3%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      List of Gilmore Girls characters

                      Confectionery