Per-filetype "View whitespace" setting in Visual Studio - visual-studio

Is there a way to enable/disable the "View Whitespace" feature in Visual Studion on a per-filetype basis? I'd like to be able to edit python files with visible whitespace, but not other types.

Unfortunately, there is not a way to do this. The 'View White Space' setting (available from the Edit|Advanced|View White Space' menu option) is stored in the registry, which means the setting is applied to all files and all sessions of Visual Studio.
The next best thing is learn the shortcut key and toggle the feature on and off as necessary. For Visual Studio 2008, the shortcut is Ctrl+E, S.

Related

How to switch view modes in built-in Diff viewer of Visual Studio 2012 and 2013?

Currently, this is how Visual Studio displays the differences between files:
I would like it to display the two files separately (including the red/green notations), as I believe is the default settings. How do I change the way it displays the differences?
Check the 'Compare Files' toolbox, there is a button for it.
Or use the keyboard shortcut Ctrl+\, Ctrl+2.

Disable ALL CAPS menu items in Visual Studio 2013

In Visual Studio 2013, Microsoft again presents the menu in UPPERCASE as the default.
Can these be modified to be Sentence Case?
Yes - in the new Visual Studio 2013 (as in VS 2012), MS reinforced their design decision to make ALL CAPS MENU ITEMS the default. The methods for reverting the menu style are almost the same methods used for Visual Studio 2012, which has been discussed before.
Update (after Visual Studio 2013 Update 4)
As of Visual Studio 2013 Update 4 you can go into Tools > Options > Environment
and uncheck Turn off upper case in the menu bar
Before Visual Studio 2013 Update 4:
You need to create a specific registry key if you want "old-style" menus back.
First Variant: Since Package Manager Console is Powershell, select menu options TOOLS / Library Package Manager / Package Manager Console and enter and run
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\12.0\General -Name SuppressUppercaseConversion -Type DWord -Value 1
(as a single line).
Second Variant: Open up a Command Prompt (win+r, cmd, enter) and enter and run
REG ADD HKCU\Software\Microsoft\VisualStudio\12.0\General /v SuppressUppercaseConversion /t REG_DWORD /d 1
(as a single line).
Third Variant:
Change registry values by hand, open regedit and navigate to
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\General
then, create (right click):
DWORD value
with the content of
SuppressUppercaseConversion
and set it to
1
Close regedit.exe and you're done.
Fourth Variant: At least one VS Extension (VSCommands for Visual Studio 2013) has been published that enables you (among other things) to switch menu style via config menu from within VS 2013.
You may also set it to all-lower-case items (which is, imho, nice):
switch to Sentence Case (subtly different from what you get with SuppressUppercaseConversion: the SQL menu gets renamed to Sql)
or hide it completely (and have it appear on ALT key press or mouse over)
After years Microsoft has changed their mind on this feature. As of Visual Studio 2013 Update 3 RC, an option has been added in Tools -> Options to change to Mixed Case for Menu titles. Obviously this is not for VS 2012 but going forward this option will be there.
Here is the notification from Brian Harry of Microsoft....
Mixed Case Menus – I know I’m going to get some feedback on this one :) This is a long standing request by a vocal portion of the VS user base since VS 2012 to change the “ALL CAPS” menus. In VS 2013 Update 3, we have added a Tools –> Options setting to control whether you see ALL CAPS or Mixed Case. The default is still ALL CAPS but, if you change it, it will persist across upgrades and will roam across your IDE instances using the VS Online roaming settings feature (if you log into VS so it knows who you are).
http://blogs.msdn.com/b/bharry/archive/2014/07/02/vs-tfs-2013-3-update-3-rc.aspx
I have been using the following reg files to enable/disable the lowercasing in Visual Studio 2013:
http://erwinmayer.com/dl/VS2013_ALLCAPS_Toggle.zip
Just double click on VS2013_ALLCAPS_Disable.reg inside the archive to disable all caps menu titles, and VS2013_ALLCAPS_Enable.reg to re-enable them.
You can easily edit the reg files before with a text editor to see what they contain.
If you're using the "Visual Studio Express 2013 for Windows Desktop" version the registry key should be added in:
HKEY_CURRENT_USER\Software\Microsoft\WDExpress\12.0\General
So simple! You can go to Tools -> Options -> Environment -> General tab and check the Turn off uppercase checkbox from the right side and click ok. Visual studio 2013 will automatically turn off uppercasing of the menubar.
VS 2013:
Tools→Extensions and Updates→Online,
Type "VSCommands" in search textbox,
Click Download
Tools→Options→VSCommands→General,
Click Open-Configuration button
IDEEnhancements→Main Menu→Change Main Menu Letter Case,
click Sentence-Case

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

Where are the settings to show a space, tab, paragraph, CRLF, etc. (extended) characters?
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.
Edit -> Advanced -> View White Space or Ctrl+R,Ctrl+W for Visual Studio 2019
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
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
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.
My problem was hitting CTRL+F and space
This marked all spaces brown. Spent 10 minutes to "turn it off" :P
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
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).
The name of this command in the Add command popup is Toggle Visual Space.
If you use Visual Studio Code => View => Render Whitespace
That's it!
For me this setting was on, but didn't work. I had to turn it off and on again and than it worked! So this is a bug in Visual Studio Code!
If you use Visual Studio 2022 you can change the display options for whitespace etc. in Tools => Options => Text Editor => General and select "View whitespace"
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.
To see the CRLF you can try this extension: End of the Line
It works for VS2012+
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
For completeness since I haven't seen it mentioned here, it is also in Options->Text Editor->General->View Whitespace.
In the actual version this Option ist under Editor: Render Whitespace

Visual Studio addin; to highlight all words which match selected word?

While using NotePad++, and select a certain word, it automatically highlights all matched words?
Does anyone know if there is a Visual Studio addin that can do this? or are there any hidden environment setting that can do this?
Check following addins
Productivity Power Tools addin
The background colour of the highlight in Productivity Power Tools is found under Tools->Options->Productivity Power Tools->Enhanced Scroll Bar->Words Matching The Caret Location Color In The Editor.
or
Use Highlight selected word addin.
I believe Visual Assist can do that. This can be switched on in Settings -> Refactoring -> Automatically highlight references to symbol under cursor.
This is something that is automatically done by VS 2010 though if you are using an older version of VS you can get that functionality with third-party addins. For example I used to use an add-in called RockScroll that could highlight usages in a source file (By double clicking on the word) http://www.hanselman.com/blog/IntroducingRockScroll.aspx.
Also ReSharper has that functionality built into it with Cntl + Shft + F7

CodeRush Xpress Colors

I downloaded the free CodeRush Xpress version to try it. Is there a way to change the colors it uses for it's highlighting and line drawing? ie the matching braces. I have a dark color scheme and my monitor I have VS on must suck because I can't see the lines. Yet on the LCD I can. Is there a way to change the colors?
I use CodeRush Xpress 9.2. It is possible to configure some colors used for highlighting in the Options menu of CodeRush Xpress. You can find the menu in Visual Studio under DevExpress -> Options. Go to the Painting sub-item of the Editor item to control some of the colors used (among them Navigation Fields, Navigation Links and Text fields).
If the DevExpress menu doesn't appear in your Visual Studio installation, just press Alt+Ctrl+Shift+O to directly go to DevExpress Options. Or, if you permanently want the DevExpress menu entry in Visual Studio, set the following registry key and restart it:
[HKEY_LOCAL_MACHINE\SOFTWARE\Developer Express\CodeRush for VS\9.2]
"HideMenu"=dword:00000000
This works at least with Visual Studio 2005 and 2008.
Just found this online... You can open their control menu with this key combination: ctrl+alt+shift+o
i'm using VS 2008 for the record & CodeRush xpress 9.2. i didnt see a menu in Visual Studio anywhere and i didnt find that registry setting either.
If you're using a 64bit machine the path will be different:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Developer Express\CodeRush for VS

Resources