在 VSCode 中的列处自动硬换行 [英] Automatically hard wrap lines at column in VSCode

查看:47
本文介绍了在 VSCode 中的列处自动硬换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 VSCode 中自动硬换行?我的意思是,如果一行到达指定的列,则自动在最靠近该列的单词边界处插入一个换行符而不会越过.Vim 有一个名为 textwidth 的设置,我喜欢在编辑 Markdown 时使用它.据我所知,它似乎不像 VSCode.它只是有控制软包装的方法.

解决方案

VSCode 不支持开箱即用.但是您可以安装 Rewrap 扩展程序,它允许您通过按 Alt + Q 来格式化光标当前所在的块.>

Rewrap 不需要进一步的设置,因为它会读取 VSCode 的设置来获取要中断的列.

Rewrap 还支持自动换行(默认关闭):https://github.com/stkb/Rewrap/wiki/Auto-wrap

How can I automatically hard wrap lines in VSCode? By that I mean if a line reaches a specified column, automatically insert a newline at the word boundary closest to that column without going over. Vim has a setting called textwidth that does this that I like to use when editing Markdown. It doesn't seem like VSCode does, as far as I can tell. It just has ways to control softwrapping.

解决方案

VSCode doesn't support this out of the box. But you can install the Rewrap extension, which allows you to format the block that your cursor is currently in by pressing Alt + Q.

Rewrap requires no further settings, since it reads VSCode's settings to obtain the column at which to break.

Rewrap also supports automatic wrapping (off by default): https://github.com/stkb/Rewrap/wiki/Auto-wrap

这篇关于在 VSCode 中的列处自动硬换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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