xiaoqiang
These past few days, I’ve tried switching from Neovim to Helix, and so far the experience has been great. Compared to neovim, which requires multiple plugins and configurations, Helix requires very little configuration to start using it for Elixir. Plus, it has a great shortcut key prompts, so if you’ve used vim before, you can quickly get used to it.
In addition to its out-of-the-box features, one of my favorite features of Helix is its multi-selection editing!
Prerequisites:
- Ensure that
elixir-lsis installed and in your path. On macOS, you can usebrew install elixir-ls.
Put the following configuration in .config/helix/languages.toml, and happy coding!
[[language]]
name = "elixir"
scope = "source.elixir"
injection-regex = "elixir"
file-types = ["ex", "exs"]
roots = ["mix.exs"]
auto-format = true
diagnostic-severity = "Hint"
comment-token = "#"
indent = {tab-width = 2, unit = " "}
language-server = {command = "elixir-ls"}
Trending in Dev Env & Tools
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security











Showing Posts 66 to 57- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
nulltree
Depends on what plugins you’d miss, I guess. For me the biggest current paper cut t is it not automatically recognizing external file changes.
As to the plugin system’s release - it appears to be somewhat close, the creator recently remarked he primarily wants some more code reorganization to be willing to release it under a feature flag.
paulsullivanjr
Curious how many have converted from neovim to helix. I mess with helix some here and there but haven’t taken the dive to using it full time. Has the lack of a plugin system been an issue? I heard one may arrive someday but I don’t really keep up with that part of it.
joelpaulkoch
I had issues with the LS formatter too and switched to a similar config
formatter = { command = "mix" , args = ["format", "-"]which works but doesn’t respect the formatter plugins.The problem is that helix is executing this command in the directory of the file you’re working on. In the latest version of helix you can use expansions, so I’ve tried
formatter = { command = "mix" , args = ["format", "--dot-formatter", "%{pwd}/.formatter.exs", "-"]which finds the .formatter.exs file but can’t find the mix dependencies.
So you would want something like
formatter = { command = "cd %{pwd}; mix format -"but I think it doesn’t work this way.
As a sidenote on helix master there is a %{workspace_directory} expansion which would be more appropriate I guess.
nulltree
Ah interesting - I did to no avail in the past but probably didn’t give it sufficient time to properly recompile.
After waiting some minutes, it indeed appears fixed, thank you very much!
frankdugan3
ElixirLS shouldn’t conflict (I use it). I have had it happen several times, and usually it’s because ElixirLS got stuck on compilation. Sometimes it happens after dep upgrades, other times certain compiler errors. Have you tried nuking the
.elixir_lsfolder and restarting the LSP? After it finishes recompiling, it should play nice.nulltree
Thank you - unfortunately, that one is set already
Setting the formatter as either
formatter = { command = "mix format" , args = ["--stdin"] }orformatter = { command = "mix format" }also doesn’t work - I assume it might has to do with
elixir-lssomehow.frankdugan3
For Spark DSL’s (Ash, etc.) specifically, the Spark formatter can be configured to remove parenthesis on format: Spark.Formatter — spark v2.7.2
nulltree
Does/Did anyone else have problems with the formatter applying parentheses to DSLs (Ecto, Ash, …) using
helix(andelixir-ls) - and/or ideas on how to resolve this?Example:
turns to
Happens for both auto-format or using the
helix’s:formatcmd.The
formatter.exis (presumably) correctly set up and respected by other editors where this doesn’t happen.For completeness’ sake, my language config:
Other info (but happens for years, so no recent incompatibility)
frigidcode
I removed the helix install which was done using
asdfand downloaded the pre-built binary from GH. Now tree-sitter highlighting works, I haven’t tested the elixir lsp yet.frigidcode
Nadda, I tried your config earlier and no dice. I installed and build the grammars but nothing yet.