Tile Split Tile Split Tile (rants)
I love tilling window managers,it split my display in halves.
I love tmux, it splits my terminal in halves
and I love vim, it splits my workspace in halves
§ The cursed
+-----------------------------------------------------------------------------+
| | vim split: main | |
| | | |
| split | | |
| | | |
| files | > My lovely code | |
| tags | | |
| lists | int super_safe(char* str) | |
| | { | |
| | gets(str); | |
| | } | Browser |
| | | |
| |2 | 5 |
| +---------------------------------+-----------------------------------+
| | | |
| | | |
| | vim split: quick fix list | Anime girls |
| | | |
|1 |3 | |
+-------+---------------------------------+ |
| Terminal Split : shell prompt | |
| | |
|4 | 6 |
+-----------------------------------------------------------------------------+
Now my biggest headache is how to navigate through the panes!
The problem is that each level (wm/tmux/editor) has its own modifier key (and
keybindings). Currently I use Mod (win)
key for window manager, Alt
(or
prefix Alt-W
) for tmux and Ctrl
(or prefix Ctrl-W) for vim. That is, to
switch from 5 to 2 I need:
(PRESS Mod-H)
(IF in 4) (PRESS Alt-K) (ENDIF)
(IF in 1) (PRESS Ctr-L) (ENDIF)
(IF in 3) (PRESS Ctr-W) (ENDIF)
You constantly need to eyeball the cursor and DO A MAPPING IN YOUR HEAD: which fucking container am I in?
To make things even worse, each container has its own “workspaces”:
- WM has workspaces
- Tmux has sessions and windows
- Vim has tabs and buffers
>
A real-world example of the … well, not really, I’m intentially making it
more complicated than it has to be. But this screenshot is to show you what
atrocity you can get…
- My main workspace is on a server (left 3/5 of the screenshot). In which I’m editing multiple files at the same time and have a shell for quick debugging. of course this is tmux. If you work on a remote machine without attaching to tmux (or alike) you are out of your mind.
§ Hey, why do you use tmux when you have WM?
Well, when I work locally I avoid using tmux. But when I’m working on a server (I often do!), I have to use tmux because I don’t want to start multiple ssh sessions, and most importantly the workspaces SHOULD NOT be attached to a ssh session because if the network break or I accidentally kill the terminal the remote programs will be killed and the works will be lost.
§ Remedy…? just a wild idea.
Maybe we can have a plugin for.. say wlroots, to also identify tmux panes and vim splits and put them in WM’s window tree, so that we can navigate with only one set of keybindings..
Progressively:
- let tmux attach directly to a remote session. So I use one single instance of tmux.
- let nvim run in a daemon mode (not in its current state of server mode), so that you can access the same sets of opened buffers / plugin states from the different vim clients.
- make nvim aware if it’s attached to tmux: openning splits should be opened into a tmux split, as a neo vim instance attached to the same daemon.
/post/tiling