Hello, command-line warriors! In our everyday terminal encounters, efficiency is key. Today, we’ll be addressing that with Tmux – a terminal multiplexer that allows us to run several terminals in a single window. In this blog, I’ll be focusing on showing you how to switch windows horizontally in Tmux, thereby optimizing your workflow and taking multitasking to another level. So buckle up, and let’s dive right into it!
If you’re just dipping your toes into the Tmux waters, start with the Tmux basics. Already got that down? Great! Let’s dive right in.
Let’s say you have already created one or more tmux sessions, with several windows and panes. We will discuss how you can split window horizontally to produce 2 vertical panes thereby creating a new pane.
Split window horizontally to create 2 panes
Let’s consider the case where you are inside your tmux pane i.e., your cursor is active in a pane.
You can use the following keyboard shortcut to switch to another pane-
Prefix + %
By default the prefix is Ctrl-B
, so to split tmux window horizontally you can run the following command-
Ctrl-B + %
You can also create a pane vertically in tmux thereby making your terminal experience more productive.
I hope you found this article useful, glad that you found it easy to split window horizontally to panes in Tmux. And that’s a wrap! Now you’re equipped with the knowledge to swiftly switch windows horizontally in Tmux. It’s a handy skill, increasing your efficiency and productivity while working with multiple terminals. So go ahead, give it a try and explore the new dimensions of multitasking with Tmux. Keep learning, keep improving, and remember: the terminal is your friend!
You can also check out the complete tmux cheatsheet of keyboard shortcuts and mouse shortcuts.