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:
committed by
Christian Brabandt
parent
23079450a8
commit
f86568f918
@ -2,7 +2,7 @@
|
||||
" Language: readline(3) configuration file
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Last Change: 2023 Aug 22
|
||||
" Last Change: 2024 Sep 19 (simplify keywordprg #15696)
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@ -34,20 +34,12 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
||||
endif
|
||||
|
||||
if has('unix') && executable('less')
|
||||
if !has('gui_running')
|
||||
command -buffer -nargs=1 ReadlineKeywordPrg
|
||||
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' |
|
||||
\ redraw!
|
||||
elseif has('terminal')
|
||||
command -buffer -nargs=1 ReadlineKeywordPrg
|
||||
\ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline'
|
||||
endif
|
||||
if exists(':ReadlineKeywordPrg') == 2
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:ReadlineKeywordPrg
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg'
|
||||
endif
|
||||
if has('unix') && executable('less') && exists(':terminal') == 2
|
||||
command -buffer -nargs=1 ReadlineKeywordPrg
|
||||
\ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline'
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:ReadlineKeywordPrg
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg'
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
Reference in New Issue
Block a user