My Emacs journey (2) - Vanilla

My Emacs Journey

I’m from Madagascar, the world’s largest producer of Vanilla.
But today we are not here to discuss the Vanilla spice.
Instead, this is part of the My Emacs Journey series, and I’m going to talk about Vanilla Emacs!

If you’ve read my article on My note taking journey, you know I didn’t actually start with Vanilla Emacs. My journey began with Spacemacs, then moved to Doom Emacs before I finally decided to go Vanilla.
If you are curious about that last transition, then I invite you for another long read where I explain my reasoning in more depth.

My little story

When I was a kid, I would never drink tea without sugar. A lot of sugar, in fact!
As I grew older, I started to wonder why some people prefer their tea unsweetened.
I remember when I first tried natural tea, I was so disgusted, I wanted to spit it up!
But over time, I stopped wanting sugar and enjoy the tea in its purest form.
I realized the sugar was masking the tea’s true flavor.

Whereas before, I only craved sweetness, now I enjoy the scent and the relaxing feeling of drinking tea.
When removing the excess seasoning, I discovered a whole new realm of flavor.
I get to know the true taste of things.
It took some time to get accustomed though.

I found the same experience applies also to foods.
When I started using raw ingredients with less seasoning and salt, the true taste of the food began to emerge and become more distinct.
It takes a little while to adapt but eventually, your palate expands and you enjoy a wider range of flavors.
Cooking becomes simpler, yet more satisfying. And you are free to add your own moderate seasoning if you wish.

This principle seems to extend beyond food and drink.
I’ve noticed the same pattern with computers and programs.
Whether it’s Linux, Debian, Window Manager, terminal, Vim or now Emacs, every time I stripped away what I didn’t need, I didn’t lose anything.
Instead, I gained a deeper understanding.

The same principle seems to apply to life in general. But I should probably write another article for just that.

Let’s get back to Emacs!
While Spacemacs and Doom are fully functional and extremely configurable, there is something I was missing for not going Vanilla first: the true taste of Emacs.
I wanted to apply the above principle and see if I can truly understand Emacs and the Emacs way.
When I started to list all the functionalities I really used, it turned out to be just a few essentials.
And starting with only with those few essentials, I get to know how it feels to have everything under my control.

My minimal config

So what is the bare minimum Emacs configuration for me?
When I discussed Dired in my previous article, I emphasized the use of default Emacs with zero configuration.
That is perfectly fine, but sometimes you want things to be a little more tailored to “your taste”.
Not too much but enough to enjoy the experience of discovering and using Emacs.
Starting with the simplest form you can tolerate and then add your own seasoning from there.

For example, here is what I like to tweak with Vanilla Emacs to suit my taste:

  • Add MELPA repository for installing packages
  • Remove the menu bar
  • Remove the button controls. (because M-x is plenty!)
  • Add which-key for auto-discovering key sequences
  • And consult, vertico, and marginalia for a better M-x experience
  • And maybe add the Doom theme for improved visual

My current Emacs setup has evolved since then but these were my initial tweaks when I started.
Just enough not to get disgusted and leave!
With this simple config, I only have what I really use.
By doing so, I make sure my configuration grows in relation to my actual understanding of Emacs.

Install packages as needed

I’m careful of not adding extra lines I don’t use or something I don’t fully understand in my config.
Whenever I discover interesting packages, I first check if they really fit my workflow and can enhance my productivity.
If they do, then I install but not activate them by default.
If they don’t, then I don’t install them at all, no matter how cool they seems.
For example: Because of my Vim background, I sometimes feel the need for a quick Vim editing, so I have Evil-mode installed (M-x package-install <RET> evil <RET>) but I don’t activate it by default.
This keeps my Emacs experience unbiased and under control. Just like having sugar at home but only using it occasionally.

init.el

Here is my minimal init.el

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
;; Disable GUI elements for a cleaner look
(menu-bar-mode -1)
(when (featurep 'tool-bar)
(tool-bar-mode -1))
(when (featurep 'scroll-bar)
(scroll-bar-mode -1))

;; Package archives: Add MELPA
(require 'package)
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))
(package-initialize)

;; Bootstrap use-package for easier package management
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)

;; Doom themes for better visuals
(use-package doom-themes
:ensure t
:config
(load-theme 'doom-one t)) ;; Doom theme loaded

;; Consult for enhanced M-x and search
(use-package consult
:ensure t)
(use-package vertico
:ensure t
:init
(vertico-mode))

(use-package marginalia
:ensure t
:config
(marginalia-mode))

;; Which-key for keybinding discovery
(use-package which-key
:ensure t
:config
(which-key-mode)) ;; which-key enabled

;; Optional: Prevent Emacs from saving customizations in this file
(setq custom-file (locate-user-emacs-file "custom.el"))
(load custom-file 'noerror) ;; Keeps init.el clean[6]