ElixirSyntax
The most powerful Elixir for the most Sublime experience.
Details
Installs
- Total 7K
- Win 1K
- Mac 4K
- Linux 2K
| Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 1 | 1 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 3 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 |
Readme
- Source
- raw.githubusercontent.com
ElixirSyntax
ElixirSyntax was initially based on the Elixir.tmbundle package but has been rewritten since, providing more accurate syntax matching as well as better syntax highlighting.
Features
- Working
Goto Definitioncommand. - HTML template highlighting:
- HEEx:
- Surface:
- LiveView:
- HEEx:
- Full PCRE syntax highlighting:
- Type highlighting:
- Theme adaptations for Mariana and Monokai.
- Palette commands:
ElixirSyntax: ...,Mix Test: ...,Mix Format: ... - Build commands:
mix format,mix test,elixir $file - Snippets for
IO.inspect,tapandthen.
Some syntax highlighting features are not immediately evident. Among them are:
The fragment and sql functions
SQL syntax is highlighted inside Ecto's fragment macro.
Add an sql macro/function to your project to enjoy SQL highlighting anywhere it's used.
The JSON ~j and ~J sigils (Jason)
Embed JSON strings in your Elixir code. Notice the interpolated Elixir code is colored correctly.
The YAML ~y and ~Y sigils (YamlElixir)
Testing
Build-files as well as commands are provided for calling mix test. The predefined shortcuts can be changed via Preferences > Package Settings > ElixirSyntax > Key Bindings.
Tip: To run specific tests in the current file, mark them with multiple cursors and/or spanning selections and press Alt+Shift+T or choose Mix Test: Selection(s) from the palette.
ElixirSyntax stores a per-project JSON settings file in the root folder that contains both the mix.exs file and the _build/ folder. They override the general settings below.
General settings example (via Preferences > Package Settings > ElixirSyntax > Settings):
{
"mix_test": {
"output": "tab",
"output_mode": null,
"args": ["--coverage"],
"seed": null
}
}
When a mix test command is run the first time, a mix_test.repeat.json file is stored in the _build/ folder to remember the command arguments. By pressing Alt+Shift+R or running Mix Test: Repeat from the palette you can repeat the previously executed tests.
Formatting
Use the default shortcut Alt+Shift+F or the palette command Mix Format: File to format your Elixir code. Format the whole project via Mix Format: Project / Folder. Configure auto-formatting on save via the palette command Mix Format: Toggle Auto-Formatting or via the menu Preferences > Package Settings > ElixirSyntax > Settings. There is no per-project auto-format setting yet.
{
"mix_format": {
"on_save": true
}
}
Palette commands
ElixirSyntax: SettingsElixirSyntax: Open Hex DocsElixirSyntax: Search Hex PackagesMix Test: SettingsMix Test: AllMix Test: FileMix Test: Selection(s)Mix Test: FailedMix Test: RepeatMix Test: Set --seedMix Test: Toggle --stale FlagMix Test: Switch to Code or TestMix Test: Show PanelMix Format: FileMix Format: Project / FolderMix Format: Toggle Auto-Formatting
Recommended packages
- LSP and LSP-elixir for intelligent code completion and additional snippet suggestions.
Changes
See CHANGELOG.md for the list of releases and noteworthy changes.
FAQ
- How to color unused variables, e.g.
_opts, differently?
You can customize the color of unused variable names by extending your color scheme, targeting the variable.parameter.unused and variable.other.unused scopes:
{
"rules": [
{
"name": "Unused variables",
"scope": "variable.parameter.unused, variable.other.unused",
"foreground": "#8c8cff"
}
]
}
More details at Sublime Text Docs
Contributors/Maintainers
- @azizk rewrote the whole syntax definition with an extensive test-suite and added a wealth of new features. ⭐
- @princemaple initially brought the tm-syntax to sublime-syntax and made some improvements.