2024-07-15 11:02:22 -07:00
|
|
|
" Vim filetype plugin file
|
|
|
|
" Language: Typst
|
2024-12-09 12:37:36 -07:00
|
|
|
" Previous Maintainer: Gregory Anders
|
|
|
|
" Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
|
|
|
|
" Last Change: 2024 Dec 09
|
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
|
2024-12-09 12:37:36 -07:00
|
|
|
" Numbered Lists
|
2024-12-01 14:12:20 -07:00
|
|
|
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
|
2024-12-09 12:37:36 -07:00
|
|
|
" Unordered (-), Ordered (+) and definition (/) Lists
|
|
|
|
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
|