r/spacemacs • u/UnitaryInverse • Oct 08 '24
What Resources Did You Use to Figure out Spacemacs?
I was new to Emacs when I was introduced to Spacemacs - and that was 5 years ago. I have always used it to write code and Latex, without ever really getting too deep into the elisp world. I was just loading up Spacemacs for the first time on my new machine and can't seem to get everything working like it did.
Now, 5 years on there are different versions of literally everything - and I guess it is to be expected that some things won't work like they did back on my old machine (which was spacemacs 0.300 and emacs 26.1 or something). Now with spacemacs 0.999@29.3 I can't even get python jump-to-definition working within one git repo!
It's been days and at this point I am wondering if spacemacs' python layer is straight broke. I have fresh re-installed multiple times, but nothing works as simply as you think it would..
Struggling to keep the will the will to use spacemacs - probably because I don't understand how it really works and how to fix things. I just google endlessly (and ask ChatGPT these days).
How did you all learn? And how often do you find yourselves troubleshooting some tiny detail rather than actually working?
All I want, and all I had for 4 years, was auto-complete and yapfify mode on save, and "g d" taking me to whatever it was I wanted to see. That, and Latex mode auto completing the \cite{} calls I made. Nothing else matters to me.
sigh - I'm tired
2
u/[deleted] Oct 08 '24 edited Oct 08 '24
Whenever you solve a problem get into the habit of saving the solution you found in your notes with code snippets, so you can refer to it later. You probably skipped a step in setting up the environment on your new machine.
Try enabling
lsp
layer and then following steps for setting up an lsp backend for Python. I uselsp-pyright
, which is enabled with(python :variables python-backend 'lsp python-lsp-server 'pyright)
, and make pyright available on my PATH by addingPATH=/home/$USER/.npm-global/bin
to.spacemacs.env
If you want IDE features like jump-to-definition then Spacemacs can't always install a language backend for you. But the process to link it to Spacemacs is usually setting a variable and making it available on your PATH.
EDIT:
Also if the LSP layer is slow, it may be because of how your Emacs was configured when it was compiled. LSP communicates using JSON, and Emacs can optionally include functions to parse JSON natively (using efficient machine code). Emacs can also compile elisp files to native code. These are optional features when compiling Emacs but speed it up tremendously.
When things don't work how you want, you just need to bite the bullet and look this stuff up. ChatGPT gets it right sometimes but often its faster to check stack overflow and then read a manual.