diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
commit | 931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch) | |
tree | d8c1843a95da5ea0bb4acc09f7e37843d9995c86 /runtime/ftplugin/sh.vim | |
parent | 142d9041391780ac15b89886a54015fdc5c73995 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-userreg.tar.gz rneovim-userreg.tar.bz2 rneovim-userreg.zip |
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'runtime/ftplugin/sh.vim')
-rw-r--r-- | runtime/ftplugin/sh.vim | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index b6fdb8f3e2..c1a6bc5ade 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -2,15 +2,15 @@ " Language: sh " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Dan Sharp -" Last Change: 2022 Sep 07 +" Contributor: Enno Nagel <ennonagel+vim@gmail.com> +" Eisuke Kawashima +" Last Change: 2023 Sep 28 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -" Make sure the continuation lines below do not cause problems in -" compatibility mode. let s:save_cpo = &cpo set cpo-=C @@ -32,16 +32,26 @@ if exists("loaded_matchit") && !exists("b:match_words") let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" endif -" Change the :browse e filter to primarily show shell-related files. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Bourne Shell Scripts (*.sh)\t*.sh\n" .. - \ "Korn Shell Scripts (*.ksh)\t*.ksh\n" .. - \ "Bash Shell Scripts (*.bash)\t*.bash\n" .. - \ "All Files (*.*)\t*.*\n" + let b:browsefilter = "Bourne Shell Scripts (*.sh)\t*.sh\n" .. + \ "Korn Shell Scripts (*.ksh)\t*.ksh\n" .. + \ "Bash Shell Scripts (*.bash)\t*.bash\n" .. + \ "All Files (*.*)\t*.*\n" let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif -" Restore the saved compatibility options. +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 || man "<args>"; } | LESS= less"' | redraw! + elseif has("terminal") + 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 || man "<args>"') + endif + setlocal keywordprg=:ShKeywordPrg + let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer ShKeywordPrg" +endif + let &cpo = s:save_cpo unlet s:save_cpo |