Updated: 2022-08-01

Some tips to learn the keybindings in Doom and Evil in the process of migrating from my vanilla Emacs settings. For overview of keybindings type SPC-h-b-b. Other good references:

Nice Doom Emacs Cheatsheet from niyumard.

Doom leader-key is SPC and localleader-key is SPC-m. When in Insert mode use M-SPC or M-SPC-m to call the menu available as in the Normal mode. Else change mode with ESC or jk binding. To toggle between Emacs state and Evil use C-z.

To show all your keybindings SPC-h b b

Most used keys

There are keys I mostly need to remember and there are also listen in their respective groups below:

Normal mode

Insert mode

Visual mode (v) or Block Visual mode (Ctrl-v)

When in the Normal mode:

Editing

In Normal mode:

In Insert mode:

In Visual mode:

Multiedit

In a file one at a time

Doom uses multiedit package otherwise it’s like multiple-cursors package plus iedit package. Basic keybinding is M-d or M-D. It works both in Normal and Visual mode.

In Normal mode, when the course under a word, pressing M-d will select the word, repeating M-d mark forward and M-D mark backward. Use C-n and C-p for next and previous selected word. In Visual mode, when you have made selection pressing R will select all the marked section in the whole document.

Press Enter to deselect or reselect the marked section.

All in a file

Select the text then R

Search and replace in a project

Add text at first line of multiple lines

This is when you want to change multiple first lines (Ref.):

Different approach to search

Project

M-x consult-ripgrep

Nice function for flexible search

Regular expression

Good to know

Update Doom

Usually it should work to update Doom by running

~/.emacs.d/bin/doom upgrade
~/.emacs.d/bin/doom sync

But if it fails, you can delete the package that fails. For instance if package gcmh fails then

rm -rf ~/.emacs.d/.local/straight/gcmh
doom sync

The easiest is to delete folder .local/straight entirely before doom sync. Or pull everything and re-install

cd ~/.emacs.d
rm -rf .local
git pull
bin/doom install

Install required files

You need to install some prerequisite to make doom work properly. Among them:

cd ~/Downloads
curl -LO https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb
sudo dpkg -i ripgrep_13.0.0_amd64.deb
sudo apt install hunspell
doom  tips 
comments powered by Disqus