How I am deeply integrating Emacs

2 hours ago 1

img

Emacs has holistically become my daily computing environment.

My efforts have been focused on building emacs into the workflow of essentially everything I do, as long as it doesn’t involve heavy video or media, I try my very best to accomplish it in emacs. The idea is to achieve deep integration with everything I do on a computer, to the degree my thoughts are immediately able to be acted upon in the buffer.

I use hyprland as my window manager, and while I have heard of other managers/DEs (I was using GNOME for the better part of 6 months), I keep coming back to hyprland just because it works and is easy to configure. Also, for some reason, I seem not to have laggin in emacs on wayland in hyprland, while I had to previously run emacs in X11 mode in GNOME, go figure.

My Motivation#

I have seen what people are capable of doing when their tools get out of the way, and they are free to just create. This is how world class athletes, musicians, artists, writers, and of course programmers take what is in their mind and translate it into reality. The idea is that if I can learn this “editor of a lifetime” - then the things that I want to create, the programs I want to write, will be achieved in a near frictionless environment, allowing for velocity that is not possible elsewhere. It is the ultimate sharpening of the axe before chopping the tree.

Why not EXWM?#

I have considered using EXWM as the window manager (quite literally offloading window management to emacs, and “living in emacs” - to more of a degree than I do already), the hesitation I have is that:

  1. Emacs is single threaded, therefore if anything in the system hangs, the whole system hangs, and
  2. It is only X11 where most of the development and forward movement in the linux space has been in wayland. While I understand this is not a tremendous issue, wayland does seem to be where the puck is going.

So, what I am aiming to do is replicate functionality as best as I can from EXWM to a wayland environment - not wholly possible, but also not wholly impossible, either.

The Emacs Launcher program#

If you look at my dotfiles, you can see I have a script written in Go that allows me to call each and every one of my emacs controls anywhere is my system. I was previously calling each of these emacs commands in bash and with a sleep command so as to make sure I was targeting the emacs instance. No longer. This Go script has sped up my workflow by 10x.

My Current setup#

How I Launch Emacs#

bind = $mainMod SHIFT, E, exec, bash -c "emacs"

I almost never press this keybind, as emacs is opened from the get-go in my hyprland sessions. For that rare time I need to re-open it.

Opening vterm as my default terminal#

bind = $mainMod, E, exec, emacsclient -n -e '(my/new-frame-with-vterm)'

This permits me to quickly open a vterm window and enter commands etc. If I need anything that is more graphically intense, I fallback to kitty terminal, but this is less and less these days.

Opening vterm in my emacs session quickly for in projects is done like so:#

bind = $mainMod, RETURN, exec, ~/.config/hypr/scripts/emacs-launcher '(my-open-vterm-at-point)'

Universal Launcher#

bind = $mainMod, SPACE, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (universal-launcher-popup))'

I wanted to replicate a launcher (similar to wofi/rofi) in which I could easily launch apps and switch to them in the environment.

So, my take on this is to replace wofi with this functionality. I was using ssh providers in GNOME, but then brought the functionality into my universal launcher. It has effectively grown to encapsulate:

  • Passwords
  • SSH
  • Bookmarking
  • Commands and program launching
  • Emojis
  • TODOS (though org-agenda/calendar also handles this)
  • File navigation
  • Web and documentation search

While this is a work in progress, I use it every day, hundreds of times a day, and love the flow & speed my launcher allows.

Capture to org mode#

bind = CTRL SHIFT, c, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (org-capture))'

When I am not “in” emacs (I am always in emacs by extension) I can still capture direct to emacs with a quick keybind.

I capture to my org directory:

  • notes
  • bookmarks
  • contacts
  • inbox (todos)
  • events/deadlines

This is very useful when I am wanting to save a thought, idea, bookmark, quote, what have you, and then integrate it with my org-roam file structure.

Notes#

bind = $mainMod CTRL, N, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (find-file "~/org/notes.org"))'

I can navigate to my notes file very quickly to write emails, keep notes on stuff, and then translate those into my org-roam directory, too.

Calendar/Org Agenda#

bind = $mainMod, C, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (=calendar))'

bind = $mainMod, N, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (my/org-agenda-dashboard))'

Quick access to my agenda and calendar from anywhere.

Password manager#

bind = $mainMod, P, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (pass))'

Password-store inside emacs to create, update, grab passwords and insert them on page in browsers.

File Browsing#

bind = $mainMod, F, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (dirvish))'

I use dirvish/dired for nearly all my file browsing and manipulation. I have some binds that allow me to pull up thunar for graphical drag-drop operations, but other than that files are dealt with inside emacs.

The killer feature is that you can edit files as you would edit text, nothing else comes close.

Bookmarks#

bind = $mainMod, B, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (find-file "~/org/bookmarks.org"))'

Bookmarking within emacs allows me to keep all sites top of mind.

Email#

bind = $mainMod, M, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (=mu4e))'

The greatest email client.

Feed reader#

bind = $mainMod CTRL, Z, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (elfeed))'

Reading any feed from around the web, I follow youtube, blogs, news, etc. here - never going out to the web to read anything.

Music playing#

bind = $mainMod CONTROL, M, exec, ~/.config/hypr/scripts/emacs-launcher '(progn (select-frame-set-input-focus (selected-frame)) (emms-playlist-mode-go))'

You thought I wouldn’t play music in emacs?

Emacs everywhere for editing text anywhere#

bind = $mainMod CONTROL, E, exec, emacsclient --eval '(thanos/type)'

When you are in a text box on any site, you can just edit the text in emacs, press C-c C-c and have it pasted right there for you.

Will I use EXWM?#

I think that because I spend so much time inside emacs, I don’t really get the benefits of everything being a buffer. I only use a browser for projects, not as a window I have always open, and I don’t really need emacs to control buffers or give me the keybinds universally. I will never say never though, perhaps one day it will be my window manager of choice.

How are you integrating emacs in your workflow? I would be super interested to see other setups that allow you to use emacs as your one, true, holistic computing environment. Shoot me an email and tell me how it’s done!

As always, God bless, and until next time.

If you enjoyed this post, consider supporting my work by Buying me a Coffee, Checking out my book, or sending me an email to tell me what you think.

Read Entire Article