/doom-config

Blazing fast Doom Emacs private configuration

Primary LanguageEmacs Lisp

My private doom emacs config

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

Table of Contents

Screenshot

Installation

Step1: Install Emacs

MacOS

  • Method 1: Use brew cask(Recommended)
    brew tap railwaycat/emacsmacport
    brew cask install emacs-mac
        
  • Method 2: Just brew, need compiling. (more customization)
    brew tap railwaycat/emacsmacport
    rm -r /Applications/Emacs.app
    brew install emacs-mac --with-modules --with-natural-title-bar
    # create alias in /Applications
    ln -Fs `sudo find /usr/local/Cellar/emacs-mac -name "Emacs.app"` /Applications/Emacs.app
        

    Notes: (just for method 2)

    1. natural-title-bar usage here.
    2. Solution to incoming network connection: Codesign your Emacs.app. Instructions over here. codesign --deep --force --verbose --sign ztlevi /usr/local/opt/emacs-mac/Emacs.app

Linux

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

Step2: Install Doom Emacs

# Clone Doom Eemacs
rm -r ~/.emacs.d
git clone https://github.com/hlissner/doom-emacs -b develop ~/.emacs.d

# Clone my config
git clone https://github.com/ztlevi/doom-config ~/.doom.d

~/.emacs.d/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.

OS

MacOS
# search tool
brew install ripgrep grep exa zstd ctags fd
# utils
brew install sqlite hub gpg2 coreutils gnu-tar mplayer direnv libtool
# language
brew install shellcheck aspell languagetool clang-format
# Cask
brew cask install xquartz
Arch Linux
sudo pacman --needed --noconfirm -S sqlite ripgrep fd wmctrl exa languagetool zstd ctags

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

Ubuntu
# Install linuxbrew
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
# Then follow the macos installaion guide except the Cask part
  • For vterm
brew install cmake
sudo apt install libvterm-dev libtool-bin

npm

npm install -g cspell prettier import-js

pip

python3 -m pip install --upgrade pylint gnureadline black grip 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.

# python
# for msplys M-x lsp-python-ms-update-server, and remove `lsp-python-ms` from `packages.el`->disable-packages!
# for pyls, anaconda pip fails on Arch Linux. I need to use system pip (/usr/bin/pip3) instead
pip3 install --user --upgrade 'python-language-server[all]' pyls-mypy pyls-isort

# Bash
npm i -g bash-language-server

# ccls: https://github.com/MaskRay/ccls/wiki/Getting-started
brew tap twlz0ne/homebrew-ccls
brew install ccls

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

# Javascript
npm i -g typescript

# Vue
npm install vue-language-server -g

# gopls
go get -u golang.org/x/tools/gopls

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

Features

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

Configuration

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

Appendix

Commands

  • A list or table of public commands (and their keybinds) and functions that this module exposes.
  • A brief description of how to use them

Hacks

  • Include a list of ways this module changes default behavior