Time: 2014.06.28
Location: Base
-------------------------------------------------------------------------------
I. Brief Introduction
A composite command corresponds to two or more sub-commands, which encapsulates multiple sub-operations.
Generally, we want to add some common operations after many lines. For example, to add a semicolon at the end of each line of code in a program, we know that$ Command to move the cursor to the end of the current rowAnd thenUse the command to insert the cursor after the current cursor position (I is inserted before the current cursor)And then exit from Esc. If you want to re-execute this modification, because the last operation record here is: [A; ESC] Three buttons, so we have to move the end of the line to be modified and then execute the command to achieve the goal, that is, every time J $.
-------------------------------------------------------------------------------
2. Use compound operations
During the above operation, the modification operation corresponding to the command is equivalent to the three key operations of [a; ESC]. j moves the cursor down a line (not the modification operation) $ makes it positioned at the end of the line. Such a modification involves a lot of buttons. What's simpler is to use compound commands.A. It performs the insert operation at the end of the row where the current cursor is located,Then a is added; and ESC three buttons can form a modification unit. Next we only need to use J to move down a line and then execute the command, which is much more convenient. That is, one move operation, and one command operation can be performed multiple times to add characters at the end of each line.