kmacros
is a powerful Visual Studio Code extension that provides a set of macros, keybindings, and commands to enhance your coding productivity. This extension is designed for developers who value efficiency and seek to streamline their workflow.
Shortcut: Ctrl + Alt + ]
This command clones the HTML element at the current cursor position.
Shortcut: Ctrl + Alt + [
Similar to the previous command, this clones the HTML element at the cursor position but also increments any numbers found within the element.
Shortcut: Alt + 0
This versatile command can:
- Evaluate mathematical expressions
- Flip boolean values
- Guess the context from the current line if no text is selected
Examples:
- Selecting
Math.cos(0.5)
and using the shortcut will output0.8775825618903728
- Flipping
true
tofalse
orTrue
toFalse
(case-sensitive)
Shortcut: Ctrl + Alt + A
(Windows/Linux) or Cmd + Alt + A
(Mac)
Selects all text in the current file and then copies it to the clipboard.
Note: This command is very handy for programmers using Large Language Models!
Shortcut: Ctrl + Alt + I
(Windows/Linux) or Cmd + Alt + I
(Mac)
This command inlines arguments in Rust macros, making them more readable and concise.
Shortcut: Ctrl + Alt + H
Generates a HuggingFace download link for the selected text, formatting it as a Markdown link.
Shortcut: Ctrl + C
This command overrides the default copy behavior. When copying text, it removes comments and can optionally remove whitespace, even in Markdown files (configurable).
KMacros offers several configuration options to customize its behavior:
kmacros.showNotifications
: Enable/disable notifications from the extension (default: false)kmacros.removeCommentsInMarkdown
: Remove comments in Markdown files when copying to clipboard (default: false)kmacros.removeWhitespaceInMarkdown
: Remove whitespace in Markdown files when copying to clipboard (default: false)
You can modify these settings in your VSCode settings.json file or through the Settings UI.
- Open Visual Studio Code
- Go to the Extensions view (Ctrl+Shift+X)
- Search for "kmacros"
- Click Install
After installation, you can use the provided keyboard shortcuts or run the commands from the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac).
If you'd like to contribute to kmacros
, please visit our GitHub repository.
This extension is released under the MIT License.
We hope kmacros
helps boost your productivity in Visual Studio Code! If you encounter any issues or have suggestions for improvements, please don't hesitate to open an issue on our GitHub repository.
Enjoy!