blob: c9f6df31d06980e9e4882572eae44fc64f7807ba [file] [log] [blame]
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001" Vim filetype plugin file
Bram Moolenaar214641f2017-03-05 17:04:09 +01002" Language: mutt RC File
3" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
Enno1e33cd72023-10-08 19:14:07 +02004" Latest Revision: 2023-10-07
Bram Moolenaar42eeac32005-06-29 22:40:58 +00005
6if exists("b:did_ftplugin")
7 finish
8endif
9let b:did_ftplugin = 1
10
Bram Moolenaare37d50a2008-08-06 17:06:04 +000011let s:cpo_save = &cpo
12set cpo&vim
13
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000014let b:undo_ftplugin = "setl com< cms< inc< fo<"
Bram Moolenaar42eeac32005-06-29 22:40:58 +000015
16setlocal comments=:# commentstring=#\ %s
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000017setlocal formatoptions-=t formatoptions+=croql
Bram Moolenaar42eeac32005-06-29 22:40:58 +000018
19let &l:include = '^\s*source\>'
Bram Moolenaare37d50a2008-08-06 17:06:04 +000020
Enno2f25e402023-08-23 21:27:50 +020021if has('unix') && executable('less')
22 if !has('gui_running')
Enno1e33cd72023-10-08 19:14:07 +020023 command -buffer -nargs=1 MuttrcKeywordPrg
Enno2f25e402023-08-23 21:27:50 +020024 \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . 'muttrc' |
25 \ redraw!
26 elseif has('terminal')
Enno1e33cd72023-10-08 19:14:07 +020027 command -buffer -nargs=1 MuttrcKeywordPrg
Enno2f25e402023-08-23 21:27:50 +020028 \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc'
29 endif
Enno1e33cd72023-10-08 19:14:07 +020030 if exists(':MuttrcKeywordPrg') == 2
Enno2f25e402023-08-23 21:27:50 +020031 setlocal iskeyword+=-
Enno1e33cd72023-10-08 19:14:07 +020032 setlocal keywordprg=:MuttrcKeywordPrg
33 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer MuttrcKeywordPrg'
Enno2f25e402023-08-23 21:27:50 +020034 endif
35endif
36
Bram Moolenaare37d50a2008-08-06 17:06:04 +000037let &cpo = s:cpo_save
38unlet s:cpo_save