[vim/vim] runtime(c): set 'keywordprg' to :Man (PR #19222)

14 views
Skip to first unread message

Mateo Gjika

unread,
Jan 20, 2026, 3:47:31 AM (3 days ago) Jan 20
to vim/vim, Subscribed

This is mostly useful for the gui since :!man in the builtin terminal is unusable. Maybe it should be done only when the gui is running? Although I think also terminal users would prefer the man.vim plugin

I also added an option to man to only search in relevant sections, for example man -s2,3 open opens the man page for the syscall instead of the user program with the same name.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19222

Commit Summary

  • f6da64b runtime(c): set 'keywordprg' to :Man

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222@github.com>

Christian Brabandt

unread,
Jan 20, 2026, 2:23:26 PM (3 days ago) Jan 20
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19222)

I don't think this makes sense. You can already use <count>K on any function to open the manpage for the identifier under the cursor (in section <count>) it. This sounds more like something for user configuration, but I don't think we should add this by default.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/c3774558185@github.com>

Maxim Kim

unread,
Jan 20, 2026, 11:33:42 PM (3 days ago) Jan 20
to vim/vim, Subscribed
habamax left a comment (vim/vim#19222)

Even if it was considered for inclusion, sourcing man.vim every time c filetype is detected is wrong.

I agree, this should be user configuration.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/c3776093803@github.com>

Mateo Gjika

unread,
Jan 21, 2026, 3:22:04 AM (2 days ago) Jan 21
to vim/vim, Subscribed
mateoxh left a comment (vim/vim#19222)

I agree with both of you, I didn't think this through.
But K is still not usable in gui, maybe a solution is sourcing man.vim somewhere else and add an autocmd in c.vim?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/c3776759507@github.com>

Mateo Gjika

unread,
Jan 22, 2026, 4:27:59 AM (yesterday) Jan 22
to vim/vim, Subscribed

Closed #19222.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/issue_event/22210826358@github.com>

Mateo Gjika

unread,
Jan 22, 2026, 5:09:48 AM (yesterday) Jan 22
to vim/vim, Subscribed

Reopened #19222.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/issue_event/22211777698@github.com>

Mateo Gjika

unread,
Jan 22, 2026, 5:11:52 AM (yesterday) Jan 22
to vim/vim, Subscribed
mateoxh left a comment (vim/vim#19222)

I opted for another approach using :term but only for the gui. I added ++close because closing the terminal window after exiting the pager was annoying, the downside is that in case of an error nothing is shown.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/c3783575600@github.com>

Mateo Gjika

unread,
Jan 22, 2026, 6:06:29 AM (yesterday) Jan 22
to vim/vim, Push

@mateoxh pushed 1 commit.

  • 8c9900f add check for terminal feature


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/before/5365b04833bc93d89d1574ea794263904ddb9f34/after/8c9900f9b6c40d887c83e6f308d675ccece6fd14@github.com>

dkearns

unread,
Jan 22, 2026, 7:21:31 AM (yesterday) Jan 22
to vim/vim, Subscribed
dkearns left a comment (vim/vim#19222)

We already have this sort of behaviour implemented in some other ftplugins. E.g.,

https://github.com/vim/vim/blob/10b272c126e906b6bab3621b162ae7faea42472a/runtime/ftplugin/sh.vim#L55-L63

The approach should probably be generalised.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/c3784104057@github.com>

Mateo Gjika

unread,
Jan 22, 2026, 7:48:54 AM (yesterday) Jan 22
to vim/vim, Subscribed
mateoxh left a comment (vim/vim#19222)

Yes, same thing for go


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/c3784224210@github.com>

Mateo Gjika

unread,
6:33 AM (5 hours ago) 6:33 AM
to vim/vim, Push

@mateoxh pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19222/before/8c9900f9b6c40d887c83e6f308d675ccece6fd14/after/323c2a2f9cf0004dcff91d7570f4a5eacc65c947@github.com>

Reply all
Reply to author
Forward
0 new messages