summaryrefslogtreecommitdiff
path: root/mnv/runtime/ftplugin/typst.mnv
diff options
context:
space:
mode:
Diffstat (limited to 'mnv/runtime/ftplugin/typst.mnv')
-rw-r--r--mnv/runtime/ftplugin/typst.mnv39
1 files changed, 39 insertions, 0 deletions
diff --git a/mnv/runtime/ftplugin/typst.mnv b/mnv/runtime/ftplugin/typst.mnv
new file mode 100644
index 0000000000..56044f5d05
--- /dev/null
+++ b/mnv/runtime/ftplugin/typst.mnv
@@ -0,0 +1,39 @@
+" MNV filetype plugin file
+" Language: Typst
+" Previous Maintainer: Gregory Anders
+" Luca Saccarola <github.e41mv@aleeas.com>
+" Maintainer: This runtime file is looking for a new maintainer.
+" Last Change: 2025 Aug 05
+" Based on: https://github.com/kaarmu/typst.mnv
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal commentstring=//\ %s
+setlocal comments=s1:/*,mb:*,ex:*/,://
+setlocal formatoptions+=croqn
+" Numbered Lists
+setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
+" Unordered (-), Ordered (+) and definition (/) Lists
+setlocal formatlistpat+=\\\|^\\s*[-+/\]\\s\\+
+setlocal suffixesadd=.typ
+
+let b:undo_ftplugin = 'setl cms< com< fo< flp< sua<'
+
+if get(g:, 'typst_conceal', 0)
+ setlocal conceallevel=2
+ let b:undo_ftplugin .= ' cole<'
+endif
+
+if has("folding") && get(g:, 'typst_folding', 0)
+ setlocal foldexpr=typst#foldexpr()
+ setlocal foldmethod=expr
+ let b:undo_ftplugin .= "|setl foldexpr< foldmethod<"
+endif
+
+if !exists('current_compiler')
+ compiler typst
+ let b:undo_ftplugin ..= "| compiler make"
+endif