How do I change the line spacing in Visual Studio 2012? - visual-studio

Is it possible to change the spacing between lines in the Visual Studio 2012 code editing area? After having worked with IntelliJ IDEA for a while, I got accustomed to a slightly larger line spacing (1.2), and I want to achieve the same effect in VS12.
For comparison, the top one is IDEA with 12 pixels spacing between lines, the bottom one is VS12 with 10 pixels spacing:
I find the IDEA version much easier to read, even if it's just 2px difference. Does anyone know?

I've found a workaround which works pretty well, partly alread described in this comment.
You need to download and install TypeLight (free for personal use), and open the Consolas.ttf file inside. To adjust the line spacing, go to Font -> Metrics -> Advanced and change the "Line Gap" to your desire (I changed "Type Line Gap" as well, but I have no idea what this actually does). I experimented a bit with a values and found around 730 to be similar to the 12 pixels spacing in IDEA.
To distinguish the modified font from the regular Consolas, I suggest changing the name of the font under Font -> Names (to "Consolas Spaced" or something). Save the font, double-click the file and choose "Install" from the preview dialog. Then (re)start Visual Studio, choose your modified font and you're done.

As of Visual Studio 2019 (16.10.0) it is now possible to change the line spacing directly in the options under Text Editor => General:

Can't change directly in Visual studio.
--> BUT You CAN change line height of font, the font you're using.
Step 1: install Fontforge.
Step 2: Open Fontforge after install finished, go to:
Element->Font Info ->OS2 -> Unit.
Change 4 value: Down win, up win, top N, down horizontal by multiplied by the desired ratio. Sample: ratio 1.5 or 2 ..etc...
(it means: if default 800, you multiple with ratio 1.5 --> result is 1200, you change 800 -->1200)
--> click OK to save setting.
Step 3: Go to File -> Generate font --> Generate with ttf format.
Step 4: Install the font just created and change font in Visual Studio.

Related

Visual studio - change character size of the "find and replace box"

Thanks to all, I have a problem with the find and replace box: suddenly (probably some strange combination of keys) the size and the fonts of the box reduced, and so is very difficult to use it.
How can I resize the dimensions and font size of the box?
I have serched in the tools --> options, but I have not found what I searching

how can i customize in Visual Studio the autocomplete color in the popup

Either this is found in Tools Options Fonts and Colors, or it's something editable with Visual Studio Color Theme Designer 2022 (an extension from Microsoft DevLabs).
As you can see, the word cast is white on pale-blue, which is very hard to read (and impossible at smaller scale). I have not been able to locate the setting that will adjust this.
I found a process: the blue in the picture is #FFC4D5FF. In the Theme editor, sorting by Color, I found about 50 items colored with this color. Among those is it
Cider -> ListItemMouseOver?
SearchControl ->PopupControlMouseOverBackgroundGradientMiddle2?
I have no clue. I changed all of them to #FF2362FF. Apply/save, and go to my editor, and I get:
So one of the 50 items is the thing I needed to change. Who knows what else changed. The labels are all very obscure to me. In the event something of these is trouble, I'll have to delve more deeply into the set of elements.

Visual Studio 2015/17 Indentation Lines Color

I have spent a long time trying to find out how to change the indent guidelines for visual studio, as the bright gray is really too distracting. I managed to change +/- collapse line, but not the indentation colors.
These are what I am talking about:
They are part of the Productivity Power Tools 2017. This is what they have on their docs:
If you prefer not to see the lines, you can easily turn them off in Tools-Options-Text Editor-General-“Show structure guide lines”. You can also alter their color via the Text Editor “Block Structure Adornments” display item in Fonts and Colors.
But it seems to be outdated. The color setting is now called Structure Guidelines

Change color of smart tag

Smart tags are almost impossible to see when using the dark theme on visual studio 2012. how do i change the color of smart tags.
Going to tools>options>environment>fonts and colors>smart tags does not work
just to be clear, in the image above, i am talking about the small blue box under the 't', not the red squiggly line
It's in Tools/Options/Environment/Fonts and Colors:
Show settings for: Text Editor
Display Items: Compiler Error
You can change the Item Foreground property to get the color of the squiggly to change.
Microsoft confirmed it as a problem and has added this defect to their backlog:
http://connect.microsoft.com/VisualStudio/feedback/details/796055/extremely-hard-to-see-smart-tag-when-using-dark-theme
I don't have visual studio in front of me, but I believe that is under the text editor options.
As far as I can remember that color is hard-coded to a constant, so you can't change it. Use Ctrl + . to invoke smart tags when there is one on the screen, it is much easier than hunting it down via the mouse.

In Visual Studio, how to visualize code line length for non-test code only?

I'm using guidelines right now, but I do not think there is any way to disable them for certain projects (my project with tests).
In general, how do you reconcile long, descriptive test method names with a line length limit for non-test code (both of which I think are good)? If you feel the same way and have solved this, what solution do you use?
Drop the line length policy.
If you still want to insist on keeping track of the column, try adding the following to the registry if your using Visual Studio
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor] "Guides"="RGB(192,192,192) 110"
RGB of course controls the color of the line, and you may change 110 to whatever number you like.
The end result gives you a guide line in Visual Studio so you always know where the column is, and the IDE ends up looking like this:
alt text http://blogs.msdn.com/photos/shawnfa/images/659277/637x480.aspx
We accomplish it by dropping the line length limit for all our projects that are not developed in a 1980s green screen environment. We instead use the full power of our 21st century high resolution LCD displays, bitmap screen modes and powerful IDEs to make source code that is descriptive and easy to maintain, rather then designed to fit into the screen and memory footprint of a machine whose RAM is measured in KBs.
(And then we beat the guy advocating line length limits and 3 letter variable names with a pointy stick)
Can't agree with the other answers that long lines are not an issue. You wouldn't say it's comfortable to read a minified single-line .js file - even with the horizontal scroll bars!
Visual Studio has an extension for adding visual hints - Editor Guidelines. You can manually create guidelines wherever you like - 80 or 120 characters. It does not enforce line lengths, so you are still free to deviate where you think it's appropriate.

Resources