An open API service indexing awesome lists of open source software.

https://github.com/adamzaninovich/doom-emacs-config

My config for DOOM Vimacs GNU run free run GNU DRM FREE EMACS
https://github.com/adamzaninovich/doom-emacs-config

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

#+title: DOOM Vimacs GNU run free run GNU DRM FREE EMACS
#+author: Adam Zaninovich

* Table of Contents :TOC_2:noexport:
- [[#description][Description]]
- [[#features][Features]]
- [[#installer-macos-only][Installer (macOS only!)]]
- [[#prerequisites][Prerequisites]]
- [[#installing-emacs-on-macos-with-homebrew][Installing Emacs on macOS with Homebrew]]
- [[#fonts][Fonts]]
- [[#setup-elixir-ls][Setup Elixir LS]]
- [[#todo][Todo]]
- [[#troubleshooting][Troubleshooting]]

* 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.

#+ATTR_ORG: :width 600
[[./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][Setup Elixir LS]] below
+ I'm still debating the benefits of the full language server verses just using [[https://github.com/tonini/alchemist.el][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 [[https://github.com/tonini/alchemist.el][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 [[https://github.com/hlissner/doom-emacs/blob/develop/docs/getting_started.org#on-macos][doom emacs readme]]. You can see a list of available options and icons on the [[https://github.com/d12frosted/homebrew-emacs-plus#emacs-27-and-emacs-28-options][emacs-plus readme]].

#+begin_src shell
brew tap d12frosted/emacs-plus
brew install emacs-plus@28 --with-nobu417-big-sur-icon
#+end_src

*** 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!

#+begin_src shell
cp -r /opt/homebrew/opt/emacs-plus@28/Emacs.app /Applications
#+end_src

** 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)

+ [[https://github.com/adamzaninovich/fira-code-nerd-font-linux-mac-otf][FiraCode Nerd Font]] (This is my own version, but you can also get it from [[https://www.nerdfonts.com/][nerdfonts.com]])
+ [[https://overpassfont.org/][Overpass]] (It's pretty ¯\_(ツ)_/¯)
+ [[https://developer.apple.com/fonts/][SF Pro]] (Default system font in macOS that for some reason you have to download to use yourself)
+ [[https://www.cufonfonts.com/font/myriad-pro][Myriad Pro]] (A proprietary Adobe font from a shady Turkish website, what could go wrong?)

** Setup Elixir LS
These steps are taken from [[https://dev.to/mariomazo/elixir-and-doom-emacs-m29][this blog post]]
*** Install the language server

#+begin_src shell
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
#+end_src

*** Add elixir-ls to your path
Add elixir-ls to your =PATH=

#+begin_src shell
export PATH=$PATH:$HOME/.elixir-ls/release
#+end_src

*** Add your env variables to doom
You need to add your environment to doom so that it has access to your path

#+begin_src shell
doom env
#+end_src

*** Activate lsp and elixir with lsp support
In [[file:init.el][init.el]] make sure that =lsp= is active as well as elixir's lsp flag =(elixir +lsp)=

*** Sync doom to install packages

#+begin_src shell
doom sync
#+end_src

*** 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 [[file:config.el][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!