uhnomoli / php-twig.tmbundle Goto Github PK
View Code? Open in Web Editor NEWA TextMate (and Sublime Text) bundle for Twig.
License: Other
A TextMate (and Sublime Text) bundle for Twig.
License: Other
I think that nav
, section
, and article
should be added to the meta.tag.block.any.html
scope.
The PHP-twig bundle is making the PHP bundle not style the *.php files.
PHP Bundle https://github.com/textmate/php.tmbundle
Really struggling to write a sensical title for this one! Perhaps a gif will help better 😅
<div class="thing-to-do">
{{ something }}
{{ title }}
</div>
<div class="thing-to-do">
{{ something }
{{ title }}
}
</div>
It seems to only do it on the first occurrence of trying to insert a new {{ }}
before an existing one. Multiple lines works fine. Any ideas? Thanks!
tag-print.tmSnippet
<key>tabTrigger</key>
<string>}}</string>
This is not working for me, no autocomplete nor hint
Sublime Text 3.1.1. Build 3176
I've tried using this tmbundle with textmate and it complained about a missing/corrupted info.plist.
Is there a list of shortcuts for functions, variables, comments etc?
Type {% b
and a dropdown to autocomplete 'block' will show up. But when I press tab, instead of autocompleting it inserts the entire block inside what I already typed, so I end up with
{% {% block name %}{% endblock %}}
In other words, it only replaced the b
and not the existing parts of the tag.
Doesn't happen with HTML auto complete - when you type <div
then tab, it completes the div tag and doesn't add extra <
Using Sublime Text 3 build 3126 (latest stable version).
The correct Comment Syntax is:
{# #}
When currently adding a comment , html Comments are inserted:
<!-- -->
If u have a for loop inside the script tag it will break the highlighting. Try it in sublime.
Example:
<script type="text/template">
{#Twig code here #}
</script>
I installed this plugin. Now when using the default keyboard shortcut (super+alt+forward_slash) to toggle a comment, the output always returns as {# … #}
instead of <!-- … -->
regardless of if the file type is HTML, PHP or TWIG.
So, I removed this package, and the HTML comments still output as {# … #}
.
How do I get back my HTML (<!-- … -->
) comments back?
Hi there,
could you widden the scope of to apply to .html/.htm files too?
The reason is that I use .html named files as views instead of the default .twig
Maybe create some settings for this so the users can change it according to their needs.
Greetz
Zewa
Hi,
When open atom with PHP-Twig appear this alert message:
Failed to load snippets from '/Users/polalegria/.atom/packages/language-twig/snippets/PHP-twig.cson'
/Users/polalegria/.atom/packages/language-twig/snippets/PHP-twig.cson: Duplicate key 'include'
Any suggestions?
Thanks in advance.
I'm not sure if it's an issue with syntax doc or sublime itself. When you use statement like
{% if foo is bar %}
Hello!
{% endif %}
Intendation makes sense. But, when using statements which don't have closing tag, like
{% do 'that' %}
{# or #}
{% form_theme form '::anything.html.twig' %}
Next lines are waiting for closing tag which doesn't exist, and are unnecessarily indented. Similar story with comments
When I type {
it always autocompletes with }
. But when I type {%
I'd expect an extra %
to be inserted, in order to close the block. Instead I end up with {%}
and have to type that extra %
.
Using Sublime Text 3 build 3126 (latest stable version).
Since 3326f2b you dropped the extras from this package. I was a big fan of Erebus Light and even the standalone repository seems to be gone.
Is there any specific reason?
Can I start a new repository with this theme (according credit to you of course)? Or maybe you can bring back standalone repositories?
I do not know how to change syntax. Can you ensure that the indentation is respected automatically ?
Example :
{% if condition %} {% for key, val in array %} {{ val }} {% endfor %} {% else %} {{ my_other_value }} {% endif %}
Is it possible to adapt the code to add a closing % and # when following a bracket?
ie. when you type the first curly brace { you auto get a closing brace {}
when you add a % or # afterwards is it possible to double these up too ? (leaving the cursor in between)
I have a user-defined twig extension that I'd like to be recognised as a twig filter in Sublime. I want to add it to the content of the string element in twig-filters-warg-ud, as per the below xml. Is that what you intended? If so, where do I put it in that string, exactly? I've tried a few ways but I can't get it to work (I am restarting Sublime after making changes), and it doesn't seem to work quite like the same string in the twig-filters-warg section.
<!-- FILTERS (w/ arguments & user-defined) -->
<key>twig-filters-warg-ud</key>
<dict>
<key>begin</key>
<string>(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\'\"]\|)|\{%\sfilter\s)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(\()</string>
Thanks
It would be great if you added this package to Package Control for Sublime. This would make installing and upgrading it a breeze. Instructions on how to do this are at http://wbond.net/sublime_packages/package_control/package_developers
Thanks for all of your hard work!
Not sure where else to ask this - can't seem to find anything in The Google. I'm using with Drupal 8 theme files - the filename is *.theme and it looks like only HTML is getting recognized. I'm guessing this might just be a Textmate configuration problem - if so, I apologize for muddying the waters here. When I open *.twig files from other parts of the theme, the syntax highlighting works the way I would expect. I've checked file format, and I've got HTML (Twig) selected for the *.theme file.
I found this bundle in Textmates GetBundles and wanted to give it a test ride.
Installation fails, says info.plist is corrupt or missing.
Hi,
since last update where you replaced blockb
with block.
, ifb
with if.
for twig multiline blocks, if one has Emmet extension installed, there is a conflict between both plugins in text expansion, and Emmet takes priority, which makes block.
expand to <block class=""></block>
.
Hi,
I'm having an indentation issue on {% set foo = bar %} :
{% if patient.fin > date() %}
{% set enCours = true %}
{% else %}
{% set enCours = false %}
{% endif %}
I guess the correct indent would be :
{% if patient.fin > date() %}
{% set enCours = true %}
{% else %}
{% set enCours = false %}
{% endif %}
Would it be possible to add support for trans
blocks. See: http://twig.sensiolabs.org/doc/extensions/i18n.html
Often, we use foot marks instead of true quote marks when we're writing a contraction in a sentence. Inside of a trans
tag (for example), this causes the highlighting to break. See screenshot:
This makes the visual diff comparison in a pull request quite difficult to parse. Would love to be able to get this fixed!
I am a twig user, I was very happy to see this package first time. But after installation I didn't understand how to use this package. Expecting instructions or usages section in the readme file. When I installed first time this package, I was confused about how to use this package actually. I think a readme file will make this package more sensible and more easy to use. Thank you.
Hello, Mr. Fricke - though not an issue (was not aware of another way to ask in this forum), would you please confirm that PHP-Twig.tmbundle is licensed under BSD? Thank you in advance!
I copied all files into the PHP-Twig folder, restarted sublime text editor (version 2.0.2, Build 2221), still now syntax highlight.
Ace editor is an excellent JS-based code editor that has a lot in common with Sublime Text and TextMate. It is possible to port TM themes to Ace but they require significant work to finish compatibility. They have a converter that basically fixes obvious syntax differences. But otherwise you have a bunch of work to do to check that it was converted correctly and fix the things the converter didn't know how to handle.
I don't really know enough about creating a syntax highlighter. I'm interested and I've [barely] started to see what's involved. But since I'd be starting with the language file from this repo, I figured I'd pass it along.
http://ace.ajax.org/#nav=higlighter (search for "Using the TMLanguage Tool")
It's a long shot, but it would be amazing if you could port your twig bundle to be compatible with Ace editor. Having access to a full-featured code editor in the browser is really key for applications, like a CMS, that require developers to edit code on the web. And having proper Twig highlighting is essential to anyone building a CMS that is based in Symfony.
Someone created a ticket on the Ace Editor side but that ticket was so poorly worded that it's unlikely that anyone would ever bother. I don't know Ace's policy on adding new languages to their master.
In my case, The right location for this on Ubuntu 12.04 is:
~/.config/sublime-text-2/Packages/
and it works! Thanks~
the syntax highlighter fails on the following line in my codebase:
<form method="post" id="content_form" action="{{ Url.get({'action':'save', 'controller':'content\\'~content_type}) }}" enctype="multipart/form-data">
unfortunately, the value of the controller property needs to be something like: 'content\image' or 'content\article'... it appears that the escaped backslash immediately preceding the single-quote is the source of the problem. If I replace that whole value with something more trivial, everything works properly.
I know the aforementioned line is syntactically correct.. but no worky :(
When you a part of HTML that contains HTML tags and {% %} or {{ }} the second and the third one preserve its color.
Hi,
This is no exactly an Issue - i am new to Sublime and somehow the plugin seems to have another format than yours. How can i install this bundle for Sublime? Thank you.
Is there a way to map the "toggle comment" keyboard shortcut to a twig comment block inside the HTML (Twig) scope?
kudos, great package
however
<a href="{{ path('accountpayments_new') }}">
is not recognized (syntax not highlighted)
Hello, would you be able to provide installation instructions in your README?
Many thanks
Some blocks don't have yet snippets, like trans
, autoescape
, etc.
OctoberCMS is a CMS based in Laravel 4 which uses Twig syntax in the views. The thing is that they don't use the .twig extension. They're just .htm files.
How would be the approach to get Twig syntax highlighting in this sceneario?
Thanks
I'm using SublimeText2 and followed the install instructions- I cloned the repo into my Packages folder. However, SublimeText didn't pick up the package until after I moved the contents of Syntaxes
into the base PHP-Twig.tmbundle
folder. I feel like I'm doing something wrong, since it should have automatically discovered the contents of Syntaxes
, but I don't know what.
Typing '</' no longer add closing HTML tag.
Hello,
My file named index.html.twig is uncoloured where as the same file but named index.twig is correctly coloured.
Can i correct it by my side ?
Thanks for your help.
Best regards from Paris, France
Hello. Thanks for your great work.
I noticed that if you have escaped string quotes inside the string (like {{ 'it\'s awesome!' }}
), the bundle mistakes it for the string ending quote and the highlighting is all messed up from there onwards.
Is it possible to test and fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.