Skip to content

VS Code Extension to quickly toggle text features, such as quote characters, casing, comment style, JSON-to-JS-to-YAML, et al.

License

Notifications You must be signed in to change notification settings

adamhamlin/vext

Repository files navigation

Vext

Vext Icon

CI Status Badge Release Status Badge

Simple VS Code Extension to toggle text features! With vext commands you can...


  • Toggle Quote Characters: Toggle outer quotes between ", ', and `

    Quotes Demo

    • 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!

    Comment Demo

    • 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.

    JSON-to-JS-to-YAML Demo

    • 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

  • Toggle Newlines To Literal Newline Characters: Toggle newlines to literal \n and back.

    Newlines Demo

    • 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.

    Variable Format Demo

    • 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], but kebabUpper is also available.

  • Toggle Text Casing: Toggle a word or selection between upper and lower case

    Casing Demo

    • 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.

Keybindings

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.

Development

See launch.json for configurations to run the extension or to run the test suite.

CI/CD

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.

Future Work?

Please open an issue if you have a suggestion!

About

VS Code Extension to quickly toggle text features, such as quote characters, casing, comment style, JSON-to-JS-to-YAML, et al.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages