yaml.vim 912 B

123456789101112131415161718192021222324252627282930313233343536
  1. " Vim filetype plugin file
  2. " Language: YAML (YAML Ain't Markup Language)
  3. " Previous Maintainer: Nikolai Weibull <now@bitwi.se> (inactive)
  4. " Last Change: 2024 Oct 04
  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< et< fo<"
  12. setlocal comments=:# commentstring=#\ %s expandtab
  13. setlocal formatoptions-=t formatoptions+=croql
  14. " rime input method engine uses `*.custom.yaml` as its config files
  15. if expand('%:r:e') ==# 'custom'
  16. if !exists('current_compiler')
  17. compiler rime_deployer
  18. let b:undo_ftplugin ..= "| compiler make"
  19. endif
  20. setlocal include=__include:\\s*
  21. let b:undo_ftplugin ..= " inc<"
  22. endif
  23. if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0
  24. let b:undo_ftplugin ..= " sw< sts<"
  25. setlocal shiftwidth=2 softtabstop=2
  26. endif
  27. let &cpo = s:cpo_save
  28. unlet s:cpo_save