The Base Case Extension for Visual Studio Code provides convenient keyboard shortcuts to convert live keyboard input into different casing styles commonly used in programming.
- UPPER_CASE - ⌘+B U / Ctrl+B U
- kebab-case - ⌘+B K / Ctrl+B K
- camelCase - ⌘+B C / Ctrl+B C
- snake_case - ⌘+B S / Ctrl+B S
- dot.case - ⌘+B D / Ctrl+B D
- Open Visual Studio Code
- Go to the Extensions view
- Search for "BaseCase"
- Click Install
- Open the Command Palette by pressing
Ctrl+Shift+P
(Windows) orCmd+Shift+P
(Mac) - Select "Base Case: Show Menu" and press
Enter
to open the case styles menu. Alternativly, useCmd+Shift+B
(Mac) orCtrl+Shift+B
(Windows) to quickly open the case style menu. - Select the desired casing style from the menu using the arrow keys and press
Enter
to apply it - Alternatively, use the following keyboard shortcuts:
- ⌘+B U (Mac) or Ctrl+B U (Windows): Convert input to UPPER_CASE
- ⌘+B K (Mac) or Ctrl+B K (Windows): Convert input to kebab-case
- ⌘+B C (Mac) or Ctrl+B C (Windows): Convert input to camelCase
- ⌘+B S (Mac) or Ctrl+B S (Windows): Convert input to snake_case
- ⌘+B D (Mac) or Ctrl+B D (Windows): Convert input to dot.case
- ⌘+B B (Mac) or Ctrl+B B (Windows): Stop using the Base Case Extension
After selecting the case styling, just type normally and the input will change live. For example, selecting camelCase
and typing: some function that does calcs
will output someFunctionThatDoesCalcs
Double space
: Removes the previous character and stops the extension.Enter
: Drop to new line and stops the extension.Space + =
: Removes the previous character and stops the extension.- Useful for formats like
SOME_CONST = "some-id"
.
- Useful for formats like
- Just
=
: Does not remove the previous character but still stops the extension.- Useful for formats like
SOME_CONST="some-id"
.
- Useful for formats like
The Base Case VSC Extension supports both Windows and macOS.
Contributions are welcome! If you encounter any bugs or have suggestions for new features, please open an issue on the GitHub repository.
This project is licensed under the MIT License