Copy Highlight
The extension highlights selected text when triggered, making it clear what text is being focused on. Works with copy operations or custom shortcuts. This is heavily inspired by neovim copy highlight feature.
While it works great with copy operations, you can configure any custom keyboard shortcut to trigger the highlight effect (see Custom Keyboard Shortcuts).
Problems we are trying to solve
- You don't have to think if the text was copied, you get a visual feedback.
- Example: People sometimes hit copy multiple times to be sure, using this the UI instantly shows that each copy action worked.
- You can see the exact text that was copied, including spaces.
- Example: When copying a token or command where trailing spaces matter, you can verify immediately that it copied correctly.
Features
- Visual Feedback: Highlights selected text with copy shortcut or any customizable keyboard shortcuts
- Copy Integration: Works seamlessly with standard copy operations Ctrl+C (Cmd+C for mac)
- Custom Shortcuts: Configure any keyboard shortcut to trigger highlighting
- Customizable Highlighting: Configure background color, transparency, and duration
- Non-intrusive: Highlight automatically disappears after a configurable duration
- Flexible Usage: Use with copy operations or as a standalone text highlighter
Requirements
Extension Settings
This extension contributes the following settings:
copyHighlight.backgroundColor: Background color for copy highlighting (hex color, default: #ffff00)
copyHighlight.transparency: Transparency level for copy highlighting (0-1, default: 0.3)
copyHighlight.duration: Duration in milliseconds to show the highlight (100-5000ms, default: 200)
Usage
Default Copy Highlighting
- Select any text in the editor
- Press
Ctrl+C (or Cmd+C on Mac) to copy
- The selected text will briefly highlight to confirm the copy operation
Configuration
Appearance Settings
You can customize the highlight appearance by modifying these settings in your VS Code settings:
{
"copyHighlight.backgroundColor": "#00ff00",
"copyHighlight.transparency": 0.5,
"copyHighlight.duration": 300
}
Custom Keyboard Shortcuts
Configure your own shortcuts to trigger highlighting without copying:
Method 1: Via Command Palette
- Open Command Palette (
Ctrl+Shift+P)
- Type "Preferences: Open Keyboard Shortcuts"
- Search for "copyHighlight.highlight"
- Right click on the line related to "copyHighlight.highlight" and select "Add keybinding"
- Enter your custom keybinding
Method 2: Via JSON Configuration
- Open Command Palette and select "Preferences: Open Keyboard Shortcuts (JSON)"
- Add your custom keybinding:
[
{
"key": "ctrl+alt+h",
"command": "copyHighlight.highlight",
"when": "editorTextFocus"
},
{
"key": "f9",
"command": "copyHighlight.highlight",
"when": "editorTextFocus"
}
]
Choose any key combination that works best for your workflow!
Known Issues and Repo
Repository and code for extension can be seen here Repo
Please report any issues on Known Issue
What's new ?
1.2.2
- Added Screenshot GIF: Added screenshot GIF
Enjoy!