Transform Quotations is a Visual Studio Code extension that allows you to quickly transform string quotations in your code. With a simple keyboard shortcut or button, this extension converts regular double into template literals ({``}), making your string handling easier and more dynamic.
Features
Quick Transformation: Transform strings enclosed in double or single quotes to template literals using a keyboard shortcut.
Customizable Keybinding: Configure your preferred keybinding for transforming quotes.
Supports Multiple Languages: Works in any language or file type where you use quotes, including JavaScript, TypeScript, HTML, CSS, and more.
Installation
Open Visual Studio Code.
Go to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window.
Search for Transform Quotations in the Extensions Marketplace.
Click Install to add the extension to your VS Code editor.
Usage
Once installed, you can easily transform your strings by using a keyboard shortcut:
Default Keybinding
Windows/Linux: Ctrl+Alt+W
macOS: Cmd+Alt+W
How it Works
Select or place your cursor on the string inside either double quotes (").
Press the keybinding (Ctrl+Alt+W or Cmd+Alt+W) to transform the string into a template literal ({``}).
For example:
const greeting = "Hello, world!";
After transformation:
const greeting = `{Hello, world!}`;
Custom Keybinding
If you'd like to change the keybinding for transforming quotations:
Open Keyboard Shortcuts by pressing Ctrl+K Ctrl+S.
Search for Transform Quotations.
Click the pencil icon next to the command and press your preferred key combination.