robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
567053bb3c
master
1" Vim filetype plugin file 2" Language: Typst 3" Maintainer: Maxim Kim <habamax@gmail.com> 4" Previous Maintainers: Gregory Anders 5" Luca Saccarola <github.e41mv@aleeas.com> 6" Last Change: 2026 Jun 29 7" Based on the ftplugin from https://github.com/kaarmu/typst.vim 8 9if exists ( "b:did_ftplugin" ) 10finish 11endif 12let b: did_ftplugin = 1 13 14setlocal commentstring = //\ %s 15setlocal comments = s1:/*,mb:*,ex:*/,:// 16setlocal formatoptions += croqn 17" Numbered Lists 18setlocal formatlistpat = ^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* 19" Unordered (-), Ordered (+) and definition (/) Lists 20setlocal formatlistpat += \\\|^\\s*[-+/\]\\s\\+ 21setlocal suffixesadd = .typ 22 23let b: undo_ftplugin = "setl cms< com< fo< flp< sua<" 24 25if get ( g:, "typst_conceal" , 0 ) 26setlocal conceallevel = 2 27let b: undo_ftplugin ..= " cole<" 28endif 29 30if get ( g:, 'typst_recommended_style' , 31 \get ( g:, 'filetype_recommended_style' , 1 )) 32setlocal expandtab 33setlocal softtabstop = 2 34setlocal shiftwidth = 2 35let b: undo_ftplugin ..= " | setl et< sts< sw<" 36endif 37 38if has ( "folding" ) && get ( g:, "typst_folding" , 0 ) 39setlocal foldexpr = typst #foldexpr() 40setlocal foldmethod = expr 41let b: undo_ftplugin ..= " | setl foldexpr< foldmethod<" 42endif 43 44if ! exists ( "current_compiler" ) 45compiler typst 46let b: undo_ftplugin ..= " | compiler make" 47endif 48 49if ( has ( "gui_win32" ) || has ( "gui_gtk" )) && ! exists ( "b:browsefilter" ) 50let b: browsefilter = "Typst Markup file (*.typ)\t*.typ\n" 51if has ( "win32" ) 52let b: browsefilter ..= "All Files (*.*)\t*\n" 53else 54let b: browsefilter ..= "All Files (*)\t*\n" 55endif 56let b: undo_ftplugin ..= " | unlet! b:browsefilter" 57endif