I want to know how can I have highlighting syntax for TWIG in Sublime Text.
Actually when I open a TWIG file all fonctions and conditions are similar (white on black) :
Documentation
Syntax highlighting and auto-completion for Twig in Sublime Text 2is possible with : PHP-Twig.tmbundle
TWIG Doc "IDEs Integration" : http://twig.sensiolabs.org/doc/templates.html#ides-integration
Bundle's Github : https://github.com/Anomareh/PHP-Twig.tmbundle
Bundle's Documentation : https://sublime.wbond.net/packages/PHP-Twig
Download
You can clone the project with :
git clone https://github.com/Anomareh/PHP-Twig.tmbundle.git
Or download it directly from the Github (last master version) : https://github.com/Anomareh/PHP-Twig.tmbundle/archive/master.zip
Installation
To install this bundle in Sublime Text, a few extra steps are required.
Open Sublime Text and in the Preferences menu click Browse Packages.
In the directory that was just opened, create a new directory PHP-Twig/.
Copy the content of this repo into the directory you just created.
Move the contents of the PHP-Twig/Syntaxes/ directory to PHP-Twig/
Restart Sublime Text.
Apply
To apply syntax highlighting on your Twig HTML files :
Open a .html.twig file
Go to View menu → Syntax → Open all with current extension as → HTML (Twig)
That’s it. It should work by now.
Screenshot
You can also install PHP-Twig.tmbundle through Sublime Text's Package Control.
With Package Control installed:
Go to Preferences → Package Control → Install Package
Type "Twig", and select PHP-Twig.
It will install the same version of #antoine-subit's answer, and will automatically use the correct syntax for any Twig file you open
If you're not used to Sublime, don't forget to click on the bottom right of the sublime window (a drop up/down should appear) and then select "HTML (Twig)" from the list of languages in order to enable the package!
I'm working on Ubuntu, I have solved the problem by downloading https://github.com/Anomareh/PHP-Twig.tmbundle/archive/master.zip and I have done what was wrote inside ReadMe file.
After restarting Sublime Text choose the option called “HTML (Twig)” in “View->Syntax” menu to see the new highlighting.
To automatically highlight all twig files, open any html.twig template and select
“View->Syntax->Open all current extension as…->HTML (Twig)”
Related
I am working with LESS/SASS files
I press CTRL+S (in Sublime)
.SCSS is compiled to .CSS (GULP)
My Sublime Text automatically detects changes inside compiled CSS
Sublime Text automatically sends compiled .CSS file to server (with path) (NOT LOCALHOST!) by sFTP (I use this Plugin in ST3)
Does anybody know how I can do this?
Should I use a Plugin to Sublime Text 3/GULP, if so then what Plugin?
Well if you don't want to learn SASS or LESS on your localhost, why not create a new CodePen ?
You just have to go in the CSS container, click on the cog (settings), and chose SASS or LESS as your preprocessor.
Then you're good to go !
I'm using webpack to compile all my JavaScript to a single bundle.js file. PhpStorm is running very slowly at times because of this.
Is there a way for me to let PhpStorm ignore this file all together?
Right click on the file in the project tool window and select Mark as plain text from the context menu. That should keep PHPStorm from inspecting the file.
You can also do the reverse: if a file is marked as plain text, you can right click and mark it back to its regular type.
Some of JetBrains's IDE's have lines between the file and folders in the "Project" sidebar, which is helpful for showing the file folder hierarchy.
Here is how my PhpStorm file explorer currently looks: File Explorer
Here is how I want it to look: File explorer sidebar with lines between files and folders
Note: I cant post image - not enough rep points.
Is it possible to do this in PhpStorm? I'm using PhpStorm 8.0.3 on Ubuntu.
Such "lines" are part of the GUI Theme (also known as Look & Feel in Java applications).
You are using Darcula GUI Theme that does not support drawing such lines.
Your only option -- choose another GUI Theme at Settings (Preferences on Mac) | Appearance & Behaviour | Appearance --> Theme.
Problem 1: It will be light theme as Darcula is the only one dark theme.
Problem 2: I'm not sure if there is a theme for Linux version of PhpStorm that supports such lines (I'm a Windows user -- here "Windows" theme supports such lines). If there is none .. then you are out of luck...
In recents PhpStorm versions you can now use Show tree indent guides option
In:
-> Settings
-> Appearance & Behavior
-> Appearance
-> UI Options
-> Show tree indent guides (checkbox)
Resulting something like that:
I installed everything per this article: Adding CSS Vendor Prefix Automatically With Sublime Text
I press CTRL-SHIFT-P, while am on a .CSS file and typing in "Autoprefixer", but such an extention I cant find - it is not in the list.
Anny Ideas?
I want to switch my text editor to Sublime text 2 but the only issue cant let me do it.
I work with big projects and need very quick to navigate between files. ST2 sidebar doesnt support icon packs on such files .css, .html, ,php, .js etc. I found some article where the one guy explains how to do that - https://sublimetext.userecho.com/topic/19274-theming-of-the-sidebar/ I tried it but nothing happens. I tried do changes on the user-settings file. I suppose I do something wrong
If somebody knows how to do this please help
The newest stable version of Sublime Text 3 has sidebar themeing and many themes (not colour schemes) have added support for custom icons.
So upgrade to this: http://www.sublimetext.com/3
and then either use the default theme, or something like Soda theme to get custom sidebar icons.
For ST3 users. Adding icons for different file types and folders to default theme:
Download archive with icons. Or this one.
Go to Preferences > Browse Packages (In Windows find the Browse packages button to open the packages folder)
Copy(extract) folder from archive to packages folder. If you already have a
Theme - Default folder then just merge them.
Done. Thanks to Xavi Esteve