Vim Tips Wiki

EP3 Syntax File

1,624pages on
this wiki
Add New Page
Talk0 Share
Tip 1659 Printable Monobook Previous Next

created July 19, 2010 · complexity basic · author Maxslug · version 7.0

This is a syntax file for the Perl EP3 pre-processor which will render the Perl parts as Perl and the rest as Verilog.


" Vim syntax file
" Language:    EP3 (Perl/Verilog)
" Based on mason.vim, html.vim
" Clear previous syntax settings unless this is v6 or above, in which case just
" exit without doing anything.
if version < 600
  syn clear
elseif exists("b:current_syntax")

" Load perl and verilog into their own namespaces
syn include @ep3Perl    syntax/perl.vim
unlet b:current_syntax
syn include @ep3Verilog syntax/verilog.vim
unlet b:current_syntax

" Load verilog as the default syntax
runtime! syntax/verilog.vim
unlet b:current_syntax

" Add some EP3-specific syntax
syn match verilogGlobal "@include"

" TODO: How do I get the strings in a perl section to render as verilog?
"syn region ep3String   start=+"+ end=+"+ contained contains=@ep3Verilog
"hi def link perlString @ep3Verilog

syn region ep3Vline     matchgroup=Delimiter start="^@>"         end="$"         contains=@ep3Verilog
syn region ep3PerlChunk matchgroup=Delimiter start="@perl_begin" end="@perl_end" contains=@ep3Perl,ep3Vline

let b:current_syntax = "ep3"



  • Tell people how to use it.

JohnBeckett 08:21, September 20, 2010 (UTC)

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki