VS Code:重新包装文本或注释块 [英] VS Code: Rewrap block of text or comment

查看:27
本文介绍了VS Code:重新包装文本或注释块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何重新包装一段文本或一段长评论以容纳 80 列?

How do I rewrap a block of text or a long comment to fit 80 columns?

我不希望它只是渲染自动换行(这很容易通过编辑 -> 切换自动换行或设置 "editor.wordWrap": "on"),但我希望它实际插入硬换行符.此功能在某些编辑器中称为填充段落".

I don't want it to just render the word wrap (this is easily achieved with Edit -> Toggle Word Wrap or setting "editor.wordWrap": "on"), but I want it to actually insert hard line breaks. This feature is called "fill paragraph" in some editors.

例如:

// This is a very long comment. I would like for this comment to occupy multiple lines rather than a single line, so that it is easy to read for other people.

现在我想按某个键来获得:

Now I'd like to press some key to get:

// This is a very long comment. I would like for this comment to occupy
// multiple lines rather than a single line, so that it is easy to read for
// other people.

推荐答案

看起来像 Rewrap 做你需要的.不确定是否有本地方式.他们仍在添加许多功能.

Looks like Rewrap does what you need. Not sure if there's a native way yet. They're still adding a lot of features.

这篇关于VS Code:重新包装文本或注释块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆