Simple VS Code Extension to toggle text features! With vext
commands you can...
-
Toggle Quote Characters
: Toggle outer quotes between"
,'
, and`
- Keybinding: Cmd+Opt+' (Mac), Ctrl+Alt+' (Other)
- Settings:
vext.quoteChars
: Quote characters to be used when toggling quotes. Defaults to[", ', `]
.
-
Toggle Comment Type
: Toggle text between a block comment, a line comment, and uncommented text. It's language-aware!- Keybinding: Cmd+Opt+t (Mac), Ctrl+Alt+t (Other)
- Settings:
vext.autoFormatOnToggleCommentType
: When enabled, automatically format the selection when toggling comment type. Requires the Rewrap Extension to be installed. Defaults to false.
-
Toggle JSON to Javascript to YAML
: Toggle JSON object/array to "pretty" Javascript then to YAML and back.- Keybinding: Cmd+Opt+j (Mac), Ctrl+Alt+j (Other)
- Settings:
vext.useDoubleQuotesForOutputStrings
: When enabled, Javascript or YAML results will use double quotes (instead of single quotes) for string values and keys as required.
- Notes:
- YAML will NOT be output when:
- it's a single-line selection and the resulting YAML would not be a single line
- the first line (of a multi-line selection) is preceded by non-whitespace characters
- YAML will NOT be output when:
-
Toggle Newlines To Literal Newline Characters
: Toggle newlines to literal\n
and back.- Keybinding: Cmd+Opt+n (Mac), Ctrl+Alt+n (Other)
- Settings: N/A
-
Toggle Variable Naming Format
: Toggle a variable/identifier format between camel, snake, pascal, kebab, etc.- Keybinding: Cmd+Opt+v (Mac), Ctrl+Alt+v (Other)
- Settings:
vext.variableNamingFormats
: Variable naming formats to toggle between. Defaults to[camel, snake, snakeUpper, pascal, kebab]
, butkebabUpper
is also available.
-
Toggle Text Casing
: Toggle a word or selection between upper and lower case- Keybinding: Cmd+Opt+a (Mac), Ctrl+Alt+a (Other)
- Settings:
vext.caseExtraWordChars
: Additional characters that will be considered a part of\w
when parsing words to toggle case. For example, if '-' is specified, then 'super-secret' would be considered a single word. Defaults to most special characters.
Vext works best when you can quickly execute/re-execute these commands, so using keyboard shortcuts is recommended. Default command keybindings are listed for each command, but note that they may conflict with your existing keybindings.
See launch.json
for configurations to run the extension or to run the test suite.
Using Github Actions, the CI build will run on all pull requests and pushes/merges to main. The release build will run on publish of a Github release, which will then publish the extension to the Visual Studio Marketplace.
This project uses Conventional Commits and standard-version to facilitate versioning and changelogs.
Please open an issue if you have a suggestion!