Rewrap extension for VSCode and Visual Studio
Clone or download
Latest commit 62addc6 May 16, 2018

README.md

Latest version: 1.9.1. New in this version (full changelog):

The new setting rewrap.autoWrap.enabled can now be used to ensure this feature is enabled in new installations (#87)

New in 1.9.0:

  • Support East Asian (CJK) languages
  • Support HCL/Terraform config files

Rewrap

Reformats code comments and other text to a given line length. For VSCode and Visual Studio.

Example

Similar to wrap/fill paragraph in Sublime (alt+q) Emacs (M-q) or Vim (gq); but more powerful.

Features

  • Re-wrap single & multiline comment blocks in many languages. Also configure settings per language.
  • Smart handling of contents, including java/js/xmldoc tags and code examples.
  • Can select lines to wrap or multiple comments/paragraphs at once (even the whole document).
  • Also works with Markdown documents, LaTeX or any kind of plain text file.

Using

The main Rewrap command is: Rewrap Comment / Text, by default bound to Alt+Q.

Put the text cursor inside a comment line, block or plain text paragraph and invoke the command to wrap to the preset column (default is 80). You can also select just a few lines, or multiple comments in one selection.

Also available is an Emacs-style auto-wrap/fill mode.

See the Features page for more examples on how to use.

Configuring

See the wiki for pages on configuring settings and keybindings.

Supported languages

The full list of types currently supported is:

AutoHotKey, Bash/shell script, Batch/cmd file, C, C#, C++, CoffeeScript, Crystal, CSS, D (partial), Dart, Docker file, Elixir, Elm, F#, Go, GraphQL, Groovy, Haskell, HCL, Html, Ini, Jade, Java, JavaScript, LaTeX, Lean, Less, Lua, Makefile, Markdown, MATLAB, Objective-C, Perl, PHP, PowerShell, Protobuf, PureScript, Python, R, Ruby, Rust, Sass, SQL, Swift, Tcl, Terraform, Toml, TypeScript, Visual Basic, Xml, Xsl, Yaml.

For any other type of file, plain-text paragraph wrapping is still supported.

Please report any issues, suggestions or feature requests you have in issues!