Skip to content

My config for DOOM Vimacs GNU run free run GNU DRM FREE EMACS

License

Notifications You must be signed in to change notification settings

adamzaninovich/doom-emacs-config

Repository files navigation

DOOM Vimacs GNU run free run GNU DRM FREE EMACS

Table of Contents

Description

Right off the bat, know that this is only tested on macOS (specifically the latest Big Sur on a M1 Macbook Air). There are many things specific to macOS, especailly the installer.

This is my personal Doom Emacs configuration. I’ve been a vim and neovim user for many years focusing on the core set of vim features with minimal use of plugins (yeah, I know, this is a big change).

This configuration should reflect that, at least a little bit, and will continue to do so even more in the future as I try to whittle down Doom Emacs to a smaller feature set over time.

./resources/docs/perfection-wide.png

Features

Here are a few features of this configuration:

  • Configured with a tangled Org mode file (config.org)
  • Starts maximized but not fullscreen (macOS)
  • Load private information from secrets file
  • Sets a random custom Doom Emacs banner at start
    • Pixelmator Pro template available on request
  • Sets snipe mode to not override S and s
  • Elixir autoformatting
  • Elixir Language Server support
    • This requires additional setup, see Setup Elixir LS below
    • I’m still debating the benefits of the full language server verses just using Alchemist which still provides quite a bit more functionality than I’m used to in my vim setup (which is basically only syntax highlighting and autoformatting)
    • If you don’t want to use the language server, simple change (elixir +lsp) to elixir in the init section of config.org and it will use Alchemist instead
  • Vim Vinegar style - keybinding to open Dired
  • PDF and eBook support
  • And more

Installer (macOS only!)

If you want to install everything automatically, just clone this repo to ~~/.config/doom~, cd into it, and run bash install.sh. Installation includes compiling emacs from scratch so it can take 15-30 minutes. The installer is safe and mostly idempotent (in the ways that count). You can also follow along by hand if you want in install.org.

Prerequisites

If you don’t want to use the installer, then you will need to set some things up. Make sure to visit the doom emacs repo and install the prerequisites listed there as well.

Installing Emacs on macOS with Homebrew

Tap and install

This may take a while to compile from source. By default this formula installs Emacs 27. I found that it had issues with screen flashes which I have not seen in version 28. Alternatively, you can always install emacs-mac instead. There is more information on the doom emacs readme. You can see a list of available options and icons on the emacs-plus readme.

brew tap d12frosted/emacs-plus
brew install emacs-plus@28 --with-nobu417-big-sur-icon

Copy Emacs to the Applications directory

Your path may be different. You can link it instead, but Alfred will not see it unless you make a copy. Remember to copy it again if you upgrade emacs!

cp -r /opt/homebrew/opt/emacs-plus@28/Emacs.app /Applications

Fonts

You don’t need all of these, only one of the 3 variable pitch fonts.

If you run the installer, these will be installed for you. (Aside from Myriad Pro, which I do not have a license to distribute)

  • FiraCode Nerd Font (This is my own version, but you can also get it from nerdfonts.com)
  • Overpass (It’s pretty ¯\_(ツ)_/¯)
  • SF Pro (Default system font in macOS that for some reason you have to download to use yourself)
  • Myriad Pro (A proprietary Adobe font from a shady Turkish website, what could go wrong?)

Setup Elixir LS

These steps are taken from this blog post

Install the language server

git clone https://github.com/elixir-lsp/elixir-ls.git ~/.config/elixir-ls
cd ~/.config/elixir-ls
mix deps.get
mix compile
mix elixir_ls.release -o release

Add elixir-ls to your path

Add elixir-ls to your PATH

export PATH=$PATH:$HOME/.elixir-ls/release

Add your env variables to doom

You need to add your environment to doom so that it has access to your path

doom env

Activate lsp and elixir with lsp support

In init.el make sure that lsp is active as well as elixir’s lsp flag (elixir +lsp)

Sync doom to install packages

doom sync

Restart emacs

Open an elixir project and look for the 🚀 in your status bar If you need to troubleshoot, use SPC b B and open *lsp-log* to see any error messages

Additional config

I have turned off lsp file watching in config.el since I was tired of it asking every time I opened a large project. Turn it back on if you want A better way would be to figure out how to get it to ignore certain files (like node dependencies, for instance), but I haven’t gotten around to that yet

Todo

  • Add lambdart/ob-elixir
  • Learn and Configure Org Capture
  • Sync Google Calendar with Org Agenda
    • Two-way sync preferred

Troubleshooting

🍀 Good luck!

About

My config for DOOM Vimacs GNU run free run GNU DRM FREE EMACS

Resources

License

Stars

Watchers

Forks