Laravel Blade Template syntax definitions for Sublime Text based on its HTML/CSS/JS syntaxes.
It is a fork of great Medialink/Laravel Blade Highlighter which is no longer maintained.
The easiest way to install is using Package Control. It's listed as Laravel Blade
.
- Open
Command Palette
using ctrl+shift+P or menu itemTools → Command Palette...
- Choose
Package Control: Install Package
- Find
Laravel Blade
and hit Enter - Restart Sublime Text (e.g.: if A File Icons is installed)
- Reopen any
.blade
files.
- Download or clone this repository into
[install-dir]/Packages/Laravel Blade
- Restart Sublime Text (e.g.: if A File Icons is installed)
- Reopen any
.blade
files.
Note
Syntax from main
branch require Sublime Text 4.
For Sublime Text 3 compatible version refer to st3
branch.
Blade extends Sublime Text's HTML syntax definition.
If Blade syntax highlighting doesn't work and console displays syntax errors in HTML (Blade).sublime-syntax, please make sure to remove any out-dated syntax override.
Steps:
- call Menu > Preferences > Browse Packages..
- Look for HTML folder
- Remove it or at least delete any syntax definition in it.
Blade relies on JavaScript (source.js
), JSX (source.jsx
),
TypeScript (source.ts
) and TSX (source.tsx
)
to scope script blocks and inline scripts.
Make sure to remove related out-dated syntax packages, which don't meet least compatibility requirements.
They can be identified by calling
e.g. sublime.find_syntax_by_scope("source.ts")
in ST's console.
Known candidates are:
- To test a local version of the highlighter first uninstall the highlighter from package control.
- Follow the manual installation process by cloning the repo into your packages directory.
- Restart Sublime Text.
- Open up the '[install-dir]/Packages/laravel-blade' folder into a new Sublime Text project.
- Open up the blade.tmLanguage file and make changes.
- I have provided a test.blade file that holds most of the common uses for testing the regex, use this to verify your changes before and after you make them to ensure the changes you make do not break anything.
- Send a pull request with a single change per request.