Format codes horizontal whitespace? - visual-studio

Is there anyway in Visual Studio - in my case I'm using 2012 - to automatically format the amount of white space between code lines?
I know that pressing:
ctrl + k + f
Will nicely indent my code correctly, so is there an equivalent shortcut for white space gaps?

If you meant to have a feature from Word, 1.5 line space or double line space then Visual Studio does not have anything like it. The only way to achieve this is to change the font in editor to some that has abnormally large height.

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

R Studio font outputs

I'd like to understand how to change the text that is output in the source pane of R Studio. For instance, when I issue the command data(), to view the built in data sets, the output is displayed in what might be Time New Roman and it is quite small and not nicely formatted. I've been able to successfully change the console text size and type with the Global Options, or Preferences selections.
In addition, my output code chunks in R Markdown documents are likewise in possibly New Times Roman, not Monaco, or Courier, or whatever font I change to with the Preferences or Options. I'd like to have the code chunk outputs look better formatted, and in the font of my choice. I also have no problem manipulating the R Markdown font - it is output of the code chunks that is in the same font as the output at my source pane. I've included a screen shot. Any suggestions?
font differences
Appears that this might have been an R Studio version issue. I just updated to 1.2.5019 and all the fonts are the same now - both in the console window and in R Markdown chunk outputs.

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

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

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.

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