UP | HOME
mattduck
PostsEmailRSSGithubCVEmacs.London  

2020-Mar-03

More Emacs fuzzy integrations

A week ago I wrote about using a Helm pop-up frame as fuzzy launcher, to provide an Alfred-like interface for launching programs, running system commands and making web searches.

Since then, I've added some new integrations that I'm finding really useful, and I'm wondering why I didn't write them a long time ago.

1. How it looks

Everything below is using the Emacs theme named intellij.

1.1. Opening org-mode headlines

This opens a headline matching a particular keyword in a popup frame, using an indirect buffer:

Emacs Alfred gif

1.2. Running org-capture from anywhere

This displays a frame which is automatically closed when the capture is finished:

Emacs Alfred gif

1.3. Stopping the org-mode clock from anywhere

I always found it awkward that I had to open an org-mode buffer in Emacs just to clock out:

Emacs Alfred gif

1.4. Serving a particular directory

There isn't much to see here, but in the background it's starting a webserver in a pre-configured directory:

Emacs Alfred gif

1.5. Listing and killing processes

This could easily be extended to add other actions, eg. yanking the PID:

Emacs Alfred gif

1.6. Opening directories with a file browser

This uses fd to find directories:

Emacs Alfred gif

1.7. Opening files with their default program

This uses fd to find files, and xdg-open to open them:

Emacs Alfred gif

2. Emacs features now feel natural from anywhere

Certain Emacs features are core to how I work. I don't mean coding features, but managing my work: capturing notes quickly in meetings, checking my outstanding notes for the day, recording time spent on particular tasks, etc.

I want these features to be available at all times, and I want invoking them to feel second nature. Not because it saves any substantial amount of time, but because it minimises interruption, and keeps me focused on the content of my work.

Although I've always been very quick at invoking commands in Emacs, it hasn't always felt like a natural interaction. I have to bring up Emacs in my window manager, potentially mess up my existing buffer arrangement, and display unrelated work side-by-side (eg. my org-capture window will appear alongside the code that I was working on).

This popup frame approach fixes that: I'm now one global keybinding and a couple of letters away from whatever I need. It feels much better, and I expect it to become a permanent part of my workflow.

3. The code

You can find the code for everything above in my dotfiles. It's all very similar to my previous post, which covers the base "Alfred" code in more depth, including the i3 settings to create a global key binding and configure floating frames.