What code editor do you use for Elixir development?

➜  lms01 git:(main) ✗ cat .tool-versions
elixir 1.13.0-rc.1-otp-24

It is the latest.

I rebuilt the elixir-ls package. and this is a warning shown

warning: Building with Erlang/OTP 24. Make sure to build with OTP 22 if publishing the compiled packages because modules built with higher versions are not backwards-compatible.

I just had a look into LunarVim and it seems nice.
I can operate vi, but all the IDE-stuff like exploring files, switching buffers, git or even installing plugins I have a hard time with. Lunar kind of takes you by the hand. After pressing <leader> (space by default) it just tells you what you can do now.

1 Like

Ended up switching back to Emacs for both Elixir and React. Continued with Doom as it is well setup with evil (vim) keybindings for most things out of the box.

1 Like

What I have tried:

IntelliJ + Elixir plugin

Very impressive for volunteer project. Rough / incomplete compared to IntelliJ/Kotlin, IntelliJ/Scala, IntelliJ/Rust, or IntelliJ/Go experiences.

VSCode + Elixir_LS

Seems more complete than InteliJ + Elixir plugin, due to the power of Elixir_LS; but missing lots of the IntelliJ nice features, like refactoring.

Also, Electron somehow manages to make IntelliJ feel smooth/fast.

Neovim + lua + Elixir_LS

Missing lots of IDE features. Not fan of NERDTree (can’t get moues to work). Browsing files a pain. Searching a pain …

What I really want: NeoVim + Elixir_LS + scriptin via Elixir (instead of Lua/VimScript).

How hard can this be? Is anyone working on this? Can we kickstart this ?

You can refactor Elixir with IntelliJ + Elixir plugin?

‘Refactor’ might mean different things to you and me. To me, it primarily means: I can rename a struct / field, and all refs to it gets renamed. This works nicely in IntelliJ due to some ref-tracking system they have. I have not gotten anything that matches it in VSCode / NeoVim yet.

2 Likes

That’s cool, did’t know that was possible.
Safe rename is nice and the most important refactoring task, most of the other stuff intellij-refactoring can do is OO-specific. What would also be useful is “Change Signature”. Is that also possible with Elixir?

The Change Signature refactoring combines several different modifications that can be applied to a function signature. You can use this refactoring to:

  • change the function name
  • add, remove, and reorder parameters
  • assign default values to the parameters

[Change signature | PyCharm Documentation]

For renaming, see GitHub - KronicDeth/intellij-elixir: Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)

I use it all the time in Scala/Rust; I think it also works in Elixir, but it has been a long time since I last used IntelliJ/Elixir.

Change signature / “add, remove, and refactor parameters”: can neither confirm nor deny, never used anything like this. My general strategy is: change the function definition, follow the compiler errors, but that only works on statically typed languages.

Is it? :017:

I was under the impression that nvim-telescope helps a lot? It integrates with both fzf and ripgrep and the few times I used LunarVim (which is basically an opinionated bunch of plugins on top of NeoVim), I found it very easy to both (a) find files by fragments of a name and (b) by their contents.

I dislike file trees as well btw. I much prefer fuzzy-finding files by name or contents.

That’s true. I am definitely not a NeoVim expert, and when I said “NeoVim + lua + Elixir_LS” I literally meant NeoVim + lua + Elixir_LS, and not any of the plugins one can add to make NeoVim more ide-like.

It is entirely possible one can me NeoVim more IDE-like, I never put in the effort.

That said, IDE features work out of the box in IntelliJ. :slight_smile: With Vim/Emacs 3rd party extensions, I always end up running into some glitch with some packages interacting badly.

I feel like this is actually something commercial products (like IntelliJ) wins on. Somewhere, there is a project manager that gets the two team leads together and says:

feature A and feature B interacts badly in the following situation, fix it

and then it gets fixed.

Whereas in volunteer plugins, there are plugins that individually work great, but when meshed together for an IDE, have weird interactions, and there’s no authority figure to force the plugins to interact nicely.

1 Like

Hi, there, just adding to the fuel, I use nvim.

Configuration files are there: dotfiles/vim at master · thenrio/dotfiles · GitHub.
It is built from GitHub - rstacruz/vim-opinion: My opinionated vim defaults (vim has opinions?, this is one of them).

A caveat of this approach is : all plugins are centralized in init.vim, such as coc-snippets BUT I ended up adding them outside with coc, such as: coc-tsserver, coc-rust-analyzer, coc-pyright, …

Any langage server I tried MAY kick in the fan (same as any server spawn by another editor (vscode, jetbrain, …)).

I added elixir-ls last month and it is good (albeit no “gr” “/go to references”).

1 Like

Oh absolutely, no argument there. In my case, I want to be able to have my complete development workflow in a terminal.

I think this is something Elixir/Erlang might beat out VimScript / Lua / ELisp on: without shared mutable state, when all plugins are separate processes, they might ‘combine’ better.

This is why I generally stick to plugins created by the same people (big emphasis on the word “generally” there, it is by no means a rule). I still haven’t switched over to nvim (and honestly not sure I ever will) so for me that means most of my plugins are by Tim Pope and by people who generally follow his principles. A handful of people make plugins that depend on his plugins so even though I have a quite a few of them, I’ve never really had any problems with conflicts.

Other things I look for when choosing plugins:

  • They don’t provide out-of-the-box leader mappings—I don’t know why, but this always makes me distrust a plugin author’s sensibilities (rightfully or wrongly so)… leave my leader mappings alone!!!
  • I always make sure the plugin is written in pure viml unless there is a very good reason for it not to be (I can tell this is probably pretty contentious amongst some in this thread). I don’t really know if this helps anything, but they always feel speedier and are easier for me to understand the source.

As for NERDTree, I really like it! The thing is, I only use it when I need to get some context on how how files are organized—the vast majority of the time it stays closed. I have mappings to toggle it open and closed as well as a mapping to open it with the directory of the current file expand. Also, I have it set to automatically close whenever I open a file (that was such a killer feature for me when I realized that was a setting). Otherwise it’s fuzzy-finding all the way. And if you’re good about keeping your open buffers under control, the :buffer command (or simply :b) is even quicker for jumping to files you’re currently working on.

I am using vscode for elixir, but I want to learn any other developer experience for other IDE, which one is the best for Elixir development.

1 Like

Which one , are you prefer

While I wish I could code Elixir all day and night long, I need to work with other languages too. VS Code seems to be the best all-around editor/IDE. But my setup is CLI-heavy:

  • I run formatting and tests with watchexec -e 'ex,exs,eex,heex,lock' -- 'mix format & mix test --stale'
  • I use git and lazygit.

This year José Valim is using Livebook to solve Advent of Code, but two years ago he was using plain Sublime with no plugins really. That made me think a lot.

2 Likes

I just looked up the Elixir plugin for Jet Brains, because I really liked RubyMine back when I used it, but almost every review this year for that plugin says it crashes constantly. What kind of stability are you experiencing?