Emacs windows

I don’t like using any fancy packages that have it all figured out that I have to learn “on top” of Emacs. Just give me the basics and I have a few small tweaks on top of that.

DWM

First of all, I do sometimes like using several separate frames.

I run emacs --daemon so I can start new ones from the command line with alias ec="emacsclient -t" (opens in the same terminal) or with alias xec="emacsclient -c" (opens as a new X frame). ec is especially good when sshing in.

I also have emacsclient -c mapped to a global shortcut key so I can get to emacs even from other apps. I use dwm, so I have it mapped to s-super-e in dwm’s config.h.

I mean, I’m happy with dwm so I obviously don’t mind managing windows with it. I also use a web browser set to break out every tab into its own window for the same reason.

I close these pretty freely too, since I’m running the daemon I know that I can always reach emacs so there’s no fear of accidentally closing the last window.

These days, when I’m mostly using SSH and more rarely using dwm, I’m still using a couple of different tabs in the SSH apps.

god-mode override

For window splitting and deleting, I use the defaults (C-x 3, C-x 0 etc). I don’t know, I’ve just gotten used to them. I just started using this advice, to get two different buffers when I do split.

As recommended by god-mode, in addition to the defaults I have

just for when I’m in god-mode and I forget the space.

Splitting vertically, I’m pretty happy with having it split right down the middle but splitting horizontally can feel a li’l cramped on my 11″ screen. I don’t use cozify-window a lot but it’s nice to have:

this advice, to get two different buffers when I do split

god-mode

cozify-window

Finding that particular buffer

I don’t have anything special for finding and killing buffers, I find that C-x C-b, C-x b etc work well. After a while I got really sick of all the fancy icicle, iswitch stuff and just wanted to go back to the basics. The normal switch-to-buffer wasn’t giving me things in a good order with the souped up, Vertico completing-read, so I now use consult-buffer. It has the drawback that buffers are previewed but that’s sometimes a good thing.

The magical shell-key

I have a button that toggles the current window between a shell and itself. Now, I use C-z for this, I get that that overrides suspend-frame in the console (which I can remap, or call via M-x). But that’s why I chose that; I temporarily want to go from emacs to a shell and then back again and my finger was already used to hitting C-z for that.

Also since I usually don’t use god-mode in notmuch, outside of composing, I’ve mapped some of my favorite god-mode keys specifically:

I have something similar for Scheme and the Scheme REPL at C-c C-z.

Annoying splitting

Some of this breaks down if emacs gets to split the window on its own. You can either prevent specific buffers from splitting the window with

And, for Magit:

I love Magit, now that it doesn’t split the window on me anymore. With this code, when I make a commit, the diff comes up first which I can bury with Q. It’s only buried, I can still switch back to it if I need to check it more after I started writing the commit message. The message text is a li’l misleading (it starts talking about how to finish the commit message even though I’m looking at a diff) which is why there’s an official magit tutorial that sets it up so that the diff starts buried and you get the commit message right away. I tried that for a while but I’m pretty happy getting the diff first. I dunno.

I know that there’s alternatively a setting for making the frame “unsplittable” but that hasn’t been working very well, messing with completion buffers for example.

Proxied content from gemini://idiomdrottning.org/emacs-windows (external content)

Gemini request details:

Original URL
gemini://idiomdrottning.org/emacs-windows
Status code
Success
Meta
text/gemini; lang=en
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.