reddit / emacs

Doom Emacs questions

medwatt · 2022-05-03 10:25
My supervisor has been recommending emacs to me for a long time, and while I have been meaning to try it out, I have always been overwhelmed by the very high barrier to entry, and this is coming from someone that uses vim. I feel there're so many things going on with emacs that you absolutely have no idea where to start. I have tried to read some blog posts on how to get started, but these have been too simplistic to help me in any way. I also tried some tutorial videos and found a series by system crafters. While the content is very good, because they are recorded from a livestream, it means I have to go through hours upon hours of videos just to extract useful information. When I started learning vim, I found a 2h video that basically explained the most relevant things and left me in a position where I know how to find my way around. Once you know your way around, it's just a matter of filling the blanks. Given that I cannot invest months of reading time just to setup emacs to the point that I am starting to become productive, I decided to go with doom emacs. I am usually not a fan of using someone else's setup since the whole point of coming the vim/emacs way is to have the freedom of configuring the editor to your liking, but I made an exception this time just to get started and see whether I'll end up liking the editor. The first thing I noticed is that things tend to be a little bit slower compared to neovim. I don't know if this is general to emacs or is specific to doom emacs. For example, the lsp response is instantaneous in neovim, whereas there is definitely a noticeable delay in doom. Here's a video comparing the two: https://imgur.com/hgGu5Ak Another thing I noticed is that opening the menu for the recently used files for the first time is quite slow. I have read that emacs tends to slightly less responsive compared to (neo)vim, but I have also read that a lot of work has been done to speed things up in the latest version (28.1). So, my question to the community here is, do my observations correlate with your own experiences with emacs?
RealRaynei · 2022-05-03 11:20
Emacs has a massive and ancient codebase compared to neovim (and mostly elisp compared to mostly c), so it's not that surprising that things just aren't as snappy. Also Doom lazy loads it's packages to speed up launch times, so the package for finding recent files is not loaded until you actually *need* to use it.
BobKoss · 2022-05-03 11:24
Agree that System Crafters videos are long but good. Search YouTube for DistroTube doom emacs. This is a good place to ask specific questions on doom
medwatt · 2022-05-03 11:45
Here's a video comparing the lsp speed between the two: https://imgur.com/hgGu5Ak
big_lentil · 2022-05-03 13:04
You should check whether the version of emacs you're using has native compilation and native JSON support. You probably do have native compilation but I'm not as sure about native JSON support. I'm also not sure how Doom does native compilation, so there's a slight chance that it may be available but turned off or something. Here's an article explaining how you can check these https://www.masteringemacs.org/article/speed-up-emacs-libjansson-native-elisp-compilation
khaichuen · 2022-05-03 13:07
This playlist by Lukewh had helped me a lot when I’m first starting out with Emacs. https://youtube.com/playlist?list=PLNJWazvift25KnHDwYlhwrrgr60wtpQOB
fedreg · 2022-05-03 13:14
Larger configs such as doom & spacemacs are definitely going to feel much more sluggish than vim. You can compare the speed of vanilla emacs by running emacs -q (starts emacs with no config file). I have lean configs on both vim and emacs (~300 loc), go back and forth between the two daily, and don't notice a difference in snappiness between them (running emacs 28.1 with native-comp / neovim 7.0). I do think it's a good idea to start with a larger config just to get your bearings and plan to slowly build your own after. You might just want to start with emacs -q and go through the beginner tutorial (C-h t) to see if the speed of vanilla emacs is acceptable to you. Even if you use evil-mode, you'll want to learn some of the basic emacs keybindings anyways. I started with spacemacs several years ago and it definitely helped me get started since using vanilla emacs bindings at the time was too big of a productivity hit.
medwatt · 2022-05-03 13:49
I ran the code and got: Native JSON is available" Native complation is *not* available
big_lentil · 2022-05-03 14:10
That is the opposite of what I expected lol. I wonder why. Maybe it doesn't work well with Doom. You'd probably benefit from switching to a version that has native compilation as it greatly improves responsiveness, at least it did in my case.
mclearc · 2022-05-03 14:13
The system crafters series is pretty well organized. You should look beyond the livestream episodes to those where he discusses specific issues. - [Configuring Emacs](https://www.youtube.com/playlist?list=PLEoMzSkcN8oPH1au7H6B7bBJ4ZO7BXjSZ) - [Beginner's guide to Emacs](https://www.youtube.com/watch?v=48JlgiBpw_I) In general his three [Emacs essentials](https://systemcrafters.cc/emacs-essentials/) videos plus the related notes are probably the place to start.
TheFrenchPoulp · 2022-05-03 14:16
You could tell them just that I think. Why should you put the effort if they can't motivate you enough to go out your comfort zone? I'm assuming you not using Emacs is not hindering your (plural) productivity at work is it?
medwatt · 2022-05-03 14:16
Forgive my ignorance, isn't Doom just a config on top of emacs? So, emacs has to be built with native compilation support and so has nothing to do with Doom?
big_lentil · 2022-05-03 14:28
You're correct, I said that because I haven't really downloaded or used doom myself, so I considered the possibility that you may have downloaded a version of emacs specifically built for doom and bundled together with it, which upon some googling doesn't seem to be a thing
medwatt · 2022-05-03 14:33
I just built a version of emacs with native compilation. I can't seem to observe any difference compared to before. Where exactly would I be noticing the difference?
medwatt · 2022-05-03 14:35
Not really, because I am oblivious to what I don't know. I was also not sure I needed vim, but use it now on a daily basis as my default text editor.
big_lentil · 2022-05-03 14:43
It should provide an improvement of some degree in all elisp packages that you use provided that everything works and the packages have been compiled to .eln files
martinslot · 2022-05-03 17:33
Just https://emacs.amodernist.com/ for a start. It is a good way to start. I use doom myself and the emacs configurator for a slim down version that i use in the terminal when editing config files.
trollhard9000 · 2022-05-03 18:38
I started using Doom 11 months ago, after using (neo)vim for 10 years. The speedup in emacs 28 with native compilation was huge. I'm not sure I would have kept using it with 27. As for LSPs, I haven't noticed any slower performance. LSP startup time is slow with both.
zqvt2 · 2022-05-03 18:42
If you're looking for quick productivity and can't invest what's going to be a pretty significant amount of time I'd recommend to not use Emacs. It's not just a text editor, it's an entire LISP environment that does many things differently than you're used to. There's nothing wrong with sticking with vim if you're mainly looking for a smooth editing experience but that is not Emacs' selling point. What Emacs is all about being transparent, configurable and a whole system for a wide range of tasks, and that by definition will consume a lot of time to learn. Now if you want to invest some time I'd suggest not to watch videos so much as to just use Emacs without any prebuilt config. It has a lot of tutorials available right on launch, and your biggest helper will be `describe-symbol` which will lead you to documentation for just about anything you can interact with in Emacs. If you're starting with a complex distribution like Doom that hides a lot of complexity and something doesn't work you'll always be in a lot of pain. It's learning form the wrong end.
medwatt · 2022-05-03 18:46
Have you seen the video I posted? If so, do you notice the lag until diagnostic information appears? I haven't added a single thing to my config. All I've done is unconment the python line in the init.el. Is that all it takes ?
srjjj · 2022-05-03 18:54
not sure if this is your case, but emacs is really slow on Windows. Emacs loves Linux.
corvus_carpe_noctem · 2022-05-03 19:45
Is doom emacs really that slow? I been learning emacs and trying to config but like you said, its just too frustrating to spend so much time researching. So I am thinking about using Doom but there are too many complaints about it being slow, I am a little hesitant to use it
trollhard9000 · 2022-05-03 19:53
You probably need to rebuild doom. Doom takes about 10 minutes to natively compile everything.
medwatt · 2022-05-03 19:56
I already did that when I first installed the version with native compilation.
trollhard9000 · 2022-05-03 20:01
neovim might be faster than emacs. Yes, you need to uncomment python, but you need to change it to `(python +lsp)` to enable lsp for python, and also uncomment `lsp` under `:tools` in init.el. [module info](https://github.com/doomemacs/doomemacs/blob/develop/modules/lang/python/README.org) Then `SPC h r r` to reload your config.
medwatt · 2022-05-03 20:18
Just did; it made no difference. Let me don't waste your time any more.
Similar35P · 2022-05-04 00:09
I've been using Doom Emacs for some months (Still haven't made my own config) and it is definitely slower than neovim (28.1 Natively compiled on M1 Pro), at least on my experience. I watched these videos to understand how to use it [https://www.youtube.com/watch?v=rCMh7srOqvw&list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj](https://www.youtube.com/watch?v=rCMh7srOqvw&list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj)
[deleted] · 2022-05-04 03:08
[deleted]
medwatt · 2022-05-04 08:00
It'll be strange to deliberately make the editor unresponsive.
throwawayzusu · 2022-05-04 09:11
The system crafter videos are well, well worth it (https://www.youtube.com/watch?v=74zOY-vgkyw). I have also tried Emacs in the past but was left with a setup I didn't full fall in love with and required too much tweaking to get right. Back then however, these videos didn't exist, and LSP-mode also didn't exist. Those videos have given me a good configuration starting point with all the useful plugins that most people are using with minimal setup. LSP Mode adds the IDE superpowers I get with vs-code and other tools (for the most part).
paretoOptimalDev · 2022-05-05 01:02
What are the lsp delay related variables in emacs and vim set to?
paretoOptimalDev · 2022-05-05 01:08
There's no point in hitting the lsp server every 0.000001 seconds. I think flycheck defaults to 0.1 seconds which i notice a delay with. It'll depend on your system, but i've had luck with 0.03 seconds across many different lsp servers and machines.
takutekato · 2022-05-08 11:24
No it's now Doom's fault, that's just the default delay of `flycheck` [https://discourse.doomemacs.org/t/diagnostic-delay-in-doom/2618](https://discourse.doomemacs.org/t/diagnostic-delay-in-doom/2618)