Using Tmux the Way I Want

So I’ve begun typing up notes on how I’m revisiting how I do software development (hobby, professional). I’ve heard furtive whispers of this tool, tmux, and how amazing it is. Youtube, oddly, seems to be a valuable resource for learning about this stuff, so I found a few popular-seeming videos: this one seems particularly popular, but I found a few other handy ones. This blog was probably most valuable for me (if you can’t tell, I prefer blogs over videos, which seems contrary to where things are going…). Again, to be clear, I did cursory searches and these are what came up—maybe there’s better resources!

My Hopes for Tmux

Long ago (in college) I had a lot of fun with Emacs and so I recall how I could split windows, have one window be a terminal, another be my editor pane, and still another run top, and so on. (I still readily split views in my VSCode instances). I have a large monitor, and so the pane-splitting (plus the different windows) suggests a lot of nice tiling abilities. So I’m leaning into that.

More concretely, I often have an editor (Neovim, now) in one pane, maybe split in 2, and then an incidental terminal to do git-y stuff, and another terminal to do test-runs, and then maybe another tiny one running top (or the cooler htop) to let me know if something awful is happening to my machine.

Tmux has additional tools, particularly it’s ability to “detach” from sessions. My impression is that it’s for system administrators and the like; it’s not something that I see as useful for what I do.

Bringing it Up

OK so I’ve done a few things:

  • choco install nerd-fonts-hack to get that sort of psuedo-graphics font that’s all the rage.
  • In Windows terminal, change my WSL instance to use that font. Additionally create a colorscheme to match the one I’ve decided to commit to (for a while…), “tokyonight”, using ChatGPT :|.
  • Install tmux.
  • Ask ChatGPT how to set tmux on connecting to WSL. It worked! Just a little function testing the TMUX environment variable.
  • Create in my shell profile a function (etx, in my case) that jumps to the config/tmux/tmux.conf file and, upon saving-and-exiting, reloads the file. So I can futz with it easily.
  • Again ask ChatGPT to make Tmux tokyo-night-ish via the conf file. (This was not completely error-free: I had to do a few iterations, and futz with a few things, to get it working.)
  • Additionally augment that conf file with some better hotkeys and minor things.

That’s it!

Notably: No Plugins

Plugins can be very handy; you’ll see that I’ll use them enough in Neovim. Tmux (and also Fish) have their own plugin ecosystem. Of course it’s wonderful there are so many people sharing their efforts to improve their environment, but I’ve found that the cost of getting differently-authored plugins to be mutually compatible—even despite everyone’s best efforts—is too high. Of course they typically work well together, and of course avoiding plugins doesn’t preclude bugs, but they so rapidly increase the surface area of what to investigate when “something goes wrong” I try to avoid them.

Thus you’ll see that in my tmux config and fish rc file I avoid plugins (so far…?), while in Neovim I concede their use but still try to reduce my dependence on them.