如何在 Visual Studio 中切换自动换行?
Visual Studio .NET 是否有办法打开和关闭自动换行?
我习惯了 Eclipse 中的这个功能,它允许您右键单击并打开和关闭自动换行,这样当您有向右延伸的长行时,您不必向右和向左移动底部滚动条阅读你的代码/html:
Does Visual Studio .NET have a way to toggle word-wrap on and off?
I am used to this feature in Eclipse which allows you to right click and toggle word wrap on and off so that when you have long lines that extend out to the right, you don't have to move the bottom scroll bar right and left to read your code/html:
http://web.archive.org/web/20131027224437/http://ahtik.com:80/blog/2006/06/18/first-alpha-of-eclipse-word-wrap-released/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
遵循在编辑器中管理自动换行:
已知问题
遗憾的是,Visual Studio 中的自动换行看起来比其他编辑器(例如 Visual Studio Code)差很多 - 页边距不一致。 这是错误 https://developercommunity.visualstudio.com /t/Unexpected-and-sporadic-indents-when-usi/10635809
Visual Studio 2022 中的自动换行:
Visual Studio 代码中的自动换行:
Following Manage word wrap in the editor:
Known issues
Unfortunately word wrap in Visual Studio looks much worse than other editors such as Visual Studio Code -- the margins are inconsistent. This is bug https://developercommunity.visualstudio.com/t/Unexpected-and-sporadic-indents-when-usi/10635809
Word wrap in Visual Studio 2022:
Word wrap in Visual Studio Code:
我经常使用此功能,因此我在命令栏中添加了一个自定义按钮。
I use this feature often enough that I add a custom button to the command bar.
从 Visual Studio 2013 开始,自动换行功能终于可用了——它尊重缩进。 仍然存在一些问题(行突出显示、选择),但它值得使用。 以下是
As of Visual Studio 2013, the word wrap feature is finally usable—it respects indentation. There's still a couple of issues (line highlighting, selection), but it's worth using. Here's how
在 Visual Studio 2005 Pro 中:
Ctrl + E、Ctrl + W
或菜单编辑< /em> → 高级 → 自动换行。
In Visual Studio 2005 Pro:
Ctrl + E, Ctrl + W
Or menu Edit → Advanced → Word Wrap.
打开输出窗口。
查找工具栏右侧的小图标,该图标以文本“显示输出:”开头。 它看起来像一个带有回车图标的小窗口。 当您将鼠标悬停在其上方时,Visual Studio 应在鼠标指针附近显示“切换自动换行”。
单击该图标。
你现在已经学到了一些如此明显的痛苦,我因为很久以前不知道这一点而感到尴尬,因此选择支付我的会费并与其他人分享我的答案,这样他们就不会遭受与我相同的痛苦。
说实话,这对于屏幕较小的人来说确实很有用。 我有一个小型 Lilliput USB 显示器,非常适合小型工具窗口、Skype IM 等。它非常适合放置输出窗口,只是它总是需要横向滚动,这很糟糕。 在忍受了几个月的横向滚动之后,我终于决定看看是否可以使其自动换行。 答案很简单,但它节省的时间/精力是巨大的。
Open the output window.
Look for the little icon on the very right-hand side of the toolbar that starts with the text "Show output from:" in it. It looks like a small window with a carriage return icon. When you hover over it Visual Studio should display "Toggle Word Wrap" near your mouse pointer.
Click that icon.
You now have learned something that was so painfully obvious I feel embarrassed for not knowing this long ago and thus have chosen to pay my dues and share my answer with others so they don't suffer the same agony I have.
Seriously, this is really useful for those with small screens. I have a small Lilliput USB monitor that is good for small tool windows, Skype IM, etc. It works great for putting the output window on, except that it sucks having to always sideways scroll. After just putting up with sideways scroll for months I finally decided to see if I could make it word wrap. The answer was so easy but the amount of time/effort it saves is tremendous.
在 Visual Studio 2008 中,CTRL+E+W。
In Visual Studio 2008, CTRL+E+W.
Visual Studio 中的键盘快捷键
(alt + z) =>; 切换自动换行
keyboard shortcuts in visual studio
(alt + z) => toggle word wrap
在 Visual Studio 2008 中,它是 Ctrl + E + W。
In Visual Studio 2008 it is Ctrl + E + W.
使用 Visual Studio 2003 中的菜单编辑 → 高级 → 自动换行。
Use menu Edit → Advanced → Word Wrap in Visual Studio 2003.
对于
Visual Studio 2017
执行以下操作:工具 > 选项> 所有语言,然后根据您的偏好选中或取消选中该复选框。 如下图所示:
For
Visual Studio 2017
do the following:Tools > Options > All Languages, then check or uncheck the checkbox based on your preference. As you can see in below image :
在最新版本中。
1.点击左下角图标设置
2.选择设置设置
3.选择“文本编辑器”> 自动换行
In latest version.
1.click the left bottom of the icon setting
2.select setting setting
3.select "text editor"> "word wrap" on word wrap
在 VS Code 中 === 版本:1.52.1
打开 VS Code 设置
从设置中找到 settings.json 文件并打开它
添加此代码 - "editor.accessibilitySupport": "off"
如果您之前已添加值为 "on" 的 "editor.accessibilitySupport"然后只需将其设置为“关闭”即可。 当我在使用我的 JS 项目之一时遇到同样的问题时,这是对我有用的代码。
In VS Code === Version: 1.52.1
Open VS Code settings
From the settings find the settings.json file and open it
add this code - "editor.accessibilitySupport": "off"
If you already added "editor.accessibilitySupport" with the value "on" before then simply turn it to "off". This is the code worked for me when I faced the same problem while working with one of my JS Project.????