typst.vim 1016 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. " Vim filetype plugin file
  2. " Language: Typst
  3. " Previous Maintainer: Gregory Anders
  4. " Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
  5. " Last Change: 2024 Dec 09
  6. " Based on: https://github.com/kaarmu/typst.vim
  7. if exists('b:did_ftplugin')
  8. finish
  9. endif
  10. let b:did_ftplugin = 1
  11. setlocal commentstring=//\ %s
  12. setlocal comments=s1:/*,mb:*,ex:*/,://
  13. setlocal formatoptions+=croqn
  14. " Numbered Lists
  15. setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
  16. " Unordered (-), Ordered (+) and definition (/) Lists
  17. setlocal formatlistpat+=\\\|^\\s*[-+/\]\\s\\+
  18. setlocal suffixesadd=.typ
  19. let b:undo_ftplugin = 'setl cms< com< fo< flp< sua<'
  20. if get(g:, 'typst_conceal', 0)
  21. setlocal conceallevel=2
  22. let b:undo_ftplugin .= ' cole<'
  23. endif
  24. if has("folding") && get(g:, 'typst_folding', 0)
  25. setlocal foldexpr=typst#foldexpr()
  26. setlocal foldmethod=expr
  27. let b:undo_ftplugin .= "|setl foldexpr< foldmethod<"
  28. endif
  29. if !exists('current_compiler')
  30. compiler typst
  31. let b:undo_ftplugin ..= "| compiler make"
  32. endif