384

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/

Csa77
  • 649
  • 13
  • 19
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
  • 1
    Compared to other editors such as Notepad++, Sublime Text and Visual Studio Code, word wrap in Visual Studio has several known issues. If you use it, please vote for the feature request [Fix known issues with word wrap](https://developercommunity.visualstudio.com/idea/891314/fix-known-issues-in-word-wrap-1.html). – Colonel Panic Jan 21 '20 at 08:53
  • @ColonelPanic That link goes to an issue marked as a duplicate that cannot be voted on. This issue can be voted on: https://developercommunity.visualstudio.com/content/idea/351760/fix-known-issues-in-word-wrap.html – Alex Jul 28 '20 at 11:38

12 Answers12

733

Following https://learn.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, Ctrl+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

Unfortunately these bugs have been closed "lower priority". If you'd like these bugs fixed, please vote for the feature request Fix known issues with word wrap.

Alex
  • 14,104
  • 11
  • 54
  • 77
Micah
  • 111,873
  • 86
  • 233
  • 325
  • 5
    When I press the 'end' key, the cursor moves to the end of the displayed line not the actual line - _really_ annoying. Is there a fix for this? – Flash Mar 23 '12 at 04:52
  • I had to check the "Show all settings" at the bottom to get All Languages to show up in the options. – JoeMoe1984 Jan 23 '13 at 21:59
  • 4
    Very annoying as I constantly use CTRL + E, F to reformat code with R# and CTRL + E, W is just way too close. – Yuck Apr 21 '14 at 18:14
  • 2
    I have no Edit->Advanced... is Visual Studio Community hobbled in this way? – livingtech May 31 '18 at 13:34
  • Oddly, my settings under 'options' as you described were checked for this, but it wasn't wrapping. I unchecked the box and rechecked it, then after exiting the window my code wrapped (in VS Professional 2017). – Kyle Vassella Nov 09 '18 at 17:58
  • Cool. Worked for me :) – Naveen Kumar V Jun 22 '21 at 12:55
28

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
Jonathan
  • 8,771
  • 4
  • 41
  • 78
Todd Smith
  • 17,084
  • 11
  • 59
  • 78
15

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

enter image description here

Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
9

In Visual Studio 2005 Pro:

Ctrl + E, Ctrl + W

Or menu EditAdvancedWord Wrap.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Alarion
  • 407
  • 2
  • 7
6
  1. Open the output window.

  2. 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.

  3. 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.

gonzobrains
  • 7,856
  • 14
  • 81
  • 132
6

In Visual Studio 2008, CTRL+E+W.

ProgramFOX
  • 6,131
  • 11
  • 45
  • 51
5

keyboard shortcuts in visual studio

(alt + z) => toggle word wrap

Himabindu
  • 634
  • 8
  • 22
4

In Visual Studio 2008 it is Ctrl + E + W.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
netadictos
  • 7,602
  • 2
  • 42
  • 69
3

Use menu EditAdvancedWord Wrap in Visual Studio 2003.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ian Jacobs
  • 5,456
  • 1
  • 23
  • 38
3

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 :

Swati
  • 28,069
  • 4
  • 21
  • 41
Judel5
  • 31
  • 3
2

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

Yvonne.D
  • 133
  • 1
  • 4
0

In VS Code === Version: 1.52.1

  1. Open VS Code settings

  2. From the settings find the settings.json file and open it

  3. 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.