I would like to increase the space between the lines of code in visual studio (to help me get less distracted while reading the code). I know this is possible in IntelliJ/Rider (see this post). Is there a similar setting or option in VS?
I have searched and the only option I can find is to make the space between the lines smaller using the PPT extension.
Another option that I read somewhere (but can't find anymore) was to create a custom font with taller characters.
If you're on VS 2015/2017/2019 (this extension doesn't support VS 2022), you can use the LinePress extension available on the VS Marketplace.
Setting it up is really easy, after installing it, go to the Tools menu > Options > LinePress, you can set there the line height at your liking. (You can also set up the height of empty lines and compress lines with specific contents.)
BONUS: Support for VS 2022
There's an integrated option into the Settings, just go to Tools > Options > Text Editor > General and on the right pane find the option Line spacing, and set its value to one of your liking.
Related
I usually use comma , to set the same variable type like the gif above.
But a problem is when I hit Enter after write second variable, the VS breaks the line automatically.
As a formal Atom user, it's a bit tedious because in Atom it doesn't break the line whatever the indent number is. (My current indent number is 2.)
I changed and tested it all of the options inTools > Options > Text Editor > Basic > Tabs, but none of these turn off the breaking line. Even disabling pretty listening won't work.
How do I turn off this feature?
Judging by the glimpse of Intellisense and the fact that Enter auto-formats, it looks like you're editing a JavaScript file.
To disable auto-formatting after hitting Enter, go to Tools > Options > Text Editor > JavaScript/TypeScript > Formatting > General and toggle Format completed line on Enter to unchecked:
The accepted answer doesn't work in Visual Studio 2019 with Visual Basic. These options on the image aren't even shown in the Options for Basic.
However, when the Pretty listing option is turned off, this behavior ceases.
Document tabs in Visual Studio are sized to the name of the file as it appears on the tab. This means that the size of each tab that is open is contingent on the size of the text of the file name.
Is there a setting buried somewhere that will allow me to keep all tabs the exact same width?
Why does this matter?
For those that must know a reason for this request, I often work in sizable projects which someone else originally created. While researching functionality of code, I'll often open up over 10 documents, tracing paths or researching behavior. When I'm finished with my research, I'll often have to close the previous 3-7 tabs to get back to my original document and unclutter my work area.
I know this seems like a minor nuisance but since every file name is different, you can't keep your mouse in one location and click the the left-button 3-7 times in rapid succession to close all pertinent documents. You have to float the mouse back and forth, for every tab, because of the variance in tab size.
I'd prefer to just set it so that all tabs are the same size, regardless of the length of the file name. Can this be done with reasonable effort?
I am using Visual Studio 2015, so I would like an answer for that version of VS. However, once I upgrade to VS 2017, I'd like to make the same change to that environment.
If the answer for either version is different, I would prefer an answer for both instances of VS.
You can try Productivity Power Tools.
The feature "Vertical tabs" is what you need.
Document tabs are shown vertically, allowing you to fit more tabs than are normally visible when shown horizontally.
For VS 2015 https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProductivityPowerTools2015
For VS 2017 https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProductivityPowerPack2017
Updated:
Productivity Power Tools also support customizing min/max tab width. You can find it from Tools>Options...>Productivity Power Tools>Custom Document Well>Advanced
In VS2022 this is built in under Tools-> Environment -> Tabs and Windows
Visual Studio's auto-formatting feature is quite useful in itself. However, it changes line breaks, which makes it difficult to find significant changes when comparing different versions of a source file in version control.
Is there a way to set it to affect only inline indentation and whitespace (which are filtered by modern compare tools)? I found some settings in 'Tools / Options / Text Editor / C# / Formatting / New Lines', but those only change how the code is formatted, they don't disable the behavior altogether.
Cheers,
Sandor
Not sure if this is what you need, but in File - Advanced Save Options you can configure the line endings that Visual Studio will apply when saving files. Thus, you can at least get a consistent behavior when saving.
This is an IDE tools question.
I want to adhere to a specific style guide which wants me to have my code lines wrap to the next line if they exceed 80 characters on one line. When I select the word wrap option in Visual Studio 2013 text editor, it wraps the current window width of my project. How can I explicitly change my code editor window to be 80 characters in width without having to eyeball it?
Try this VS extension to add a visual guideline at the desired number of chars, then you can break your lines as needed when you approach the line. I'm reinstalling my laptop at the second so can't check, but I assume that the Visual Studio line-wrap option is only visually wrapping the text on your screen rather than actually breaking the line onto a subsequent line when it's over 80 (or width of screen in your case), which isn't really what the style guide you're following will be trying to get you to do.
If you had ReSharper installed, there is an option in that which allows the breaking of lines automatically at a given width.
I'm looking to be able to set the minimum tab size to something lower than the default 20 width, since I'm editing more than 5 files at the same time. I'm using the Productivity Power Tools extension as well.
You can right click on the space beside the tabs, click Customize...
and then Advanced Options then edit the value from there, but it doesn't allow you to go below the inital size of 20.
Is there a configuration file somewhere I can edit to solve this, or is there an obvious solution that I'm missing?
The solution actually was the maximum size rather than the minimum size. So just tweaking the maximum size value was what I wanted. Not ideal, but still, the answer.
It's worth noting that the screenshot you've posted shows non-standard VS settings - that's the Productivity Power Tools extension that you have installed. You might find they hide their setting file separately to the standard VS one.
One alternative solution is provided by that extension: it'll allow you to have a vertical row of tabs, down the side of your screen. That eats more screen space but fits a lot more tabs!
As per MSDN:-
Your active settings consist of two parts: predefined customizations
from the installed .vssettings file you selected the first time you
started Visual Studio and any subsequent IDE customizations you have
made. Active settings are saved by default in the file
currentsettings.vssettings.
So its better editing the values at %USERPROFILE%\Documents\Visual Studio 2010\Settings\CurrentSettings.vssettings (This is mine,you need to set it as per your choice.)
However there is one more file, you can edit i.e. C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Profiles\General.vssettings but keep in mind that editing this one can be quite destructive and its better make a backup copy of it. Also for more information you can ask this at social.msdn.com.