blob: 77fab2a61176d8d7c5e8a318eea7dff6bdd4f74e [file] [log] [blame]
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001" Vim filetype plugin file
Bram Moolenaar7db29e42022-12-11 15:53:04 +00002" Language: readline(3) configuration file
3" Maintainer: Doug Kearns <dougkearns@gmail.com>
4" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
Konfektf86568f2024-09-19 19:34:40 +02005" Last Change: 2024 Sep 19 (simplify keywordprg #15696)
Bram Moolenaar42eeac32005-06-29 22:40:58 +00006
7if exists("b:did_ftplugin")
8 finish
9endif
10let b:did_ftplugin = 1
11
Bram Moolenaare37d50a2008-08-06 17:06:04 +000012let s:cpo_save = &cpo
13set cpo&vim
14
Bram Moolenaar7db29e42022-12-11 15:53:04 +000015setlocal comments=:#
16setlocal commentstring=#\ %s
17setlocal formatoptions-=t formatoptions+=croql
18
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000019let b:undo_ftplugin = "setl com< cms< fo<"
Bram Moolenaar42eeac32005-06-29 22:40:58 +000020
Bram Moolenaar7db29e42022-12-11 15:53:04 +000021if exists("loaded_matchit") && !exists("b:match_words")
22 let b:match_ignorecase = 0
23 let b:match_words = '$if:$else:$endif'
24 let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
25endif
26
27if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
Doug Kearns93197fd2024-01-14 20:59:02 +010028 let b:browsefilter = "Readline Intialization Files (inputrc, .inputrc)\tinputrc;*.inputrc\n"
29 if has("win32")
30 let b:browsefilter ..= "All Files (*.*)\t*\n"
31 else
32 let b:browsefilter ..= "All Files (*)\t*\n"
33 endif
Bram Moolenaar7db29e42022-12-11 15:53:04 +000034 let b:undo_ftplugin ..= " | unlet! b:browsefilter"
35endif
Bram Moolenaare37d50a2008-08-06 17:06:04 +000036
Konfektf86568f2024-09-19 19:34:40 +020037if has('unix') && executable('less') && exists(':terminal') == 2
38 command -buffer -nargs=1 ReadlineKeywordPrg
39 \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline'
40 setlocal iskeyword+=-
41 setlocal keywordprg=:ReadlineKeywordPrg
42 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg'
Enno2f25e402023-08-23 21:27:50 +020043endif
44
Bram Moolenaare37d50a2008-08-06 17:06:04 +000045let &cpo = s:cpo_save
46unlet s:cpo_save
Bram Moolenaar7db29e42022-12-11 15:53:04 +000047
48" vim: nowrap sw=2 sts=2 ts=8 noet: