Gleam
Gleam syntax support for Sublime Text
Details
Installs
- Total 526
- Win 135
- Mac 212
- Linux 179
Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | Jul 12 | Jul 11 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 2 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime Text + Gleam
✨ Gleam syntax support for Sublime Text.
Installation
This package is available on Package Control. To install:
- Open the command palette (Ctrl/Cmd+Shift+P)
- Select Package Control: Install Package
- Select Gleam
LSP Integration
The LSP package enables improved autocomplete, go-to-definition, formatting, “hover docs”, compiler errors and warnings in the editor, and more. To set it up, install the package and open its settings (Preferences: LSP Settings in the command palette), then add this config:
{
"clients": {
"gleam": {
"enabled": true,
"command": ["gleam", "lsp"],
"selector": "source.gleam"
}
},
"lsp_format_on_save": true
}
If you don't want format-on-save, leave out the global
lsp_format_on_save
option (the default isfalse
) and instead use LSP: Format File in the command palette, or bind this to a keyboard shortcut.If you have Gleam installed using
asdf
or a similar version manager, thecommand
should instead be e.g.["~/.asdf/shims/gleam", "lsp"]
.If Sublime Text and Gleam are installed in different environments (e.g. Sublime on Windows and Gleam on WSL), the LSP package unfortunately won't work, since it does not support path translation. Note in the specific case of WSL2 you can install Sublime inside the Linux environment and use it that way, at the cost of some UI quirks.
Fmt
Integration
The LSP package (see above) includes code formatting in the editor, but if you don't want to or can't use the LSP, you can still get formatting using the Fmt package. Follow the instructions to install it and open the package settings, then add this rule:
{
"rules": [
{
"selector": "source.gleam",
"cmd": ["gleam", "format", "--stdin"],
"format_on_save": true,
"merge_type": "diff",
},
],
}
If you don't want format-on-save, leave out the
format_on_save
option and instead use Fmt: Format Buffer in the command palette. See the Fmt README for instructions on binding this to a keyboard shortcut.If you have Gleam installed using
asdf
or a similar version manager, thecmd
should be modified in the same way as the LSP instructions, above. This approach also works with WSL (prepend"wsl"
) or other cases where Gleam and Sublime are installed in different environments.
Compatibility
This package is developed for Sublime Text 4+, and is not available in Package Control on older versions. It can be installed manually in Sublime Text 3, but this is unsupported, and bugs that only appear in ST3 will not be fixed.
Manual Installation
- Download the
.zip
for the desired version from the GitHub Releases page - Rename this file (without unzipping it) to
Gleam.sublime-package
- Place the file in your Sublime Text “Installed Packages” directory
“Installed Packages” can be found using Preferences → Browse Packages within Sublime Text (go up one level from the directory this opens).