Multi-Window Working Environment in Emacs tmux and VIM environment-Season 1

Source: Internet
Author: User

There are three programming tools in the world: Emacs, Vim, and various ides. Over the past 10 years, the IDE programming environment has gained considerable market position thanks to the great promotion of funds. However, the historical development is always evolving. As the IDE environment becomes larger and more complex, the complexity and complexity of the IDE environment become increasingly unsolved. With the emergence of a large number of rapid multilateral programming requirements, more and more programmers are looking for a fast, simple, flexible, and variable lightweight programming environment. The old Emacs and VIM have re-entered the programmer's sight.

 

For those who first came into contact with these lightweight programming tools, the most direct feeling may be-wow! The whole world is quiet! From then on, the vast white Land is truly clean ...... However, to be honest, it is absolutely not enough to have only one window. Multi-Window is not an error. The error is that too many windows are too messy. Therefore, for programming environments like Emacs and Vim, you have chosen the simplest solution-leave the window to your own discretion.

Window Cutting

Let's take a look at how to build your own window environment in these ancient editors. The first season begins with the simplest split window. Of course, these ancient tools have evolved into a "God-class" work after a long journey, and the complete use of these tools has reached the limit. Here I will only discuss some of the simplest usage and give a reference to the students who have just started to contact me.

The following example includes three tools: emacs-tmux-vim. Emacs and VIM don't need to be introduced. Some people have never heard of the tmux name. Tmux is a terminal window manager. Yes, you have not heard the error, not only the editor can have multiple windows, but even a terminal can have windows, and _ ^

This season introduces three parts: The first part isHow to split the window. The second part isHow to close the Opened Window. The third part isHow to adjust the size of the split window.

 

The commands/operations designed in the following example are given in the following order: emacs-tmux-vim. In the example, Tab represents the tab key, right and left represent the right and left arrow keys, and up and down represent the up and down arrow keys, respectively.

 

First, how to split the window

 

#+BEGIN_EXAMPLE

+---------------------------------+ +--------------------------------+
| | Ctrl-x 2 | |
| | Ctrl-b " | |
| | :split | |
| | ----------------> +--------------------------------+
| | | |
| | | |
| | | |
+---------------------------------+ +--------------------------------+
| |
| Ctrl-x 3 | Ctrl-x o Ctrl-x 3
| Ctrl-b % | Ctrl-b tab Ctrl-x %
| :vsplit | Ctrl-w down :vsplt
v v
+----------------+----------------+ +--------------------------------+
| | | | |
| | | | |
| | | | |
| | | +---------------+----------------+
| | | | | |
| | | | | |
| | | | | |
+----------------+----------------+ +---------------+----------------+
|
| Ctrl-x o Ctrl-x 2
| Ctrl-b tab Ctrl-b "
| Ctrl-w right :split
v
+----------------+----------------+
| | |
| | | +------------------------+
| | | | |
| +----------------+ | Legend: |
| | | | .Emacs |
| | | | .tmux |
| | | | .vim |
+----------------+----------------+ +------------------------+

#+END_EXAMPLE
Then, how to remove the Opened Window

 

#+BEGIN_EXAMPLE



+--------------------------------+ +---------------------------------+
| | Ctrl-x 1 | |
| | Ctrl-b ! | |
| | :only | |
+---------------+----------------+ ----------------> | |
| | | | |
| | | | |
| | | | |
+---------------+----------------+ +---------------------------------+
|
| Ctrl-x 0
| Ctrl-b x
| :hide
v
+--------------------------------+
| | +------------------------+
| | | |
| | | Legend: |
+--------------------------------+ | .Emacs |
| | | .tmux |
| | | .vim |
| | +------------------------+
+--------------------------------+
#+END_EXAMPLE
The last step is to adjust the window size.

There are two points to note:

1. For Emacs and Vim, the example here can only be adjusted by one row or one column at a time. In actual use, you can add a number prefix to improve the adjustment efficiency.

2. The left and right adjustments of the tmux window are described in the tmux manual. However, I do not work in my urxvt terminal. It is unclear whether it is the cause of the terminal or the cause of tmux.

 

#+BEGIN_EXAMPLE

+--------------------------------+ +--------------------------------+
| | Ctrl-x ^ | |
| a | Ctrl-b Ctrl-down | a |
| | Ctrl-w + | |
+--------------------------------+ ----------------> | |
| | | |
| | +--------------------------------+
| | | |
+--------------------------------+ +--------------------------------+


+--------------------------------+ +--------------------------------+
| | shrink-window | a |
| a | Ctrl-b Ctrl-up +--------------------------------+
| | Ctrl-w - | |
+--------------------------------+ ----------------> | |
| | | |
| | | |
| | | |
+--------------------------------+ +--------------------------------+


+----------------+----------------+ +------------------------+-------+
| | | Ctrl-x } | | |
| a | | Ctrl-b Ctrl-right| a | |
| | | Ctrl-w > | | |
| | | ----------------> | | |
| | | | | |
| | | | | |
| | | | | |
+----------------+----------------+ +------------------------+-------+



+----------------+----------------+ +-------+------------------------+
| | | Ctrl-x } | | |
| a | | Ctrl-b Ctrl-left | a | |
| | | Ctrl-w < | | |
| | | ----------------> | | |
| | | | | |
| | | | | |
| | | | | |
+----------------+----------------+ +-------+------------------------+


#+END_EXAMPLE
Related Article

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.