Ive got file that uses java code blocks, Is it possible to tell vim in syntax file to import java.vim syntax file for a whole region ?
Example:
syn region javaCode start="<Java>" end="</Java>"
hi link javaCode source ????
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest is to just
and focus on the Java part. However, if you want to overlay the Java syntax in your own syntax file,
:syntax regionis the way to go.:help :syn-includehas the details:PS: Since the command is complex (but that’s okay in syntax scripts that include another syntax) and hard to remember, I’ve written the SyntaxRange plugin to make setting up such regions easier. For your example, it’d be this call:
The plugin is meant for occasional, ad-hoc use. If you write your own syntax script, I’d avoid this dependency and directly use the syntax commands from above.