aziz

aziz

I’m happy to finally present to you the best Sublime Text package for Elixir, templates and more! :partying_face: :confetti_ball:

ElixirSyntax – The most powerful Elixir for the most Sublime experience.

In this latest v2.2.0 release I have added support for HEEx and Surface!

@princemaple is the original maintainer of the project. :wave:
I started making lots of contributions in 2019. Over 6 months in the making, the package has undergone a complete rewrite by me and was first released in April this year. After many more improvements and heavy polishing I decided it’s ready to be announced to the wider public.

Q&A

This is crazy good! Why did you do this?
I spend up to 7 work hours in the editor each day.
I like my tools to be finely honed in order to be efficient and to enjoy my craft.

Why use ST4 with this plugin?
It all comes down to personal preferences. My top reasons for using ST are:

  • Speed of: startup, typing, rendering, searching, plugins
  • Low memory usage
  • Git integration
  • Easy-to-use GUI

Is it perfect?
By no means, no. Neither is Sublime Text nor the package. ST4 has received great updates and a much better syntax highlighting engine is one of them. However, the engine still has limitations and some fundamental issues remain. The syntax definition language in YAML with regular expressions is also not the best possible way to define a computer language grammar.

What about the elixir-tmbundle package?
Josè based it off of a Ruby package and I think it served its purpose well. There’s a ticket on Github discussing my efforts.
I incidentally met José last week at ElixirConf and we talked about this stuff. He promised he’d try out my package soon. I hope you will now, José! :grinning_face_with_smiling_eyes:

What about alternative editors?
There are plenty and I have tried many. Even if some of them are incredible I just can’t use them for one reason or another. Mainly for the top reasons I mentioned above.
I’m following the tree-sitter project with great interest and hope that it will be combined with a great editor in the near future. I will consider switching from ST as soon as that happens (note: ST won’t be using tree-sitter). I know there are projects like NeoVim and others but nothing stable and attractive afaics.

Can I somehow highlight code for my slides?
Of course! Just select some code, open the console panel (Ctrl+`) and enter view.export_to_html(view.sel()).
I have seen so many slides with Elixir code in them and the highlighting was just not the best it could be. I hope speakers take notice and create more beautiful slides from now on in the future. :ok_hand::sunglasses:

Enjoy!

Showing Posts 1 to 10

frigidcode

frigidcode

Looks great :+1:

aziz

aziz OP

The next version will be released soon so I’d like to ask users of this package and also interested newcomers to please check out my dev branch and test it for bugs and usability issues. I tried to document things quite a bit but I’m sure it can be improved still.

Any feedback is welcome and appreciated!

Highlights:

  • New snippets, builds, menus, completions, key maps, settings etc.
  • Commands for running mix test and mix format (manual & automatic). With Alt+Shift+T you can run the test at the selected line or several tests with multi-selections. Press Alt+Shift+R to repeat the previously executed tests.
  • Better parameter highlighting in function headers and in arrow clauses as in for or with statements.
  • Lots of fixes and other improvements.

Have fun!

PS:

How to install

Just copy the contents to your Packages folder. On Linux it should be ~/.config/sublime-text/Packages/ElixirSyntax/.

egze

egze

Cool, didn’t know there’s an alternative elixir package. Will try it out.

egze

egze

How do I install the dev-branch version? :thinking:

aziz

aziz OP

Sorry, I assumed that people would know. Added a note to my comment above.

egze

egze

Played with the dev-branch for a bit.

Syntax highlighting is great. Only thing I’ve spotted is the same color for HTML data attributes and some elixir keywords.

But the more pesky thing that happened, is LSP crashing:

Is it a problem that ElixirLS was compiled with a different Elixir and Erlang? (Also, I install Elixir with asdf)

lsp-elixir: Started ElixirLS v0.11.0
lsp-elixir: Elixir version: "1.13.4 (compiled with Erlang/OTP 25)"
lsp-elixir: Erlang version: "25"
lsp-elixir: ElixirLS compiled with Elixir 1.11.4 and erlang 22
aziz

aziz OP

Thanks for testing it! Oh, that doesn’t really look good. So I can see you’re using the Mariana default theme. Keywords and HTML attributes seem to be coloured with the same colour. That’s something I can’t really change. :slightly_frowning_face: I mean, I have some theme overrides for Mariana and Monokai to touch up certain scopes but I don’t try to go against the main style of the theme…

LSP crashing seems to be a sign of recent updates and incompatibilities. I had to remove elixir-ls today from my package manager when the update didn’t work, so I didn’t get to see any crashes so far. But I hope everything will work once I update Erlang, Elixir and so on. Let’s see.

egze

egze

So it is a problem of the theme? What theme do you use?

aziz

aziz OP

Pretty much. If you look at normal Elixir code you see the keywords in purple, right? I guess that is the standard colour it assigns to keywords… I’m using the Monokai theme. It’s not perfect but it’s a good dark theme and gives much better contrasts than Mariana.

egze

egze

With Monokai Pro it is indeed better

Where Next? Top

Trending in Dev Env & Tools Top

nseaSeb
Hey, have you seen this? It looks better than tmux—what do you think? Herdr is the runtime your coding agents live on — laptop, desktop...
New
lungarella-raffaele
Hi all, I am writing Elixir using Zed. Often times I like to “Go to definition” on standard libraries code and check out documentation an...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews