Show space, tab, CRLF characters in editor of Visual Studio

Visual Studio

Visual Studio Problem Overview


Where are the settings to show a space, tab, paragraph, CRLF, etc. (extended) characters?

Visual Studio Solutions


Solution 1 - Visual Studio

Edit > Advanced > View White Space. The keyboard shortcut is CTRL+R, CTRL+W. The command is called Edit.ViewWhiteSpace.

It works in all Visual Studio versions at least since Visual Studio 2010, the current one being Visual Studio 2019 (at time of writing). In Visual Studio 2013, you can also use CTRL+E, S or CTRL+E, CTRL+S.

By default, end of line markers are not visualized. This functionality is provided by the End of the Line extension.

Solution 2 - Visual Studio

Edit -> Advanced -> View White Space or Ctrl+E,S

Solution 3 - Visual Studio

Display white space characters

Menu: You can toggle the visibility of the white space characters from the menu: Edit > Advanced > View White Space.

Button: If you want to add the button to a toolbar, it is called Toggle Visual Space in the command category "Edit".
The actual command name is: Edit.ViewWhiteSpace.

Keyboard Shortcut: In Visual Studio 2015, 2017 and 2019 the default keyboard shortcut still is CTRL+R, CTRL+W
Type one after the other.
[All default shortcuts][1]

End-of-line characters

Extension: There is a minimal extension adding the displaying of end-of-line characters (LF and CR) to the visual white space mode, as you would expect. Additionally it supplies buttons and short-cuts to modify all line-endings in a document, or a selection.
[VisualStudio gallery: End of the Line][2]

Note: Since Visual Studio 2017 there is no option in the File-menu called Advanced Save Options. Changing the encoding and line-endings for a file can be done using Save File As ... and clicking the down-arrow on the right side of the save-button. This shows the option Save with Encoding. You'll be asked permission to overwrite the current file.

[1]: https://docs.microsoft.com/en-us/visualstudio/ide/default-keyboard-shortcuts-in-visual-studio#text-editor "Default Keyboard Shortcuts in Visual Studio" [2]: https://marketplace.visualstudio.com/items?itemName=rolfwr.EndoftheLine "End of the Line"

Solution 4 - Visual Studio

My problem was hitting CTRL+F and space

This marked all spaces brown. Spent 10 minutes to "turn it off" :P

Solution 5 - Visual Studio

The correct shortcut is CTRL-R-W like you don't have to release CTRL button while pressing W. This worked for me in VS 2015

Solution 6 - Visual Studio

The shortcut didn't work for me in Visual Studio 2015, also it was not in the edit menu.

Download and install the Productivity Power Tools for VS2015 and than you can find these options in the edit > advanced menu.

Solution 7 - Visual Studio

To see the CRLF you can try this extension: End of the Line

It works for VS2012+

Solution 8 - Visual Studio

For those who are looking for a button toggle:

The name of this command is View white space in GUI menu (Edit -> Advanced -> View white space).

Menu toggle

The name of this command in the Add command popup is Toggle Visual Space.

Button toggle.

Solution 9 - Visual Studio

For Visual Studio for mac, you can find it under Visual Studio -> Preferences -> Text Editor -> Markers and Rulers -> Show invisible characters

Please note you may need to restart Visual Studio for the changes to take effect

Solution 10 - Visual Studio

In the actual version this Option ist under Editor: Render Whitespace

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBohnView Question on Stackoverflow
Solution 1 - Visual StudioFourthView Answer on Stackoverflow
Solution 2 - Visual StudioPavel YermalovichView Answer on Stackoverflow
Solution 3 - Visual StudioFarwayView Answer on Stackoverflow
Solution 4 - Visual StudioSpikolynnView Answer on Stackoverflow
Solution 5 - Visual StudioAtihskaView Answer on Stackoverflow
Solution 6 - Visual StudioCerveserView Answer on Stackoverflow
Solution 7 - Visual StudioRoberto TronciView Answer on Stackoverflow
Solution 8 - Visual StudioKUTlimeView Answer on Stackoverflow
Solution 9 - Visual StudioPaiman RoointanView Answer on Stackoverflow
Solution 10 - Visual StudiofreeshView Answer on Stackoverflow