nsis.vim 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. " Vim ftplugin file
  2. " Language: NSIS script
  3. " Maintainer: Ken Takata
  4. " URL: https://github.com/k-takata/vim-nsis
  5. " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
  6. " Last Change: 2018-01-26
  7. if exists("b:did_ftplugin")
  8. finish
  9. endif
  10. let s:cpo_save = &cpo
  11. set cpo&vim
  12. let b:did_ftplugin = 1
  13. let b:undo_ftplugin = "setl com< cms< fo< def< inc<"
  14. \ " | unlet! b:match_ignorecase b:match_words"
  15. setlocal comments=s1:/*,mb:*,ex:*/,b:#,:; commentstring=;\ %s
  16. setlocal formatoptions-=t formatoptions+=croql
  17. setlocal define=^\\s*!define\\%(\\%(utc\\)\\=date\\|math\\)\\=
  18. setlocal include=^\\s*!include\\%(/NONFATAL\\)\\=
  19. if exists("loaded_matchit")
  20. let b:match_ignorecase = 1
  21. let b:match_words =
  22. \ '\${\%(If\|IfNot\|Unless\)}:\${\%(Else\|ElseIf\|ElseIfNot\|ElseUnless\)}:\${\%(EndIf\|EndUnless\)},' .
  23. \ '\${Select}:\${EndSelect},' .
  24. \ '\${Switch}:\${EndSwitch},' .
  25. \ '\${\%(Do\|DoWhile\|DoUntil\)}:\${\%(Loop\|LoopWhile\|LoopUntil\)},' .
  26. \ '\${\%(For\|ForEach\)}:\${Next},' .
  27. \ '\<Function\>:\<FunctionEnd\>,' .
  28. \ '\<Section\>:\<SectionEnd\>,' .
  29. \ '\<SectionGroup\>:\<SectionGroupEnd\>,' .
  30. \ '\<PageEx\>:\<PageExEnd\>,' .
  31. \ '\${MementoSection}:\${MementoSectionEnd},' .
  32. \ '!if\%(\%(macro\)\?n\?def\)\?\>:!else\>:!endif\>,' .
  33. \ '!macro\>:!macroend\>'
  34. endif
  35. let &cpo = s:cpo_save
  36. unlet s:cpo_save