|
2 | 2 | <img src="./images/icon.png" alt="logo" width="100" /> |
3 | 3 |
|
4 | 4 | <h1>Format Switcher</h1> |
5 | | -</div> |
6 | 5 |
|
7 | | -## **Table of contents** |
| 6 | +[](https://marketplace.visualstudio.com/items?itemName=EdFerVIIIA.format-switcher) |
| 7 | +[](https://github.com/EfeDeveloper/format-switcher/actions/workflows/ci.yml) |
8 | 8 |
|
9 | | -1. [Features](#features) |
| 9 | +</div> |
10 | 10 |
|
11 | | -2. [Usage](#usage) |
| 11 | +## Table of contents |
12 | 12 |
|
13 | | -3. [Requirements](#requirements) |
| 13 | +1. [Features](#features) |
| 14 | +2. [Installation](#installation) |
| 15 | +3. [Usage](#usage) |
| 16 | +4. [Keyboard Shortcut](#keyboard-shortcut) |
| 17 | +5. [Contributing](#contributing) |
| 18 | +6. [License](#license) |
14 | 19 |
|
15 | 20 | ## Features |
16 | 21 |
|
17 | | -`Format Switcher` is a simple extension that allows you to change the formatting of selected text in the editor. The extension adds a new menu item to the context menu. |
| 22 | +`Format Switcher` is a VS Code extension that transforms selected text between seven naming-convention formats via the right-click context menu or a keyboard shortcut. |
18 | 23 |
|
19 | | -The extension supports the following cases: |
| 24 | +Supported formats: |
20 | 25 |
|
21 | | -```plaintext |
22 | | -CamelCase |
| 26 | +``` |
| 27 | +camelCase |
23 | 28 | snake_case |
24 | 29 | CONSTANT_CASE |
25 | 30 | kebab-case |
26 | 31 | Train-Case |
| 32 | +lower words |
| 33 | +UPPER WORDS |
| 34 | +``` |
| 35 | + |
| 36 | +- **Multi-cursor support** — all active selections are converted simultaneously. |
| 37 | +- **Context menu** only appears when text is selected (no more silent no-ops). |
| 38 | + |
| 39 | +## Installation |
| 40 | + |
| 41 | +**From the Marketplace:** |
| 42 | + |
| 43 | +1. Open VS Code |
| 44 | +2. Press `Ctrl+P` and run: `ext install EdFerVIIIA.format-switcher` |
| 45 | +3. Or search **"Format Switcher"** in the Extensions view (`Ctrl+Shift+X`) |
| 46 | + |
| 47 | +**From a VSIX file:** |
| 48 | + |
| 49 | +``` |
| 50 | +code --install-extension format-switcher-<version>.vsix |
27 | 51 | ``` |
28 | 52 |
|
29 | 53 | ## Usage |
30 | 54 |
|
31 | | - |
| 55 | +Select any text, right-click, and choose **Change case** → pick the desired format. |
32 | 56 |
|
33 | | -## Requirements |
| 57 | +## Keyboard Shortcut |
34 | 58 |
|
35 | | -This extension uses the following libraries |
| 59 | +Press **`Ctrl+Shift+F`** with text selected to **cycle** through formats in order: |
36 | 60 |
|
37 | | -```json |
38 | | -"lodash": "^4.17.21" |
39 | 61 | ``` |
| 62 | +camelCase → snake_case → kebab-case → CONSTANT_CASE → Train-Case → lower words → UPPER WORDS → camelCase → … |
| 63 | +``` |
| 64 | + |
| 65 | +The shortcut only activates when the cursor is inside the editor with a selection, so it does not conflict with the default "Find in Files" shortcut. You can customise the keybinding any time via **File → Preferences → Keyboard Shortcuts**. |
| 66 | + |
| 67 | +## Contributing |
| 68 | + |
| 69 | +Bug reports and feature requests are welcome — please [open an issue](https://github.com/EfeDeveloper/format-switcher/issues). |
| 70 | + |
| 71 | +Pull requests are also welcome. To get started: |
| 72 | + |
| 73 | +```bash |
| 74 | +git clone https://github.com/EfeDeveloper/format-switcher.git |
| 75 | +cd format-switcher |
| 76 | +npm install |
| 77 | +npm test |
| 78 | +``` |
| 79 | + |
| 80 | +Press **F5** in VS Code to launch the Extension Development Host, or use the **"Extension Tests"** launch config to debug tests. |
| 81 | + |
| 82 | +## License |
40 | 83 |
|
41 | | -✨**Enjoy!** |
| 84 | +[MIT](LICENSE) © EfeDeveloper |
0 commit comments