The Base Case Extension for Visual Studio Code provides convenient keyboard shortcuts to convert live input into different casing styles commonly used in programming.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
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.
Case Styles
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
Installation
Open Visual Studio Code
Go to the Extensions view
Search for "BaseCase"
Click Install
Usage
Open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (Mac)
Select "Base Case: Show Menu" and press Enter to open the case styles menu. Alternativly, use Cmd+Shift+B (Mac) or Ctrl+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
Escape Characters
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".
Just =: Does not remove the previous character but still stops the extension.
Useful for formats like SOME_CONST="some-id".
Supported Platforms
The Base Case VSC Extension supports both Windows and macOS.
Contributing
Contributions are welcome! If you encounter any bugs or have suggestions for new features, please open an issue on the GitHub repository.