2024-07-15 11:02:22 -07:00
|
|
|
" Vim filetype plugin file
|
|
|
|
" Language: Typst
|
|
|
|
" Maintainer: Gregory Anders
|
2024-12-01 14:12:20 -07:00
|
|
|
" Last Change: 2024 Dev 01
|
2024-07-15 11:02:22 -07:00
|
|
|
" Based on: https://github.com/kaarmu/typst.vim
|
2024-05-20 05:15:35 -07:00
|
|
|
|
|
|
|
if exists('b:did_ftplugin')
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let b:did_ftplugin = 1
|
|
|
|
|
|
|
|
setlocal commentstring=//\ %s
|
2024-07-15 11:02:22 -07:00
|
|
|
setlocal comments=s1:/*,mb:*,ex:*/,://
|
2024-12-01 14:12:20 -07:00
|
|
|
setlocal formatoptions+=croqn
|
|
|
|
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
|
|
|
|
setlocal formatlistpat+=\\\|^\\s*[-+\]\\s\\+
|
2024-07-15 11:02:22 -07:00
|
|
|
setlocal suffixesadd=.typ
|
|
|
|
|
2024-12-01 14:12:20 -07:00
|
|
|
let b:undo_ftplugin = 'setl cms< com< fo< flp< sua<'
|
2024-05-20 05:15:35 -07:00
|
|
|
|
2024-07-15 11:02:22 -07:00
|
|
|
if get(g:, 'typst_conceal', 0)
|
|
|
|
setlocal conceallevel=2
|
|
|
|
let b:undo_ftplugin .= ' cole<'
|
|
|
|
endif
|
2024-10-05 08:41:54 -07:00
|
|
|
|
2024-10-21 15:18:16 -07:00
|
|
|
if has("folding") && get(g:, 'typst_folding', 0)
|
|
|
|
setlocal foldexpr=typst#foldexpr()
|
|
|
|
setlocal foldmethod=expr
|
|
|
|
let b:undo_ftplugin .= "|setl foldexpr< foldmethod<"
|
|
|
|
endif
|
|
|
|
|
2024-10-05 08:41:54 -07:00
|
|
|
if !exists('current_compiler')
|
|
|
|
compiler typst
|
|
|
|
let b:undo_ftplugin ..= "| compiler make"
|
|
|
|
endif
|