How can I toggle word wrap in Visual Studio?

2019-01-10 00:37发布

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://ahtik.com/blog/2006/06/18/first-alpha-of-eclipse-word-wrap-released/

9条回答
冷血范
2楼-- · 2019-01-10 00:52

Following https://docs.microsoft.com/en-gb/visualstudio/ide/reference/how-to-manage-word-wrap-in-the-editor

When viewing a document: Edit / Advanced / Word Wrap (Ctrl+E, W)

General settings: Tools / Options / Text Editor / All Languages / Word wrap

Or search for 'word wrap' in the Quick Launch box.


Known issues:

If you're familiar with word wrap in Notepad++, Sublime Text, or Visual Studio Code, be aware of the following issues where Visual Studio behaves differently to other editors:

  1. Triple click doesn't select whole line
  2. Cut command doesn't delete whole line
  3. Pressing End key twice does not move cursor to end of line

If you'd like these fixed, please vote on UserVoice.

查看更多
smile是对你的礼貌
3楼-- · 2019-01-10 00:53

I use this feature often enough that I add a custom button to the command bar.

  1. Click on the Add or Remove Buttons -> Customize
  2. Click on the Commands tab
  3. Click Add Command...
  4. Select Edit (or Edit|Advanced for newer VS versions) from the list
  5. Find Toggle Word Wrap and drag it onto your bar
查看更多
乱世女痞
4楼-- · 2019-01-10 00:57

Use menu EditAdvancedWord Wrap in Visual Studio 2003.

查看更多
登录 后发表回答