runtime(misc): simplify keywordprg in various ftplugins

closes: #15696

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Konfekt
2024-09-19 19:34:40 +02:00
committed by Christian Brabandt
parent 23079450a8
commit f86568f918
11 changed files with 85 additions and 151 deletions

View File

@ -45,9 +45,7 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
endif
if get(b:, "is_bash", 0)
if !has("gui_running") && executable("less")
command! -buffer -nargs=1 ShKeywordPrg silent exe '!bash -c "{ help "<args>" 2>/dev/null || MANPAGER= man "<args>"; } | LESS= less"' | redraw!
elseif has("terminal")
if exists(':terminal') == 2
command! -buffer -nargs=1 ShKeywordPrg silent exe ':term bash -c "help "<args>" 2>/dev/null || man "<args>""'
else
command! -buffer -nargs=1 ShKeywordPrg echo system('bash -c "help <args>" 2>/dev/null || MANPAGER= man "<args>"')