Open man section 3
Clash 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 ?
key-bindings
add a comment |Â
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 ?
key-bindings
Wonderful suggestions: I ended up adding thisset keywordprg=man 3 -s
to my .vimrc
– stdcall
45 mins ago
add a comment |Â
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 ?
key-bindings
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
key-bindings
edited 21 mins ago
muru
16.5k641100
16.5k641100
asked 3 hours ago


stdcall
284512
284512
Wonderful suggestions: I ended up adding thisset keywordprg=man 3 -s
to my .vimrc
– stdcall
45 mins ago
add a comment |Â
Wonderful suggestions: I ended up adding thisset 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
add a comment |Â
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
).
2
Damn I was 43 seconds too late! :)
– statox♦
2 hours ago
add a comment |Â
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
add a comment |Â
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.
add a comment |Â
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
).
2
Damn I was 43 seconds too late! :)
– statox♦
2 hours ago
add a comment |Â
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
).
2
Damn I was 43 seconds too late! :)
– statox♦
2 hours ago
add a comment |Â
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
).
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
).
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered 2 hours ago


statox♦
24.8k660127
24.8k660127
add a comment |Â
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered 6 mins ago
muru
16.5k641100
16.5k641100
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Wonderful suggestions: I ended up adding this
set keywordprg=man 3 -s
to my .vimrc– stdcall
45 mins ago