Auto-Type-Code (Beta)
Overview
The Auto-Type-Code extension for VSCode allows users to automate the typing of predefined code snippets. This extension reads from specified source files and simulates typing into the active text editor, providing various commands to manage and control this process.
Watch Full Tutorial
Features
- Add Code: Select and store source files to be typed later.
- Type Next in Stack: Autotype the contents of the stored source files into the active editor.
- Show Stacked Codes: Display the list of stored source files with options to open, remove, or change their order.
- Remove All: Clear the list of stored source files.
- Stop Typing: Halt the typing process at any time.
- Pause/Play: Pause or resume typing.
- Will-Pause/Play: Pause at the next logical point (e.g., whitespace, new line).
- Change Speed: Adjust the typing speed.
- Manage Auto-Close Pairs: Activate/deactivate auto-close pairs.
- Manage will-pause Locations: Set points where typing will pause when Will-Pause is triggered
Usage
Access the commands provided by the Auto-Type-Code extension via the Command Palette (Ctrl+Shift+P
).
Commands
AutoType: Add code (Shortcut: Ctrl+Alt+C
):
- Select a source file to add to the list of files for automated typing.
AutoType: Type next in stack (Shortcut: Alt+T
):
- Start typing the first file in the stored list of source files into the active editor.
AutoType: Show stacked codes (Shortcut: Ctrl+Alt+S
):
- Display the list of stored source files with options to manage them.
AutoType: Remove all (Shortcut: Alt+R
):
- Remove all stored source files from the list.
AutoType: Stop (Shortcut: Alt+S
):
- Stop the current typing process.
AutoType: Pause/Play (Shortcut: Alt+P
):
- Toggle between pausing and resuming the typing process at any point.
AutoType: Will-Pause/Play (Shortcut: Alt+W
):
- Pause typing at the next logical point (such as whitespace, new line, or user-defined character) after the user triggers this command.
AutoType: Change speed:
AutoType: Decrease speed (Shortcut: Ctrl+Alt+D
):
- Decrease the typing speed.
AutoType: Increase speed (Shortcut: Ctrl+Alt+F
):
- Increase the typing speed.
AutoType: Manage auto-close pairs:
- Manage the automatic closing of brackets, parentheses, quotes, and other paired characters.
AutoType: Manage will-pause locations:
- Manage stop locations where the typing will pause when the user triggers the Will-Pause command.
Actions
Symbol |
Name |
Usage |
⇘ |
Starting Point |
Start typing from this point, or from the beginning if not added |
⇖ |
End Point |
Stop typing at this point, or continue to the end of the file if not added |
⁑ |
Join |
Skip the typing delay and type the characters before and after this symbol as one character |
⋈ |
Force Auto-Close |
Enable auto-closing of pairs even if normally disabled |
⋉ |
Force No Auto-Close |
Disable auto-closing of pairs even if normally enabled |
⏳ |
Delay |
Add an extra one-second typing delay |
⧉ |
Start Copy-Paste |
Simulate copy-pasting; place before the copied block |
⁂ |
End Copy-Paste |
Place after the copied block to end copy-pasting |
⌫ |
Backspace |
Simulate a backspace |
⌦ |
Delete |
Simulate a forward delete |
⮞ |
Move Right |
Move the cursor one character to the right |
⮜ |
Move Left |
Move the cursor one character to the left |
⮝ |
Move Up |
Move the cursor one line up |
⮟ |
Move Down |
Move the cursor one line down |
✎ |
Force Type |
Type the next character, ignoring any special action it represents |
Example
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Code Example</title>
</head>
<body>
⇘<h1>Hello, World!</h⁑1>
⋈<button onclick="handleClick">⮜⮜()⮞⮞Click Me</button>
<p>
⧉This is a simple example of how to use Copy-Paste
feature in AutoType Extension.⁂
</p>
⏳
<script>
// Javasc⏳⌫⌫Script
const handleClick = () => {
console.log(user);
};
⮝⮝⮝⮝
⮝const user = ⋉{
name: "John Doe",
age: 30,
}
⮟⮟⮟⮟⮟
</script>⇖
</body>
</html>
How to Use:
Create Source Code
- Create a file with your snippet code.
- Add actions as needed.
- Save the source code anywhere on your PC.
Add Source Code
- Press Ctrl+Alt+C.
- Select the source code file.
- Press Ctrl+Alt+S to show codes in the stack (optional).
Start Typing
- Open the target file.
- Place the cursor where you need to start typing.
- Press Alt+T to start typing the next source code in the stack.
- Press Alt+S to stop typing at any point (optional).
Issues
If you encounter any issues or have suggestions for improvements, please open an issue on GitHub.
Support
Support the development of this extension on Patreon or Buy Me a Coffee.
Note: This extension simulates typing by inserting characters into the active text editor. The typing speed and behavior can be customized by modifying the code within the extension.