Copy with Replace
A VS Code Extension to replace specific text snippets before copying to the clipboard.
The "copy-with-replace" extension provides a single command to copy the contents of the currently opened file to the clipboard while replacing the specified strings.
- For use on Windows & Linux: CTRL + SHIFT + C
- For use on macOS: CMD + SHIFT + C
This extension contributes the following settings:
copyWithReplace.replacements: An array of objects containing search and replace properties for string replacements. For example:
The example above would copy all the instances of
bar before moving the copied contents into the system clipboard.
Testing and Contributing to the Extension
If you want to test or contribute to the "copy-with-replace" extension, follow these steps:
- Clone the repository or download the source code of the extension.
- Navigate to the extension's directory in your terminal or command prompt.
- Run npm install to install the required dependencies.
- Open the extension's folder in Visual Studio Code.
- Press F5 to launch the Extension Development Host. This opens a new window with the extension loaded, allowing you to test it.
- To run the tests, press Ctrl+Shift+P (or Cmd+Shift+P on macOS) to open the Command Palette, then search for and select "Tasks: Run Test Task". The tests should pass, and you'll see a message in the terminal indicating the results.
If you want to contribute to the extension:
- Fork the extension's repository on GitHub.
- Clone your fork and create a new branch for your feature or bug fix.
- Make your changes and commit them to your branch.
- Run the tests to ensure your changes don't introduce new issues.
- Create a pull request on the original repository with a description of your changes.
After reviewing your pull request, the maintainers may provide feedback and request changes. Once your changes are approved, they will be merged into the main repository.
Thank you for your interest in contributing to the "copy-with-replace" extension!