Awesome Open Source
Awesome Open Source

My private doom emacs config

This is my private doom emacs configuration. Specifically configured for Javascript, Python, C++, Rust, and Go.

Table of Contents



Step1: Install Emacs


  • Method 1: Use brew cask(Recommended). Pick emacs-mac or emacs-plus.
    brew tap railwaycat/emacsmacport
    brew install --cask emacs-mac
    brew tap d12frosted/emacs-plus
    brew install [email protected] --with-native-comp
    # create alias in /Applications if needed
    ln -Fs `sudo find /usr/local/Cellar/emacs-* -name ""` /Applications/


# Ubuntu emacs
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt-get update
sudo apt install emacs27
# Arch
sudo pacman -S emacs

Step2: Install Doom Emacs

# Clone Doom Emacs
rm -r ~/.emacs.d
git clone --depth 1 ~/.config/emacs

# Clone my config
git clone ~/.config/doom

~/.config/emacs/bin/doom install

Step3: Dependencies and Configuration

This Emacs configuration is written for Emacs 25.1+ on Mac OS X 10.11+ and Linux Arch. Windows users may need to tweak the config for themselves.

Dependencies needed

Install dependencies including search tools, utils, and linters.


# search tool
brew install ripgrep grep exa zstd fd
brew install --HEAD universal-ctags/universal-ctags/universal-ctags
# utils
brew install sqlite hub gpg2 coreutils gnu-tar mplayer direnv libtool git-delta
# language
brew install shellcheck aspell languagetool clang-format google-java-format
Arch Linux
sudo pacman --needed --noconfirm -S sqlite ripgrep fd wmctrl exa languagetool zstd ctags git-delta

Note: for windows users, aspell is used instead. ripgrep can be installed via choco

# Install linuxbrew
sh -c "$(curl -fsSL"
# Then follow the macos installaion guide except the Cask part
  • For vterm
brew install cmake
sudo apt install libvterm-dev libtool-bin
Install CJK fonts for your linux machines if you use them.


npm install -g cspell prettier


pip3 install --upgrade pylint gnureadline black cpplint

go: This module requires a valid GOPATH, and the following Go packages:

# macos
brew install go

# arch
sudo pacman --needed --noconfirm -S go

Language Server Protocol: Install the lsp for your languages. A few examples are listed below.

You can always do M-x lsp-install-server to install the specific language server. But I prefer to script them and install them at once.

# python
npm i -g pyright
pip3 install --user debugpy

# Java
# Java 11 is needed for latest to function
# M-x lsp-install-server -> jdtls

# Bash
npm i -g bash-language-server

# C++ use clangd
brew install llvm
# Run ~M-x dap-codelldb-setup~ to download the ~codelldb~ vscode extension.
# You can refer the debug template here

# Rust
rustup update
rustup component add rls rust-analysis rust-src

# Javascript
npm i -g typescript typescript-language-server

# Vue
npm install vue-language-server -g

# gopls
go install[email protected]
# Run ~M-x dap-go-setup~ to download the vscode debug extension.

For MacOS, according to the discussion here, the following codes will speed up Emacs GUI startup time.

defaults write org.gnu.Emacs Emacs.ToolBar -string no
defaults write org.gnu.Emacs Emacs.ScrollBar -string no
defaults write org.gnu.Emacs Emacs.MenuBar -string no


An in-depth list of features, how to use them, and their dependencies.


How to configure this module, including common problems and how to address them.


Ctags reference

Use Meta key in terminal

I have to use ssh with tmux on server. And terminal emacs becomes my daily driver. Checkout Alacritty keybinding config to make you terminal compatible with Meta keys.


  • Include a list of ways this module changes default behavior


How to manage tab-width or indent?

You can use `setq-hook!` to set the tab-width explicitly.

(after! cc-mode
  (setq-hook! 'cc-mode-hook tab-width 2 c-basic-offset 2))

I prefer to use a global `~/.editorconfig`, it can be override by a project local `.editorconfig`. Checkout mine. `setq-hook!` wii be overrided by editorconfig since editorconfig gains the highest priority.

How to use Magit Forge?

  • Create a token on Github with repo, user and admin:org permissions. If using GitHub enterprise / for business you also need the write:discussion, read:discussion scope.
  • Put the following credential in /.authinfo.gpg (This location is configured by auth-sources).
    machine login yourlogin^forge password MYTOKENGOESHERE
    machine login yourlogin^code-review password MYTOKENGOESHERE

See and

Why my jdtls java fails at booting?

Sometimes it caused by legacy cache under lsp-java-workspace-dir. Delete that folder and restart lsp.

Why sometimes the floating error boxes (flycheck posframe) do not disappear?

Call posframe-delete-all to get rid of it.

How to use forge?

Take a look at this manual. See how to create token for forge. Create the token with the full repo access. Then in the magit status buffer, use @ to dispatch the forge menu.

How to use emacs-everywhere?

Create a Automator workflow like this And bind it to some key in Settings->Keyboard->Shortcuts->Services. You need to add Emacs to the Settings->Security&Privacy->Accessibility. Then select some text and press the key. Unfortunately, I didn’t find a way to automate pasting. You’ll need to press the key Cmd-v to paste it after editing.

When you do `doom upgrade` and get too many open files issue on MacOS.

Use ulimit -n 10240 to increase the limit. See post here

When open in ssh tty, clipetty emit: `Opening output file: Permission denied, /dev/pts/3`.

See discussion here Try `unset SSH_TTY` and then restart your emacs.

Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Shell (171,287
Install (14,886
Emacs Lisp (10,418
Emacs (9,827
Doom (971
Ctags (910
Cask (846