aziz

aziz

Elixir package for Sublime Text 4

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!

Most Liked

aziz

aziz

Hey, everyone! I can finally announce version 4 of this plugin:

However, I’d also like to inform you that this will be the last version I’m going to release, except perhaps for minor bug-fix releases.

ST has served me well over the years, but I’m excited about Zed and plan on switching to it completely eventually. Zed isn’t quite there yet, but it’s in active development and becoming more and more usable with each release. Some of the reasons I wish to switch to Zed are:

  • ST’s syntax highlighting “technology” is a dead-end and absolutely no fun to work with (I actually feel burnt out now when I look at it).
  • Zed is pretty much on par with ST when it comes to speed and memory consumption.
  • Updates for ST are too infrequent and don’t bring any cool noticeable improvements like I’ve seen in Zed.
  • Longstanding annoying issues aren’t fixed. They are minor but maddening when they happen, like randomly not being able to comment out code with a shortcut anymore. Or when switching from file to project search, it messes up the search text. And then the search history itself is often confusing to me. I just don’t want to report bugs anymore. I feel they will go under and not be fixed for ages to come.
  • My favourite is when I format the current file with a shortcut that calls mix format, ST loves to just jump up several pages. (It seems this is affected by how many files are open.)
  • The search results view sucks. In Zed the results are syntax highlighted and you can even edit the code right there!
  • ST isn’t good at providing features that depend on the existence of a proper syntax tree. Like increasing the selection to a larger syntax node. While it works in simple cases, try expanding the selection to an HTML attribute value and then further to include the name…

Anyway, I hope the plugin has been useful to many developers so far and wish you continued happy and productive coding with the tool of your choice! :smile:

knoebber

knoebber

Thank you @aziz !

I have tried emacs, neovim, and vscode for LiveView dev, but all of them had small issues that annoyed me in different ways :slight_smile:

Your package has been a joy so far! My only problem is that sublime text doesn’t have great vim emulation as far as I can tell (I’m using vintage), but I’m trying my best to learn the “sublime way”. Here’s a screenshot if anyone else is curious what it looks like:

aziz

aziz

Released v3.1.1:

@Eiji :sunglasses: :+1:

distefam

distefam

Thanks for the update, @aziz. I’m still sticking with SublimeText for now and this is much appreciated. I, too, have been eyeing Zed. Unfortunately, Zed has an issue that makes it completely unusable for me. And, my concern about Zed is that it might become the next VS Code in terms of clutter and lack of focus. I still prefer SublimeText for this reason, but I do agree that the community surrounding it, including package development, seems to have waned. I’ve still yet to find an editor that gets out of my way as much as possible as Sublime, but hoping that Zed can resist the siren call of becoming too complex.

aziz

aziz

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/.

Where Next?

Popular in Dev Env & Tools Top

Nezteb
I frequently switch between ElixirLS, Lexical, and Next LS in order to test each out and compare/contrast. I decided to create a brief fe...
New
pjbs
Mechanical? Which Cherry switch? Which layout? TenKeyLess?
704 21107 332
New
AstonJ
I’ve been reinstalling macOS after trying out Tahoe, and when I went to migrate from a Time Machine backup I got an error I’ve not see be...
New
AstonJ
I wasn’t aware ZSH has plugins until @Samjowen mentioned one in the Share an Elixir or dev-env tip a day thread! Oh My Zsh comes bundle...
New
New
DaAnalyst
Note: Not a strictly Elixir question but relates to us as well. A year or so ago I asked Grok (or ChatGPT, can’t remember) what would ha...
New
Cervajz
Code at the speed of thought Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter. It’s also open...
New
SyntaxSorcerer
I found Elixir after a friend recommended looking into it for developing a multi-agent orchestration and task management system. Soon aft...
New
evnp
How do you all feel about the use of AI tools for building Elixir/Phoenix projects, with respect to these topics? Longform context below....
New
aziz
I’m happy to finally present to you the best Sublime Text package for Elixir, templates and more! :partying_face: :confetti_ball: Elixi...
New

Other popular topics Top

josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New

We're in Beta

About us Mission Statement