BracketHighlighter
BracketHighlighter copied to clipboard
Highlighting the beginning and end .twig
Hi, I have a problem that I can't solve due to the fact that I don't know how to defeat it, I use BracketHighlighter in Sublime text 4154, and I can't figure out how to make the BracketHighlighter plugin highlight the beginning and end in the template.twig, please tell me how to fix it.
Screenshot:https://prnt.sc/bbNKsyB8k0Xc
You likely need to create a new rule, maybe even a BH plugin, but I don't know as I don't use Twig. You would have to provide some copy/pastable example and point me at the actual syntax file you use to highlight Twig. When I have some time, I may be able to give you some pointers to lead you in the right direction.
Вероятно, вам потребуется создать новое правило, возможно, даже плагин BH, но я не знаю, поскольку не использую Twig. Вам нужно будет предоставить пример копирования/вставки и указать мне фактический файл синтаксиса, который вы используете для выделения Twig. Когда у меня будет немного времени, я, возможно, смогу дать вам несколько советов, которые поведут вас в правильном направлении.
Thanks a lot for the answer, I provide data from the weaving settings of your plugin
Bracket Setting
{
"content_highlight_bar": true,
"search_in_widgets": true,
"match_only_adjacent": true,
"high_visibility_color": "__bracket__",
"auto_selection_threshold": 10,
}
Tag Setting
{
"tag_mode": [
{"mode": "xml", "syntax": ["XML"]},
{
"mode": "xhtml",
"syntax": [
"HTML",
"HTML 5",
"PHP",
"HTML (Jinja Templates)",
"HTML (Jinja2)",
"HTML (Rails)",
"HTML (Twig)",
"HTML (Django)",
"laravel-blade",
"blade",
"Handlebars",
"AngularJS",
"Java Server Pages (JSP)"
],
"first_line": "^[ \\t]*<\\?xml"
},
{
"mode": "html",
"syntax": [
"HTML",
"HTML 5",
"PHP",
"HTML (Jinja Templates)",
"HTML (Jinja2)",
"HTML (Rails)",
"HTML (Twig)",
"HTML (Django)",
"laravel-blade",
"blade",
"Handlebars",
"AngularJS",
"Java Server Pages (JSP)"
]
},
{
"mode": "cfml",
"syntax": ["CFML", "HTML+CFML", "ColdFusion", "ColdFusionCFC"]
}
],
"user_brackets": [
// Angle
{
"name": "angle",
"language_list": [
"HTML", "HTML 5", "XML", "PHP", "HTML (Rails)",
"HTML (Jinja Templates)", "HTML (Jinja2)", "HTML (Twig)",
"CFML", "HTML+CFML", "ColdFusion", "ColdFusionCFC",
"laravel-blade", "Handlebars", "AngularJS",
"SomeNewLanguage" // <--- New language
]
}
],
"tag_style": {
"xml": "tag",
"xhtml": "tag",
"html": "tag",
"cfml": "tag"
},
"start_tag": {
"xml": "<(%(tag_name)s)(?:(?:\\s+|(?<=['\"]))%(attributes)s)*\\s*(/?)>",
"xhtml": "<(%(tag_name)s)(?:(?:\\s+|(?<=['\"]))%(attributes)s)*\\s*(/?)>",
"html": "<(%(tag_name)s)(?:(?:\\s+|(?<=['\"]))%(attributes)s)*\\s*(/?)>",
"cfml": "<(%(tag_name)s)(?:(?:(?:\\s+|(?<=['\"]))%(attributes)s)*|(?:(?<=cfif)|(?<=cfelseif))[^>]+)\\s*(/?)>"
},
// Regex for end/closing tag. Only use a capturing group for name.
"end_tag": {
"xml": "</([\\w\\:\\.\\-]+)[^>]*>",
"xhtml": "</([\\w\\:\\.\\-]+)[^>]*>",
"html": "</([\\w\\:\\.\\-]+)[^>]*>",
"cfml": "</([\\w\\:\\.\\-]+)[^>]*>"
}
}
Sublime Setting
{
"theme": "Default Dark.sublime-theme",
"ignored_packages":
[
"Vintage",
],
"color_scheme": "Packages/Color Scheme - Legacy/Monokai Bright.tmTheme",
"open_files_in_new_window": "false",
"font_size": 13,
"tab_size": 2,
"word_wrap": "true",
}
HTML (twig) syntax specific
{
"show_line_endings": true,
}
{
"show_line_endings": true,
}
If I didn't provide the data you need, I'm sorry.
Are you using a 3rd party twig package for syntax highlighting or are you using a built-in syntax? Please specify exactly what you are using to syntax highlight Twig.
Also, provide me some copy/pastable Twig code as I am not familiar with Twig and do not want to hunt down an example online.
Используете ли вы сторонний пакет twig для подсветки синтаксиса или используете встроенный синтаксис? Пожалуйста, укажите, что именно вы используете для подсветки синтаксиса Twig.
Кроме того, предоставьте мне код Twig для копирования и вставки, поскольку я не знаком с Twig и не хочу искать пример в Интернете.
1.I use BetterTwig for highlighting. 2.Excuse me, but I don't understand this --> "give me the Twig code to copy and paste" where can I see it ? ))
Provide an example Twig snippet that I can use for testing that doesn't require me to transcribe it from a screenshot. I don't write Twig, so you need to provide me with an example snippet.
Предоставьте пример фрагмента Twig, который я могу использовать для тестирования, и который не требует от меня расшифровки его со снимка экрана. Я не пишу Twig, поэтому вам нужно предоставить мне пример фрагмента.
here is the twig code for an example
<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body>
<ul id="navigation">
{% for item %}
<li><a href="{{ item.href }}">{{ item.caption }}</a></li>
{% endfor %}
</ul>
<ul id="navigation2">
{% if item %}
<li><a href="{{ item.href }}">{{ item.caption }}</a></li>
{% endif %}
</ul>
<h1>st</h1>
{{ a_variable }}
</body>
</html>
Okay, when I have some time, I'll take a look.
Хорошо, когда будет время, я посмотрю.
Thank you very much