File: tmt.vim

package info (click to toggle)
libtext-microtemplate-perl 0.24-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 296 kB
  • sloc: perl: 1,725; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
" Vim syntax file
" Language: tmt
" Maintainer: Kan Fushihara
" Installation:
" To automatilcally load this file when a .mt file is opened, add the
" following lines to ~/.vim/ftdetect/mt.vim
"
" autocmd! BufReadPost *.mt setfiletype tmt
"
" You will have to restart vim for this to take effect. In any case it
" is a good idea to read ":he new-filetype" so that you know what is going
" on, and why the above lines work.
 
if version < 600
    syntax clear
elseif exists("b:current_syntax")
    finish
endif
 
"Put the perl syntax file in @perlTop
syntax include @perlTop syntax/perl.vim
 
syntax cluster tmtRegions contains=tmtOneLiner,tmtBlock,tmtExpression

syntax region tmtOneLiner matchgroup=tmtDelim start=#^[%?]?\@!# end=#$# keepend contains=@perlTop containedin=ALLBUT,@tmtRegions keepend oneline
syntax region tmtBlock matchgroup=tmtDelim start=#<[%?]?\?# end=#[%?]># keepend contains=@perlTop containedin=ALLBUT,@tmtRegions keepend
syntax region tmtExpression matchgroup=tmtDelim start=#<[%?]=\?# end=#[%?]># keepend contains=@perlTop containedin=ALLBUT,@tmtRegions keepend
 
highlight def link tmtDelim Delimiter
 
let b:current_syntax = 'tmt'