-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#Tip68: Append Commands to a Macro | ||
Sometimes we miss a vital step when we record a macro. There's no need to re-record the whole thing from scratch. Instead, we can tack extra commands onto the **end** of an existing macro. | ||
![tip68_1](images/tip68_1.png) | ||
|
||
We realize that we should have finished by pressing `j` to advance to the next line. | ||
|
||
Before we fix it, let's inspect the contents of register a: | ||
![tip68_2](images/tip68_2.png) | ||
|
||
##qa | ||
>Vim will record our keystrokes, saving them into register a by overwriting the existing contents of that register. | ||
##qA | ||
>Vim will record our keystrokes, **appending** them to the existing contents of register a. | ||
![tip68_3](images/tip68_3.png) | ||
|
||
**Discussion** | ||
We can use this tech only to tack commands on at the **end** of a macro. If you want to add something at the beginning or somewhere in the middle of a macro, this technique would be no use to you! | ||
|
||
#[Tip67](tip67.md) [Tip69](tip69.md) |