Anyone has a setup to share for emacs lsp-mode?

Hi
I sat last night and read zillions of posts online on lsp-mode and the additions there are too it. I managed to get it all working finally, with documentation pop ups in the code, underlining dead code and errors and even completion popups.

Now I restarted and nothing works any more. :frowning:

It turned out that something had gone stale or mismatched with my packages and the solution was to remove my .emacs.d folder and start over. I tried to do it, but can't get to were I was last night.

I'm at my wits end. Can someone who has a emacs config for lsp-mode and rust-analyzer have mercy on my sanity and share their setup? I think I might get it working if I have a whole working example to compare to.

I'm ready to throw my laptop out the window, so a peek at a working setup would really be appreciated.

Thanks.

1 Like

For what it's worth, the lsp setup for Spacemacs works out-of-the-box without any extra configuration.

Thanks. Any pointers are useful. I did try to figure out Spacemacs, and found it was quite a big and complex setup. Maybe I'll try to take it apart again.

Are there really NOBODY else who uses emacs?

I'm at my wits end.

I have a vim setup you can look at? :sweat_smile:

3 Likes

What did you find about Spacemacs that was complex? I personally found it the exact opposite (coming to it as a years-long Emacs user). When I switched, I got to throw away all my old custom settings and everything "just worked". If you don't like the Vim-ness of it it's possible for all binding to be the exact same as normal Emacs. You choose the first time you open it.

If you do switch, here are the two "layer" settings that I use that are relevant to Rust:

     (lsp :variables lsp-rust-server 'rust-analyzer)
     (rust :variables rust-format-on-save t)
3 Likes

@matklad
Super! Finally an example of all the myriad components combined in a way that works. That pointer is very much appreciated!

If I'm honest, the vim-ness of it all did scare me first. But, the complexity is probably answered by the fact that the download is over 1000 files! It's basically learning everything over again.

Then the biggest problem for me was it didn't work. I started it, and it ran for a long time and in the end it just froze.

It was a bit much just to get lsp-mode working. Your pointer is very much appreciated, though. I have dared the vim-ness of it all, and one day I might try it again.

:upside_down_face: :alien:
I have a deep respect for serious vim pilots. I've had colleagues who did marvellous stuff in vim I only thought emacs could do. Now, I'm too old to change and I'm set in my ways. :innocent: I appreciate the thought, though.

1 Like

Best of luck!

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.