Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bjlange/vscode-rewrap

 
 

Repository files navigation

Rewrap

Latest version: 0.6.2 (view changes)

Reformats code comments and other text to a given line length.

Example

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

Features

Using

Rewrap adds one command to vscode: 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.

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

Settings

Comment width

Rewrap provides one setting: the column that text will be wrapped at:

{
  "rewrap.wrappingColumn": 80
}

Add it to your user or workspace settings file. (File -> Preferences -> User Settings)

If this setting isn't present, vscode's own "editor.wrappingColumn" setting is used instead (as long as it's set ≤ 120). Otherwise, a default value of 80 is used.

Keyboard shortcut

If you want to use another shortcut instead, you can do so by adding a custom keybinding (File -> Preferences -> Keyboard Shortcuts). Then add your own shortcut for the rewrap.rewrapComment command to your keybindings.json file.

For example if you want to use the shortcut Ctrl+Shift+Q instead:

[ { "key": "ctrl+shift+q", "command": "rewrap.rewrapComment" }	
]

Supported languages

The full list of types currently supported is:

AutoHotKey, Bash/shell script, Batch file, C, C#, C++, CoffeeScript, CSS, Docker file, Elm, F#, Go, Groovy, Haskell, Html, Ini, Jade, Java, JavaScript, Less, Lua, Makefile, Markdown, Objective-C, Perl, PHP, PowerShell, PureScript, Python, R, Ruby, Rust, Sass, SQL, Swift, 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!


Uses textlint/markdown-to-ast for markdown support.

Actual wrapping done with jonschlinkert/word-wrap

About

Rewrap extension for vscode

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 69.1%
  • JavaScript 19.8%
  • C 2.3%
  • C# 2.3%
  • Ruby 1.9%
  • CoffeeScript 1.5%
  • Other 3.1%