udevrules.vim 942 B

1234567891011121314151617181920212223242526272829
  1. " Vim filetype plugin file
  2. " Language: udev(8) rules file
  3. " Maintainer: This runtime file is looking for a new maintainer.
  4. " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
  5. " Latest Revision: 2024-09-19 (simplify keywordprg #15696)
  6. if exists("b:did_ftplugin")
  7. finish
  8. endif
  9. let b:did_ftplugin = 1
  10. let s:cpo_save = &cpo
  11. set cpo&vim
  12. let b:undo_ftplugin = "setl com< cms< fo<"
  13. setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
  14. if has('unix') && executable('less') && exists(':terminal') == 2
  15. command -buffer -nargs=1 UdevrulesKeywordPrg
  16. \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev'
  17. setlocal iskeyword+=-
  18. setlocal keywordprg=:UdevrulesKeywordPrg
  19. let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer UdevrulesKeywordPrg'
  20. endif
  21. let &cpo = s:cpo_save
  22. unlet s:cpo_save