Comment by krupan
6 hours ago
In case you don't understand the problem here, an emacs instance can be split into multiple "windows" and there are emacs key bindings to create and destroy these windows, move the "focus" from one window to another, resize the windows, etc. For many of us, this was our introduction to a tiling window manager experience before we'd ever heard of tiling window managers.
When we switched to using a tiling window manager for all our windows, we ran into a muscle memory problem. We were used to jumping between emacs windows/buffers using C-x o and C-x b and then without thinking about it we'd try and use the same keys to jump between i3/sway windows and of course it doesn't work. Or vice versa, trying to use i3/sway shortcuts to switch emacs windows/buffers.
To try and solve this problem I've been using less emacs windows and more i3/sway windows, so I can just use i3/sway keybindings everywhere, but emacs puts up some resistance to that. I like this approach
I'd be surprised if someone hasn't already solved this. I'm not an Emacs user myself but try searching for something like "seamless <tiling_system> <tiling_app> navigation site:github.com". I've seen several scripts/plugins to setup seamless navigation between i3/tmux, tmux/Vim, i3/tmux/NeoVim, i3/Zellij etc.
Recently I hacked together a Bash script for seamless navigation between i3 windows/tabs and Kitty windows/tabs using i3-msg, xdotool, jq, kitty's remote control sockets. Now if I only figured out how to add Helix windows into the mix...
Sometimes thinking outside the box helps. I've been able to unify a lot of keybindings by using a context aware remapping tool such as Keymapper (https://github.com/houmain/keymapper.
I can relate, finding myself pressing the wrong keybindings when moving between i3 and emacs windows. The idea in the post is interesting but I am not sure how I’m going to solve this. I have been thinking about trying EXWM or switch to another WM. Tried KDE but it didn’t have support for multiple workspaces in the secondary screen. And after using i3wm I found it difficult to get back to other WMs.
Yep, I still find emacs' window management bindings more intuitive than any tiling window manager I've used. So much so that I thought naively that things like exwm would "solve" this problem for me. But in fact -- beyond being janky / single-threaded -- they don't really because you still end up with competing bindings.
I think the more elegant model would be for the window manager to own all the window management keybindings and then for there to be a background emacs-like process that owns the buffers (and the remaining keybindings) and can present them in standalone windows which the window manager presents. With some kind of IPC between the two for coordination, I guess.
I don't think GNU Emacs itself works well with this model tho. Its "server" mode is something else entirely.