Compare Doom-emacs, Spacemacs, and vanilla Emacs
I've been using Emacs for about 3 years. Within these 3 years, I used different configurations and frameworks:
- Spacemacs (v0.50 to v0.200)
- My vanila .emacs.d
- Spacemacs (v0.300)
- My customized Doom-emacs
- (Now)
I think I can write some of my thoughts on these 3 different kind of frameworks and it might be helpful for someone out there.
Spacemacs
IMHO, Spacemacs was and still is the best Emacs+Evil distribution, it's just not suit me anymore.
Best Emacs+Evil distribution
- When I started using Spacemacs, I've been using Vim for about 1 year and I
just wanted to use org-mode while still keeping my Vim experiences. There
were few distributions providing this kind of full Vim-like using experience
out there. Spacemacs did this by providing the
evilify
macros and automatically bind as many Vim keybindings as possible. - Spacemacs had and still has the best documentations for learning Emacs, evil-mode, writing layers.
Why I'm leaving Spacemacs
Spacemacs is getting overwhelmed by more and more users.
Spacemacs is a pretty popular Emacs distributions now, which also means there are more and more Spacemacs users who have little Emacs experience and cannot debug issues by themselves.
- Spacemacs now has 1642 opening issues and it's been like this for a long
time, even after several rounds of Autumnal Cleanup.
- It's a project that's pretty difficult to maintain by a few people now (thanks to these maintainers!).
- I also helped in Spacemacs Autumnal Cleanup 20151. There were already many issues then and it was pretty difficult to even check every issues. Some of them were caused by broken packages, some of them were questions, some of them were feature requests.
- Another drawback caused by its popularity is that the new stable release
takes longer time.
- The last stable release (v0.200.8) was released 10 months ago.
- The next stable release number is v0.300.0, which will break many things compared to current master branch.
- Since there are a lot of users using Spacemacs now, it's hard to release a new stable version with many break changes. The master branch becomes inactive now.
- Although I can use
develop
branch, but it's not stable enough and I need to check updates manually every now and then.
- Spacemacs now has 1642 opening issues and it's been like this for a long
time, even after several rounds of Autumnal Cleanup.
- I started building my own layers instead of using the default ones
- After learning Emacs for 3 years, I've realized that the main point of using Emacs is to build a text editor that suits my personal needs perfectly.
Spacemacs is used by many users so it cannot be a personal configuration.
- I don't like some keybindings defined in some layer, so I need to reset them again.
- I don't need some packages provided by a layer I'm using (e.g.
evil-escape
), so I need to exclude them. Although it's the best evil distribution, it's still not enough sometimes.
For example, no layer is setting
evil-declare-ignore-repeat
so that the unrepeatable commands or commands that's not editing the texts likesave-buffer
,rspec-rerun
are interfering with the repeat commands list.
So I started building my own layers instead of using the default one, my customization to Spacemacs becomes another heavy Emacs configuration. The point of using Spacemacs to share a reasonable configuration with the Spacemacs community has lost its sense to me.
Spacemacs is not a good Emacs configuration framework yet
The next thing I need to consider is whether Spacemacs is a good framework to build my own configuration on. Unfortunately, the answer is no.
- Although the layer system was designed to separate different features,
they are still coupled within the current system.
package loading coupling
Take
spacemacs|use-package-add-hook
for example, I have a layer calledpost-config
to customize some packages behavior, this hook system doesn't work very well:(defun post-config/pre-init-company () (spacemacs|use-package-add-hook company :post-config (define-key company-active-map (kbd "C-n") 'company-select-next) (define-key company-active-map (kbd "C-p") 'company-select-previous) (define-key company-active-map (kbd "C-w") 'evil-delete-backward-word)))
If I want to add a
post-config
forcompany
, I need to define apost-config/pre-init-company
function first, which doesn't make much sense to me.package config coupling
I have another post-config for
evil-lion
:(defun post-config/pre-init-evil-lion () (spacemacs|use-package-add-hook evil-lion :pre-init (progn (evil-lion-mode) ;; overwrite spacemacs config for evil-lion to use gl and gL keybindings ;; for evil-lion nil)))
I need to prevent Spacemacs' config for
evil-lion
to run to prevent it to use the default evil-lion keybindings.
The base ground is not clean enough (even with
spacemacs-base
)There are many packages I don't need from many layers. They do add some improvements here and there, but also introduce bugs/performance issues here and there.
I ended up with excluding ~50 packages from my Spacemacs. Then I think, why not just install what I need and build my personal emacs configuration.
The performance is not the best
Spacemacs came out way before
use-package
came out, so many packages were not lazy loaded properly. Although it's migrating touse-package
, it's still feels slow sometimes due to too many packages.
- Although the layer system was designed to separate different features,
they are still coupled within the current system.
My vanila emacs
Thanks to the evil packages extracted from Spacemacs or arose from the evil
community these years, I can get most of the Spacemacs experience by just adding
some packages2.
So I started building my own .emacs.d
3, here are the pros and cons I found:
- Pros
- Performance is good.
- Everything is configured by myself. So I know almost everything about it.
- It's easy to test a new package and see if it suits me and my workflow.
- Cons
There are a lot of redundant works.
I learned Emacs basically by using Spacemacs and I'm quite familiar with the Space key as the leader key style keybindings. So I used general4 to set these leader keys.
Most of the time, I was just copying config from Spacemacs and modify a little bit.
There are a lot of maintenance works to do.
Since I need to keep my
.emacs.d
under version control and I tend to keep commits small, sometimes it's easy to get it out of control. (I still have 12 unstaged files on my local machine in this directory.)Aside from this maintenance burden, it's also harder to build a better Vim experience without the help of spacemacs helper functions/macros like
evilify-state
.It's just time consuming.
I want to put most of my free time on coding, reading, writing, instead of giving it back to emacs. So I started to looking for better frameworks to build upon.
doom-emacs
Luckily, doom-emacs is a great configuration that I can easily customize and extend. Here are the pros and cons I found:
- Pros
Performance is the best.
With the optimizations5 done by hlissner, doom-emacs (~3s) starts way faster than Spacemacs (~12s) or my
.emacs.d
(~8s). And it feels snappier when I'm using it.Upstream updates frequently
The maintainer of doom-emacs, hlissner, commits and pushes his changes pretty often. (~100 commits per weekend) I learned a lot from reading his code and asking for his advice on my PRs.
It's a more hard-core Emacs+Evil distribution
As it's said in its description, doom-emacs is an Emacs configuration for the stubborn martian vimmer.
For example,
+evil*fix-dabbrev-in-minibuffer
makes the evil ex commands auto completion behavior more likes vim. And so many other evil patches (sometimes I really wish they can become the default behavior of evil)It's a great framework to build upon.
doom-emacs provides many macros making configuring emacs easier, like
package!
,def-package!
,map!
, etc..And one of the most important feature is that it lets user to bind the keybindings, instead of providing a default one.
- Cons
The default keybindings are not very Spacemacy.
But since I only use it as a configuration framework, and build my own modules upon its core. So I can take that.
Excluding packages is not easy.
Although doom-emacs provides
package!
macros, I still couldn't find a easy way to exclude a package completely.- Module ecosystem is not as good as Spacemacs
My final solution
So I ended up with this solution: maintaining my own fork of doom-emacs.
I also tried to maintain my own fork of Spacemacs but failed because it's a larger project and I was not very good at using Git at that time.
Maintaining my own fork lets me:
- Exclude unneeded packages easily.
- Fix issues quickly.
- Merge optimizations from upstream easily.
Of course, at the same time, I'm also pushing my fixes for broken packages to upstream and trying to make doom-emacs better.
As it was said, your editor configuration is the biggest project in your life6. I hope I can build an editor that suits me perfectly in this life. And a million thanks to the maintainers of these great distributions!