Which tutorial/book/course do you recommend if someone is learning Emacs for Elixir development?

I am a VSCode and Sublime user and I know VIM, though I don’t use VIM directly but whenever I code inside Sublime or VSCode, I use Vim emulators inside these editors, for movements, for cutting, copying, pasting, jumping to certain line, replacing the line, saving and closing a file and other VIM commands.
I don’t know how much Emacs is different from VIM. But it looks like Emacs is very important to learn if I want to become a good Elixir programmer. I actually know only the name of Emacs, and that it’s a highly customization alternative to VIM which can be manipulated through a language of its own a bit different flavor of LISP. I didn’t try Emacs ever.
I want to learn Emacs and be very efficient in it, so that I benefit from it during programming in Elixir.
What tutorial/book/course(s) are recommended by you people?

Thank You!

If you use the Spacemacs plugin set for emacs (highly recommend, ton of useful pre-packed plugins) it’s default interface is very VIM-like.

2 Likes

Thank You for the response!

I read some discussions, to use Spacemacs or not to use it, is a discussion of its own. Some people recommend to use it to get quickly up and running, but others say that when they installed a fresh copy of the editor without Spacemacs then they came to know the real power of the editor.

Do you recommend to use Spacemacs?

I’ll see your answer, and also the responses by other Emacs users in the forum to decide either to use Spacemacs or use Vanilla Emacs.

VSCode easily has the best Elixir integration. Even when Spacemacs was at its best for Elixir it wasn’t as good as the VSCode integration is.

Learning emacs is nice regardless, so if you do want to learn it I suppose this would be a good resource to check out:

https://www.emacswiki.org/emacs/LearningEmacs

One thing to keep in mind is that while Emacs is nice, Emacs Lisp is usually not anyone’s favorite Lisp. If you develop an interest for it I recommend looking at a language like Racket.

3 Likes

I recommend Spacemacs, it finally replaced Vim to make Emacs my default editor after like 30 years with vi of various forms… ^.^;

If only vscode was as useful as emacs, it won’t even run on a lot of where I program elixir… ^.^;
Unless you know how to get vscode running here?

1 Like

Thank you for the response!

There are two plugins available for VSCode. Although many people recommended ElixirLS extension, but it felt very slow to me. The intellisense wasn’t quick.

1 Like

The problem is that on Core-i3 and Core-i5 computer (which can be considered modern if not the most performant) with Ubuntu 16.04, the VSCode’s Elixir intellisense through ElixirLS is very slow sometimes.

1 Like

Neovim runs in tmux, which has the second best Elixir mode. :wink:

Not spacevim I hope you are not referencing (or the extensions it includes)? That uses the same bases as spacemacs for the elixir integration (though with fewer extensions, and far far more laggy for reasons I didn’t get into researching).

neovim with alchemist.vim which is ironically better than the emacs version.

So you said that VSCode has the best Elixir mode and Neovim has the second best. Which of the two VSCode plugins for Elixir do you recommend?

ElixirLS, but if it seems too slow then obviously it’s not going to happen. I haven’t had any issues on that front, so I can’t really relate. Spacemacs should work decently out of the box for Elixir, though. I ran it for a long time until the go-to-definition functionality suddenly broke and I just tried something different (which was neovim at that point). I think alchemist.el (through Spacemacs) would win if it ran ElixirSense.

Then, with ElixirLS, VS Code clearly won the race.

I used to code daily on a netbook with a 1 GHz dual core AMD processor and 7xx MB RAM and for a weak machine I don’t think there’s anything that can beat vim/neovim. Just watching Spacemacs start up on that machine a few times was enough to make me want to switch, to be honest. It doesn’t matter if you run emacs-daemon and only start the client to connect to your running instance either, emacs is just a hog compared to vim.

1 Like

Interestingly, and this is coming from a multi-decade VIM user, I tried spacevim with neovim and it lagged like crazy (stock install) where emacs runs just fine… I keep meaning to look in to it but not got around to it yet…

Spacemacs, well, emacs in general does take longer to load, but I keep it always running (yay tmux), plus you can run it in a daemon mode or something too so it loads instantly I think.

2 Likes

I do exactly this. Systemd starts my emacs-server on login and shuts it down on logoff. From then I use only emacsclient -c (opens in a new window) or emacsclient -t (uses the current terminal), the latter beeing my $EDITOR. Of course I have aliases for both (emax and emats). Those open a file instantly (or fast enough that it feels like instant).

I should perhaps do a blog post about my setup?

5 Likes

That would be cool, I’d like to see that. :slight_smile:

I’ve not set up daemon mode as I just leave it running in tmux, but it would be very nice when I just want to edit a single file or so. ^.^;

I would like to see out of curiosity - After fiddling with alchemist I ended up just running emacs as editor without any shell because I found it (in MacOSX) to be considerably slower to run iex inside it, than it was to just have terminal tabs for that (I always have a terminal window open) but perhaps I’m missing something.

You asked for it:

https://nobbz.gitlab.io/2018/02/16-emacs-as-a-service.html

Also my emacs configuration as a whole is available as well in a gitlab repo.

5 Likes

I recommend Vim by itself (just due to my coding style, I like having a lightweight editor. Spacemacs takes 25 seconds to startup… It’s more like an IDE that’s intended to be left open).

Having said that, if you don’t want plain vim then I def recommend spacemacs. Vim is a lot better in terms of workflow and hotkeys, and emacs imo is better at “everything else”… it has a lot more core functionality built in, and it’s almost like youre using a lot more than just an editor.

The people who say “learn the editor from scratch” probably are fanatics and have way too much time on their hand. I personally created my own vim config from scratch over 6 months, but I’d never recommend that to someone. I’m not more enlightened because of it. The main thing it did was just give me more practice honestly… you can start with the spacemacs config, customize it exacrly how you want and that will be enough… want to change the startup message? research it and fix it. want to change the colors of add a file tree? research it and fix it.

Going 100% from scratch is just stupid to me, unless you truly have nothing better to do. You will maybe get 5% more gains… considering almost EVERYTHING you could ever want to do has already been done by someone else.

1 Like

The way I learned spacemacs was literally just booting it up, looking through the config, and then spending about 2 days looking at all the SPC menus. I knew what I wanted to achieve so it was easy just googling to ‘solve’ all the things I wanted differently.

If you’re starting from scratch I recommend vimtutor, as well as http://derekwyatt.org/vim/tutorials/

1 Like

Whoa what? I have a LOT of layers enabled and mine takes about a full 2-3 seconds to load with no daemon… o.O

Not 20, that sounds huge!

Which Spacemacs emulates ‘most’ of that, and with the spacebar leader key (and usual commands of course, which with Alt+X search is very nice to learn) it does most else surprisingly faster too. :slight_smile:

1 Like