blob: f5934ce2c07d8d676e94e9824294667d682cae25 [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>
Doug Kearns93197fd2024-01-14 20:59:02 +01005" Last Change: 2023 Aug 22
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
Enno2f25e402023-08-23 21:27:50 +020037if has('unix') && executable('less')
38 if !has('gui_running')
Enno1e33cd72023-10-08 19:14:07 +020039 command -buffer -nargs=1 ReadlineKeywordPrg
Enno2f25e402023-08-23 21:27:50 +020040 \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' |
41 \ redraw!
42 elseif has('terminal')
Enno1e33cd72023-10-08 19:14:07 +020043 command -buffer -nargs=1 ReadlineKeywordPrg
Enno2f25e402023-08-23 21:27:50 +020044 \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline'
45 endif
Enno1e33cd72023-10-08 19:14:07 +020046 if exists(':ReadlineKeywordPrg') == 2
Enno2f25e402023-08-23 21:27:50 +020047 setlocal iskeyword+=-
Enno1e33cd72023-10-08 19:14:07 +020048 setlocal keywordprg=:ReadlineKeywordPrg
49 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg'
Enno2f25e402023-08-23 21:27:50 +020050 endif
51endif
52
Bram Moolenaare37d50a2008-08-06 17:06:04 +000053let &cpo = s:cpo_save
54unlet s:cpo_save
Bram Moolenaar7db29e42022-12-11 15:53:04 +000055
56" vim: nowrap sw=2 sts=2 ts=8 noet: