From aab818bf420170e7e760d3afe4e657fa4eacd8b4 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 24 Jul 2020 16:54:21 -0400 Subject: Add Vim keymap, syntax highlighting, and some other basic settings --- editors/vim/syntax/bqn.vim | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 editors/vim/syntax/bqn.vim (limited to 'editors/vim/syntax') diff --git a/editors/vim/syntax/bqn.vim b/editors/vim/syntax/bqn.vim new file mode 100644 index 00000000..cbd71386 --- /dev/null +++ b/editors/vim/syntax/bqn.vim @@ -0,0 +1,50 @@ +if exists('b:current_syntax') + finish +endif + +syn match bqnerr "[^ \r\n]" +syn match bqnblk "[{}]" +syn match bqnlst "[⟨⟩\[\]‿]" +syn match bqnpar "[()]" +syn match bqnhed "[:;]" +syn match bqnsep "[⋄,]" +syn match bqnarw "[←↩→]" +syn match bqnchr "'.'" +syn match bqn1md "[˜˘¨⌜⁼´˝`]" +syn match bqn2md "[∘○⊸⟜⌾⊘◶⎉⚇⍟⎊]" +syn match bqnfun "[𝔽𝔾𝕎𝕏𝕊+\-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!⍕⍎]" +syn match bqnsub "[𝕗𝕘𝕨𝕩𝕤]" +syn match bqnnot "·" +syn match bqnnum "\v\c¯?((\d+\.)?\d+(e¯?\d+)?|π|∞)(i¯?((\d+\.)?\d+(e¯?\d+)?|π|∞))?" +syn match bqnsid "\(•\|•\?[a-z][A-Z_a-z0-9]*\|𝕣\)" +syn match bqnfid "•\?[A-Z][A-Z_a-z0-9]*" +syn match bqn1id "\(•\?_[A-Za-z][A-Z_a-z0-9]*\|_𝕣\)" +syn match bqn2id "\(•\?_[A-Za-z][A-Z_a-z0-9]*_\|_𝕣_\)" +syn match bqncom "#.*$" +syn match bqnquo /""/ contained +syn region bqnstr matchgroup=bqnstr start=/"/ end=/"/ contains=bqnquo +syn sync fromstart + +hi link bqnerr error +hi link bqncom comment +hi link bqnblk special +hi link bqnhed delimiter +hi link bqnpar delimiter +hi link bqnlst preproc +hi link bqnsep preproc +hi link bqnarw normal +hi link bqnchr string +hi link bqnstr string +hi link bqnquo specialchar +hi link bqnnum number +hi link bqnnot constant +hi link bqnsub normal +hi link bqnsid normal +hi link bqnfun type +hi link bqnfid type +hi link bqn1md macro +hi link bqn1id macro +hi link bqn2md operator +hi link bqn2id operator + +let b:current_syntax='bqn' -- cgit v1.2.3