Tmuxomatic: Managing tmux sessions

Source: Internet
Author: User

Tmuxomatic: Managing tmux sessions

With the popularity of tmux, the number of peripheral tools has gradually increased. Tmuxomatic schedules a tmux window session in a way called windowgram. Once the session is organized and saved to a file, it can be reused multiple times. Compared with manual operations, it seems to be a lot easier.

Tmuxomatic requires Python 3 and tmux 1.8 and later versions. You can run the following command to install tmuxomatic:

pip install tmuxomatic

It is worth noting that the tmuxomatic 2.18 installed in this method has a bug. If the tmuxpane-base-indexIf the value is not 0, tmuxomatic will report that it cannot be found.pane 0. However, tmuxomatic's git version has been fixed.

When tmuxomatic is used for the first time, we executetmuxomatic -f demo_sessionTo draw windowgram.

  1. Enternew cliCreate a window named cli. At this time, the screen displays number 1 as the identifier.

  2. To facilitate subsequent operations1To 30 characters in width and 10 characters in height:

    scale 30x10
  3. Currently, there is only one pane. We will add another pane on the right, with the same width as 1:

    add right 100%
  4. Now we have two panes 0 and 1. If you need more panes, you can also usebreakOrsplitCommand. Here we usesplitTo split 0:

    split 0 bottom 5 2

    In this way, the pane 0 is changed to 0 and 2, and the height is the same.

  5. If you no longer need other operations, You can executedone. Then, tmuxomatic will create this session for us. RunexitOnly the results are saved.

After drawing windowgram, we can add other operations for the pane as needed, such as executing programs, transferring to a directory, and focusing.

1 run vim0 dir ~/code/linuxtoy.org2 foc

Run Vim in pane 1, and go~/code/linuxtoy.orgDirectory, and focus on pane 2.

Passcat demo_sessionLet's look at the final result:

##------------------------------------------------------------------------------#### Session file created by tmuxomatic flex 2.19-dev####------------------------------------------------------------------------------## Window added by tmuxomatic flex 2.19-devwindow cli1111111111111111111111111111110000000000000000000000000000001111111111111111111111111111110000000000000000000000000000001111111111111111111111111111110000000000000000000000000000001111111111111111111111111111110000000000000000000000000000001111111111111111111111111111110000000000000000000000000000001111111111111111111111111111112222222222222222222222222222221111111111111111111111111111112222222222222222222222222222221111111111111111111111111111112222222222222222222222222222221111111111111111111111111111112222222222222222222222222222221111111111111111111111111111112222222222222222222222222222221 run vim0 dir ~/code/linuxtoy.org2 foc

To create a tmux session, you only need to executetmuxomatic demo_sessionYou can.

→ Tmuxomatic

You may also like the following articles about Tmux:

Tmux: terminal multiplexing

Simple tmux tutorial

Tmux getting started

Build IDE with Tmux and Vim

Install and use Tmux in CentOS

Build IDE with Tmux and Vim

Tmux details: click here
Tmux: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.