From 11162888713dfbec6509c6c460c99f396f474ef0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 6 Jun 2021 15:09:32 -0700 Subject: hacky Vim syntax highlighting for Mu Lisp --- editor/mulisp.vim | 33 +++++++++++++++++++++++++++++++++ vimrc.vim | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 editor/mulisp.vim diff --git a/editor/mulisp.vim b/editor/mulisp.vim new file mode 100644 index 00000000..0f57cc90 --- /dev/null +++ b/editor/mulisp.vim @@ -0,0 +1,33 @@ +" Vim syntax file +" Language: Mu Lisp +" Maintainer: Kartik Agaram +" URL: http://github.com/akkartik/mu +" License: public domain +" +" Copy this file into your ftplugin directory, and add the following to your +" vimrc or to .vim/ftdetect/mulisp.vim: +" autocmd BufReadPost,BufNewFile *.limg set filetype=mulisp + +let s:save_cpo = &cpo +set cpo&vim + +setlocal iskeyword=@,48-57,?,!,_,$ + +" Hack: I define new syntax groups here, and I don't know how to distribute +" colorscheme-independent color suggestions for them. +highlight Normal ctermfg=245 +highlight MuLispNormal ctermfg=0 +highlight muLispKeyword ctermfg=2 + +syntax region String start=+"+ skip=+\\"+ end=+"+ + +syntax region muLispNormal matchgroup=Normal start=/\[/ end=/\]/ contains=muLispLiteral,muLispComment,muLispDelimiter + +syntax match muLispComment /#.*/ contained | highlight link muLispComment Comment +syntax match muLispLiteral /\<[0-9]\+\>/ contained | highlight link muLispLiteral Constant +syntax match muLispLiteral /\[[^\]]*\]/ contained +syntax match muLispDelimiter /[(),@`]/ contained | highlight link muLispDelimiter Delimiter + +syntax keyword muLispKeyword globals sandbox + +let &cpo = s:save_cpo diff --git a/vimrc.vim b/vimrc.vim index b8b17a8c..73ece60c 100644 --- a/vimrc.vim +++ b/vimrc.vim @@ -97,4 +97,4 @@ inoremap o Fa(offset A) inoremap ,- <- inoremap -. -> -autocmd BufReadPost,BufNewFile *.limg call matchadd('String', '\[\([^\]]*\_$\_s\)*[^\]]*\]') +autocmd BufReadPost,BufNewFile *.limg set filetype=mulisp |call matchadd('String', '\[\([^\]]*\_$\_s\)*[^\]]*\]') -- cgit 1.4.1-2-gfad0 e16b50c12'/>
blob: c31efc0f0f5bee2da4ea8f31d7ea3167ff3a6d01 (plain) (tree)
1
2
3
4
5
6
7