runtime(c): set 'keywordprg' to :CKeywordPrg in a GUI
Commit:
https://github.com/vim/vim/commit/ca6726285ca5ca0442c23a5c0bfeeedf0386b26c
Author: Mateo Gjika <[email protected]>
Date: Mon Jan 26 18:45:18 2026 +0000
runtime(c): set 'keywordprg' to :CKeywordPrg in a GUI
closes: https://github.com/vim/vim/issues/19222
Signed-off-by: Mateo Gjika <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim
index 42a435f1d..2793c5d46 100644
--- a/runtime/ftplugin/c.vim
+++ b/runtime/ftplugin/c.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: C
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Aug 08
+" Last Change: 2026 Jan 26
" Former Maintainer: Bram Moolenaar <[email protected]>
" Only do this when not done yet for this buffer
@@ -40,6 +40,23 @@ if has("vms")
setlocal iskeyword+=$
endif
+" Use terminal window for gui
+if has('gui_running') && exists(':terminal') == 2
+ setlocal keywordprg=:CKeywordPrg
+
+ command! -buffer -nargs=1 -count CKeywordPrg call s:CKeywordPrg(<q-args>,
<count>)
+
+ function! s:CKeywordPrg(arg, count) abort
+ if a:count > 0
+ exe printf('term ++close man -s %d %s', a:count, a:arg)
+ else
+ exe printf('term ++close man %s', a:arg)
+ endif
+ endfunction
+
+ let b:undo_ftplugin .= ' | setl kp< | sil! delc -buffer CKeywordPrg'
+endif
+
" When the matchit plugin is loaded, this makes the % command skip parens and
" braces in comments properly.
if !exists("b:match_words")
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vkRoh-00FC3F-QD%40256bit.org.