barrelstrength / craft-twig.tmbundle Goto Github PK
View Code? Open in Web Editor NEWThis project forked from uhnomoli/php-twig.tmbundle
A Craft CMS influenced Twig bundle for Sublime Text and Textmate
This project forked from uhnomoli/php-twig.tmbundle
A Craft CMS influenced Twig bundle for Sublime Text and Textmate
Hi,
I've just installed Craft-Twig and it's a really handy syntax highlighter but I'm having some trouble keeping it working.
I have Sublime Text 3 build 3126 installed on Ubuntu 16.04
When I restart Sublime text I get this message:
Error loading syntax file "Packages/Craft-Twig/Craft-Twig.tmLanguage": Unable to open Packages/Craft-Twig/Craft-Twig.tmLanguage
Also the syntax Highlighting disappears when the file you are working on is saved. You can get the syntax to work again if you re-select craft-twig as the syntax.
I have tried the following:
This does not work and I cannot find any reference to craft-twig outside of the Installed Packages folder.
How can I fix this?
includejs [tab] gives
{% set js %}
// JS here
{% endset %}
{% includeCss js %}
Which puts the script in the head as CSS :) - notice that last line.
Would be great if switch
could be a tab trigger to output:
{% switch condition %} ... {% endswitch %}
When I open a Craft html file the HTML (twig) syntax is not automatically selected. Is there a way to make this happen?
As per the sublime text docs here: http://sublimetext.info/docs/en/extensibility/snippets.html#snippets-file-format
(see the content section):
When writing a snippet that contains indentation, always use tabs. The tabs will be transformed into spaces when the snippet is inserted if the option translateTabsToSpaces is set to true.
The snippets in this package have spaces instead of tabs, which means they aren't honoring the tabs setting in Sublime.
Thanks for providing this package for Sublime Text!
One thing I run into often: I tend to type out my tags starting with the brackets. I don't rely heavily on autocomplete based on keywords. I guess for shorter keywords like for
it's not as apparent, but if I start typing:
{% autoes
Autocomplete pops up and gives me the option to complete the tag, which gives me:
{% {% autoescape "type" %}
{% endautoescape %}}
Which is a broken tag nested in brackets I started typing.
Is it possible to detect that I've already typed the opening tag brackets and just complete the opening tag so I can continue typing what I want inside it? This consistently trips me up.
Thanks!
mYYMMDD_HHmmSS_pluginHandle_migrationDesc
Hello,
Maybe I did some mistakes but some other with more experience than me were also not able to activate your bundle.
We use PHPStorm and included your bundle
Do we have to do something else or why doesn't it work at all?
When I type asset
and press TAB
then it is transformed to <asset></asset>
When I unregister the native file type from PHPstorm I receive plain text without any syntax highlighting in my twig files but they are activated in my File Types
Could you help me please?
I appreciate your help
Table Exists
Renaming a Table
Renaming a Column
Add Column After
Add Column Before
Add Foreign Keys
Foreign Key Exists
Hi, for some reason tab trigger on Twig Tags (extends, include, block, ...
) stopped working for me a few days ago. It was working for the 'customized for Craft' tags (assets, cache, ...
) and the functions (ceil...
).
I tried the 'upgrading notes', I fixed it by manually downloading the package from GH. (Downloading on package control mentions using 4.1.0, GitHub mentions both 4.0.1 and 4.1.0)
I'm on Win7, Sublime 3.1.1, build 3176.
Hey, thanks for all the great tools from BarrelStrength. I've cloned over the Craft-Twig.tmbundle every which way I know how and can't avoid getting this message when i try to pull it into TextMate.
The bundle " Craft-Twig " could not be installed because it is malformed - the bundle lacks mandatory keys in its property list.
Is this something you can help me with on your end? Thanks!
Nothing happens when I type ##
and press TAB. I even disabled emmet do check if it was not some kind of conflict :)
My sublime version is 3.2.2
A little issue is that inline CSS and JS set and include blocks don't have the correct syntax highlighting.
If you could make the package apply the correct syntax highlighting that would be really great.
ie.
{% set calendarTodayCss %} /* <style> syntax highlighting */
.fc-unthemed .fc-today {
background: #ff0000;
opacity: .5;
}
.hidden { display: none; }
{% endset %} {# </style> syntax highlighting #}
{% includeCss calendarTodayCss %}
and likewise for JS...
All in all a great package though well done guys :)
Can you please add syntax highlighting for css and js code inside {% css %}
and {% js %}
tags?
With Sublime Text 3 (stable, build 3083) I'm suddenly getting a regex error when I first launch Sublime and load/activate a .twig
file:
Error loading syntax file "Packages/Craft-Twig/Craft-Twig.tmbundle-2.0.2/Syntaxes/Craft-Twig.tmLanguage": Error in regex: target of repeat operator is not specified in regex (?ix) # Enable free spacing mode, case insensitive
# Adding parentheses around this pattern breaks things
?<={%\s\bincludecss\b|\bincludehirescss\b\s%}
I cleared the relevant Library caches as suggested here and reinstalled several times, both HEAD and latest release, and I can't seem to find my way out of this error. I loaded up different templates, some complex and others very simple, and experience the same thing regardless of what I do.
I've also installed manually and via Package Control.
Anything else I can try?
Thank you very much for the recent updates to this :)
In Sublime Text, I find that the code within Twig tags is no longer highlighted as clearly as it was in version 1, making it harder to read/scan.
Is there any way to bring back the old code highlighting from version 1?
Now when we type dd
and press TAB, it extends into <dd></dd>
which is pretty niche HTML tag. I much more often use Craft {% dd %}
.
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.