This repository has been archived by the owner on Jan 16, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2275 - first-class vim filetype plugin
- Loading branch information
Showing
2 changed files
with
58 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
" Vim syntax file | ||
" Language: wart | ||
" Maintainer: Kartik Agaram <wart@akkartik.com> | ||
" URL: http://github.com/akkartik/wart | ||
" License: public domain | ||
" | ||
" Copy this into your ftplugin directory, and add the following to your vimrc: | ||
" autocmd BufReadPost,BufNewFile *.wart,*.test set filetype=wart | ||
|
||
let s:save_cpo = &cpo | ||
set cpo&vim | ||
|
||
if exists("b:syntax") | ||
finish | ||
endif | ||
let b:syntax = "wart" | ||
|
||
setlocal iskeyword=@,48-57,?,!,_,$ | ||
|
||
syntax match wartComment /#.*$/ | ||
highlight link wartComment Comment | ||
|
||
syntax region wartString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell | ||
highlight link wartString String | ||
|
||
syntax match wartAtom /[^\s#"()',@]/ | ||
|
||
syntax match wartNumber "-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\([dDeEfFlL][-+]\=\d\+\)\=" | ||
highlight link wartNumber Constant | ||
|
||
syntax match wartQuote /'/ | ||
highlight link wartQuote Delimiter | ||
|
||
syntax match wartCons /\.\.\./ | ||
highlight link wartCons Delimiter | ||
|
||
syntax region wartList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@wartListCluster | ||
syntax match wartSplice /@/ | ||
highlight link wartSplice Delimiter | ||
|
||
syntax region wartBackquote matchgroup=Preproc start="`(" matchgroup=Preproc end=")" contains=@wartListCluster | ||
syntax match wartUnquote /,@\|,/ | ||
highlight link wartUnquote Preproc | ||
|
||
" deemphasize period operator | ||
syntax match wartCall /\./ | ||
highlight link wartCall Delimiter | ||
|
||
" highlight assignment | ||
syntax match wartAssign /<-/ | ||
highlight link wartAssign Special | ||
|
||
syntax match wartParenError /)/ | ||
highlight link wartParenError Error | ||
|
||
syntax cluster wartListCluster contains=wartComment,wartString,wartAtom,wartNumber,wartQuote,wartCons,wartList,wartBackquote,wartUnquote,wartSplice,wartCall | ||
|
||
let &cpo = s:save_cpo |