modconf.vim 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. " Vim filetype plugin file
  2. " Language: modules.conf(5) configuration file
  3. " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
  4. " Latest Revision: 2023-10-07
  5. if exists("b:did_ftplugin")
  6. finish
  7. endif
  8. let b:did_ftplugin = 1
  9. let s:cpo_save = &cpo
  10. set cpo&vim
  11. let b:undo_ftplugin = "setl com< cms< inc< fo<"
  12. setlocal comments=:# commentstring=#\ %s include=^\\s*include
  13. setlocal formatoptions-=t formatoptions+=croql
  14. if has('unix') && executable('less')
  15. if !has('gui_running')
  16. command -buffer -nargs=1 ModconfKeywordPrg
  17. \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'modprobe.d' |
  18. \ redraw!
  19. elseif has('terminal')
  20. command -buffer -nargs=1 ModconfKeywordPrg
  21. \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d'
  22. endif
  23. if exists(':ModconfKeywordPrg') == 2
  24. setlocal iskeyword+=-
  25. setlocal keywordprg=:ModconfKeywordPrg
  26. let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ModconfKeywordPrg'
  27. endif
  28. endif
  29. let &cpo = s:cpo_save
  30. unlet s:cpo_save