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