blob: ec365f04c273c650551db52b1253b916805900f9 [file] [log] [blame]
Bram Moolenaar0dc065e2005-07-04 22:49:24 +00001" Vim filetype plugin file
Bram Moolenaar214641f2017-03-05 17:04:09 +01002" Language: udev(8) rules file
3" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
Enno1e33cd72023-10-08 19:14:07 +02004" Latest Revision: 2023-10-07
Bram Moolenaar0dc065e2005-07-04 22:49:24 +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< fo<"
15
16setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
Bram Moolenaare37d50a2008-08-06 17:06:04 +000017
Enno2f25e402023-08-23 21:27:50 +020018if has('unix') && executable('less')
19 if !has('gui_running')
Enno1e33cd72023-10-08 19:14:07 +020020 command -buffer -nargs=1 UdevrulesKeywordPrg
Enno2f25e402023-08-23 21:27:50 +020021 \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'udev' |
22 \ redraw!
23 elseif has('terminal')
Enno1e33cd72023-10-08 19:14:07 +020024 command -buffer -nargs=1 UdevrulesKeywordPrg
Enno2f25e402023-08-23 21:27:50 +020025 \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev'
26 endif
Enno1e33cd72023-10-08 19:14:07 +020027 if exists(':UdevrulesKeywordPrg') == 2
Enno2f25e402023-08-23 21:27:50 +020028 setlocal iskeyword+=-
Enno1e33cd72023-10-08 19:14:07 +020029 setlocal keywordprg=:UdevrulesKeywordPrg
30 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer UdevrulesKeywordPrg'
Enno2f25e402023-08-23 21:27:50 +020031 endif
32endif
33
Bram Moolenaare37d50a2008-08-06 17:06:04 +000034let &cpo = s:cpo_save
35unlet s:cpo_save