Introduction
I've always been searching for a way to make Visual Studio draw a line after a certain amount of characters.
Below is a guide to enable these so called guidelines for various versions of Visual Studio.
Visual Studio 2013 or later
Install Paul Harrington's Editor Guidelines extension.
Visual Studio 2010 and 2012
Install Paul Harrington's Editor Guidelines extension for VS 2010 or VS 2012.
Open the registry at:
VS 2010: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Text Editor
VS 2012: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Text Editor
and add a new string called Guides with the value RGB(100,100,100), 80. The
first part specifies the color, while the other one (80) is the column the line will be displayed.
Or install the Guidelines UI extension (which is also a part of the Productivity Power Tools), which will add entries to the editor's context menu for adding/removing the entries without needing to edit the registry directly. The current disadvantage of this method is that you can't specify the column directly.
Visual Studio 2008 and Other Versions
If you are using Visual Studio 2008 open the registry at HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor and add a new string called Guides with the value RGB(100,100,100), 80. The first part specifies the color, while the other one (80) is the column the line will be displayed. The vertical line will appear, when you restart Visual Studio.
This trick also works for various other version of Visual Studio, as long as you use the correct path:
2003: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\Text Editor
2005: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor
2008: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor
2008 Express: HKEY_CURRENT_USER\Software\Microsoft\VCExpress\9.0\Text Editor
This also works in SQL Server 2005 and probably other versions.
For those running Visual Studio 2015 or later, the best solution is to install the Editor Guidelines by Paul Harrington rather than changing the registry yourself.
This is originally from Sara's blog.
It also works with almost any version of Visual Studio, you just need to change the "8.0" in the registry key to the appropriate version number for your version of Visual Studio.
The guide line shows up in the Output window too. (Visual Studio 2010 corrects this, and the line only shows up in the code editor window.)
You can also have the guide in multiple columns by listing more than one number after the color specifier:
RGB(230,230,230), 4, 80
Puts a white line at column 4 and column 80. This should be the value of a string value Guides in "Text Editor" key (see bellow).
Be sure to pick a line color that will be visible on your background. This color won't show up on the default background color in VS. This is the value for a light grey: RGB(221, 221, 221).
Here are the registry keys that I know of:
Visual Studio 2010: HKCU\Software\Microsoft\VisualStudio\10.0\Text Editor
Visual Studio 2008: HKCU\Software\Microsoft\VisualStudio\9.0\Text Editor
Visual Studio 2005: HKCU\Software\Microsoft\VisualStudio\8.0\Text Editor
Visual Studio 2003: HKCU\Software\Microsoft\VisualStudio\7.1\Text Editor
Productivity Power Tools includes guidelines and other useful extensions for older versions of Visual Studio.
Without the need to edit any registry keys, the Productivity Power Tools extension (available for all versions of visual studio) provides guideline functionality.
Once installed just right click while in the editor window and choose the add guide line option. Note that the guideline will always be placed on the column where your editing cursor is currently at, regardless of where you right click in the editor window.
To turn off go to options and find Productivity Power Tools and in that section turn off Column Guides. A reboot will be necessary.
Visual Studio 2017 / 2019
For anyone looking for an answer for a newer version of Visual Studio, install the Editor Guidelines plugin, then right-click in the editor and select this:
Visual Studio 2022
Same author as the package above but seems he had to split the extension to work with 2022.
https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelinesPreview&ssr=false#overview
There is now an extension for Visual Studio 2012 and 2013:
http://visualstudiogallery.msdn.microsoft.com/da227a0b-0e31-4a11-8f6b-3a149cf2e459
If you are a user of the free Visual Studio Express edition the right key is in
HKEY_CURRENT_USER\Software\Microsoft\VCExpress\9.0\Text Editor
{note the VCExpress instead of VisualStudio) but it works! :)
This will also work in Visual Studio 2010 (Beta 2), as long as you install Paul Harrington's extension to enable the guidelines from the VSGallery or from the extension manager inside VS2010. Since this is version 10.0, you should use the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Text Editor
Also, Paul wrote an extension that adds entries to the editor's context menu for adding/removing the entries without needing to edit the registry directly. You can find it here: http://visualstudiogallery.msdn.microsoft.com/en-us/7f2a6727-2993-4c1d-8f58-ae24df14ea91
This works for SQL Server Management Studio also.
I found this Visual Studio 2010 extension: Indent Guides
http://visualstudiogallery.msdn.microsoft.com/e792686d-542b-474a-8c55-630980e72c30
It works just fine.
With VS 2013 Express this key does not exist. What I see is HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0 and there is no mention of Text Editor under that.
For those who use Visual Assist, vertical guidelines can be enabled from Display section in Visual Assist's options:
The registry path for Visual Studio 2008 is the same, but with 9.0 as the version number:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor
For VS 2019 just use this powershell script:
Get-ChildItem "$($env:LOCALAPPDATA)\Microsoft\VisualStudio\16.0_*" |
Foreach-Object {
$dir = $_;
$regFile = "$($dir.FullName)\privateregistry.bin";
Write-Host "Loading $($dir.BaseName) from ``$regFile``"
& reg load "HKLM\_TMPVS_" "$regFile"
New-ItemProperty -Name "Guides" -Path "HKLM:\_TMPVS_\Software\Microsoft\VisualStudio\$($dir.BaseName)\Text Editor" -Value "RGB(255,0,0), 80" -force | Out-Null;
Sleep -Seconds 5; # might take some time befor the file can be unloaded
& reg unload "HKLM\_TMPVS_";
Write-Host "Unloaded $($dir.BaseName) from ``$regFile``"
}
You might be looking for rulers not guidelines.
Go to settings > editor > rulers > and give an array of character counts to provide lines at the specified values.
Related
In Windows Explorer when I double-click on any Visual Studio file (*.cs, *.csproj, etc.), it's opening an old version of VS instead of the latest one (VS 2017). And VS has associations with too many file types.
How can I change the default Visual Studio (for all those files that VS can handle)?
There is a similar old question about Visual Studio 2008 (Move file associations from Visual Studio 2005 to 2008) but the solution in there doesn't work anymore (there is no "Restore File Associations" button on the settings of Visual Studio 2017).
Each version of Visual Studio registers itself in the Set Default Programs panel of the Control Panel.
Go to Control Panel\Programs\Default Programs
Then choose Set Default Programs:
In there you can simply choose the Visual studio version of your choice and then click the button Set this program as default in order to associate every file type that VS handles.
Or you might prefer to click the button Choose defaults for this program to review the current associations of those file types and change only the ones you want.
Yet another in a long list of previously working-just-fine things which Microsoft have managed totally #$#%# up. If I try to change defaults the 'right' way I get this kind of thing:
i.e. completely ignored. The only way I've managed to solve it is by removing the file association entirely through the registry. Let's take .asm as an example:
Open Registry Editor / "regedit.exe"
Navigate to HKEY_CLASSES_ROOT\.asm\OpenWithProgIds
Delete any Visual Studio values you see
From there, you can (finally) open files with whatever you choose instead of having the association clamped to Visual Studio:
For the record, I believe this to be a problem with Windows 10. Not with Visual Studio. See: https://answers.microsoft.com/en-us/windows/forum/windows_10-files/cant-change-default-programs-in-windows-10/229fc3a9-25c9-433b-a333-5806bc5090db
On the file you will always open with vs17, click right and choose open with and there choose another app. On win10 it pop out a dialog with some proposals. If vs17 is there, choose your favorite and activate the always open with. then ok and your done.
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
I am evaluating Visual Studio 2012 and am having some problems with the color schema.
Sure enough I was able to overcome the initial discomfort by setting my color for the text editor.
One thing I have not been able to set corrent are the color for the class names.
Say you have a line like below.
Class name = new Class();
the entire line is in the same color, expect the new keyword.
I want the word 'Class' to be in a different color like in earlier versions of Visual Studio.
I am not able to set the color for this from the Option.
I have tried chaning color for all fields like plain text, literals, identifier, etc under
Tool -> Option -> Environment -> Font & Colors
but still I am not able to fix this.
I have also applied custome themes, those are also not helping.
I wouldn't want to install a productivity power tool for such basic preference right ??
Edit:
I'm on Windows 7 x64 and Visual Studio Professional 2012, Version 11.0.50727.1 RTMREL
The solution I found is a combination of the suggestions found in a mish mash of related threads:
Close Visual Studio and open the VS command prompt as an administrator. Navigate to the devenv.exe file (in Express versions it is titled something along the lines of *express.exe) usually located in C://Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE.
Type devenv.exe /setup
Reopen Visual Studio. If everything is all colored now, great! If not, close the tabs and reopen them.
Performing all of step 3 is what has got my coloring to come back to normal.
Here is where I got the suggestions:
Visual Studio 2012 - Intellisense sometimes disappearing / broken
How can I get user type C# syntax highlighting working again in VS 2012 RC?
If you're using Productive Power Tools, go to => Tools -> Options -> Productive Power Tools. In main menu, TURN OFF the option: Colorized Parameter Help.
I solved my problem, I'm on Windows 8 Pro, Visual Studio 2012 Ultimate.
You're on the right track. Under Tools -> Options -> Environment -> Fonts and Colors, you want to change "User Types", first making sure at the top of the dialog that you are viewing the settings for the "Text Editor"
Although, by default with my install of Visual Studio 2012 these were already set, so you may want to try the "Use Defaults" button, unless you've made other changes that you want to keep.
go to the tools >Option click on enviroment navigation and click on import and export setting and copy the url and open directory from the url and delete all font and color file .which you got setting folder
The workaround provided by Donatas on Microsoft Connect works without having to turn off any option of Productivity Power Tools:
There is a workaround without turning off "Colorized Parameter Help".
Go to Tools > Options > Environment > Fonts and Colors in Display
items select "User Types (Value types)" click Custom next to Item
foreground color and in the color picker change Red, Green or Blue by
1, i.e. to make a custom color which basically looks the same. OK on
all the dialogs and problem solved.
My website has several nested folders and sometimes long file names, so sometimes only 4 tabs can be opened at a time.
Can vs2010 be made to show only file names and leave out any path information?
Can the max displayed length for tabs be set?
I know the window can be split so top and bottom both have their own tabs.
For example (using the "Visual Studio 2010 Pro Power Tools"):
Showing the files:
...r.aspx.cs
...s.aspx.cs
...s.aspx.cs
...s.aspx.cs
...s.aspx.cs
For example (not using the Visual Studio 2010 Pro Power Tools):
Showing the files:
Adminstration/...quests.aspx.cs
Adminstration/...tUsers.aspx.cs
Adminstration/...ctions.aspx.cs
Adminstration/...eBanks.aspx.cs
Try installing the "Visual Studio 2010 Pro Power Tools" extension from the Extension Manager in VS. It adds a new section to the standard option dialogue that allows you to customise what they call the "Document Tab Well."
It doesn't let you truncate the filename, but you can change the way they draw and scroll, which might be enough to help.
It does allow more tabs at a time, but it severly shortens the amount of file name you see. So while it allows editing more files, you won't know what file you are editing.
For now I'm using the trial version of Tab Studio
In VS2010, go to Tools - Extension Manager. Go to the online gallery and search for this extension:
Visual Studio 2010 Pro Power Tools
This extension, once installed, gives you extensive control over the document well, including setting a max tab width and much more. I love this extension, and have had zero issues customizing tab behavior to suit my preferences. Hope this helps.
Fixed in Visual Studio 2012
This has finally been fixed in Visual Studio 2012:
So i see:
PendingRequests.aspx (rather than ...r.aspx.cs)
ImportUsers.aspx.cs (rather than ...s.aspx.cs)
SearchTransactions.aspx.cs (rather than ...ctions.aspx.cs)
ImportTimeBanks.aspx.cs (rather than eBanks.aspx.cs)
Now if we could just get the entire Visual Studio ecosystem to:
return to the use of Left, Right arrows to navigate overflow tabs
open new tabs on the right
just like Windows has been doing in 1994, and Visual Studio would start to almost become a user-friendly Windows application.
I have been using this excellent extension for VS2010 that solve your problems: Visual Studio 2010 Pro Power Tools.
It is a bundle of several extensions, but the most notable for you is the Document Well 2010 Plus. It allows you to configure the document tabs: to be the constant width, colour-coded by project, pinned, etc...
You can toggle the extensions that you do not want by editing the manifest file in:
~\Local Settings\Application Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\Visual Studio 2010 Pro Power Tools\
#IanBoyd: I agree, it doesn't solve the problem 100% however it helps (which is why most of the answers to this question suggest it). With the Visual Studio 2010 Pro Power Tools add-on you can a) set the maximum tab width using one tab options, b) setup some colour categorizing rules to help differentiate between projects/file types.
In VS2010, my workflow relies upon several add-ons and keyboard shortcuts to manage my workspace; for example I use CTRL + Tab to switch between active documents, use the pin-tab feature and colour coding from Power Pro Tools, the open solution file dialog from Visual Assist X, and re-open last edited file from Resharper.
This has been answered already here:
Remove path from tab name in Visual Studio 2010
Install the productivity power tools extension and it should do it by default!
Cheers.
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