Visual Studio 2020 how to stop filenames from being shortened in the tab - visual-studio

In Visual Studio (2020 for me), the filename of open files are written in the tabs at the top of the screen. If the filename is too long, it will be automatically shortened, i.e. instead of ReallyLongFilename.cs it will say ReallyL...lename.cs.
I want the entire filename to be displayed. I realize that I can hover my mouse on the tab to see the entire path, and I realize that I can select the dropdown on the top right to see all open files. That requires mouse and eye movement, when I just want eye movement.
Is there a setting for this?
filenames_have_been_shortened

Not really, but you can mitigate the problem by changing the tab minimum/maximum width via Tools > Options > Environment > Tabs and Windows > Minimum Tab Width and Maximum Tab Width. The default minimum is 60 and the default maximum is 215. Changing the Maximum Tab Width will allow you to see more of the filename.

Related

Visual Studio Output Window Font Size tracks with Code Window. Then it doesn't

I've seen this for years with Visual Studio and would like to finally understand it.
I'll be coding in VS and I want to increase my text editor font size. My typical method is to use use CTRL+MOUSEWHEEL to increase it. As text in text editor gets bigger, so does the text in the Output Window. They're sync-ed.
That makes the output window font size larger than I want so then I go to...
Tools >> Options >> Environment >> Fonts and Colors
...change the category to "Output Window" and change the font size. And yes, that certainly works. But it has the odd side-effect of making the output window stop tracking with the code window. Now, if I use CTRL+MOUSEWHEEL to adjust the code window font size, the output window does not change.
But then, a month or two later, I will notice that they're tracking together again.
What is it that made the two track together? Is there any way to toggle that tracking on and off?
(Both windows use "Courier New" for a font, if that matters)

Fix scrollbox length on the vertical scrollbar [Visual Studio 2019]

Using Visual Studio 2019 Professional (and if relevant, editing C#). While using the IDE, the Scrollbox on the vertical scrollbar keeps changing size depending on where you are in the document. It might be smaller at the bottom and then get bigger as you scroll upwards or vice versa. This is disconcerting and makes navigation harder.
In the image below, Options > Environment > Fonts and Colors > Overview background is set to Maroon to better show the Scrollbox in case there is ambiguity. The Scrollbox is the bit between the orange lines which you can grab to scroll up and down.
In Notepad++, the Scrollbox size depends on the height of the application and the number of lines in the text file being edited. The size (correctly) changes size when you add or remove lines, but it does not change size dynamically depending on where you are in the document. This is the functionality I'm looking for.
A related Stackoverflow question suggested disabling Edit > Advanced > Word Wrap. This does not resolve the issue.
How do you turn off "dynamic Scrollbox sizing while scrolling"?
When the IDE is in Map mode, it does not appear to be possible to fix the Scrollbox height.
To resolve this issue, go to Options > Text Editor > All Languages > Scroll Bars > Behaviour, and select Use bar mode for vertical scroll bar.

How to disable horizontal scroll in visual studio code?

When I scroll with the touch pad with two fingers in Visual Studio Code, I often scroll to the sides a little by accident. This is a bit annoying.
I'd be happy to have it scroll only up and down.
A partially satisfying solution, is to simply press Alt + z, to have the lines wrapped, and then it doesn't scroll to the side.
You can also make wordWrap default as described here How do I turn on text wrapping by default in VS Code
If you have this problem because of Gitlens (blame lines), the solution i found is to disable gitlens.currentLine.scrollable (or set it to false in the settings json file.
Pressing alt + z to disable horizontal scrolling, works fine for a current single file. If you want permanent solution then for every file you visit? then follow:
Settings > Text Editor > Diff Editor > Word Wrap to on
Note: in case you don't know where is this Settings, just go
1. Via MENU
File > Preferences > Settings > Text Editor > Diff Editor > Word Wrap
2. Via shortcut Keys
On Windows
ctrl + , (control + comma)
On Mac - correct me if I am wrong
command + , (command + comma)
Just want to add that some plugins, like GitLens, may mess this setting up.
E.g., with GitLens, it can add git blame information inline, at the end of each line of code, showing you who is responsible for that line's current version, and when.
Unfortunately, this information will not only be to the right of the wrap column, e.g. 80, it'll also "unlock" the horizontal scrolling, even when no GitLens blame annotation is there.
I haven't found any fix for this other than disabling such features.
Just press ALT + Z -> To enable/disable the horizontal scroll
Config: MBP 2018 | Using Magic Mouse 2.
For me, I had accidentally set the 'Scroll Beyond Last Column' to 80 chars. Just resetting it to default settings is what worked for me. Hope it does for you all!
Update (6th Feb, 2021): Enabling the mini-map again causes the problem. So disabled it to get rid of the issue.
⌥ + z
the shortcut for Mac. you welcome
February 2020 (version 1.43) update adds an option called: Scroll Predominant Axis
Scrolling predominant axis
When trying to scroll vertically using a modern touchpad, it oftentimes happens that the file scrolls horizontally as well. There is now a new setting, editor.scrollPredominantAxis (which is set to true by default) which blocks "diagonal" scrolling. This forces scrolling gestures to be either vertical or horizontal (based on the highest absolute scroll delta), but never diagonal.
When enabled,it prevents any diagonal scrolling.
It guesses your scrolling to either vertical scroll or horizontal scroll.
It says by default it is enabled. If not then you can enable in Scroll Predominant Axis in settings.
Screenshot: Editor: Scroll Predominant Axis
Or in settings.json
"editor.scrollPredominantAxis": true
Use Ctrl + E, then Ctrl + W for disable horizontal scrolling.
For more details, you can refer this cite: https://developercommunity.visualstudio.com/t/disable-horizontal-scrolling-in-visual-studio-2019/612873.

Visual Studio 2008: Change the font size of line number

Is there any way to hack visual studio so that it displays the line numbers in smaller font size like the way Notepad++ does? I'm using Consolas at size 12 and the line numbers just look so ugly.
Thanks.
Tools > Options... > Environment Fonts and Colors > Display Items > Line Numbers
You should be able to mess with fonts and sizes there.
EDIT for the people whose hands need to be held:
Follow this click path after you open Visual Studio 2008 (most likely by double-clicking on its icon):
Tools > Options... > Environment Fonts and Colors
"Tools" is in the menu bar at the top of the screen, and is most likely the fourth option from the right. Once you click on "Tools" a menu should come down, and you should click the "Options..." option, which is the very very last one. A new window will pop up with some junk on the right and some more things to click on on the left. Those things on the left determine what options you'll be setting on the right. Click the "Environment Fonts and Colors" option, which should be the second option.
Then, make sure "Show Settings For:" is set to "Text Editor". Click on "Line Numbers" in the listbox that says "Display Items". It is located underneath the "Font (bold type indicates fixed-width fonts):" dropdown box (that textbox with the arrow on the right side that when you click it, a whole bunch of options show up). It should be the 5th option in the "Display Items" box. After you do this, you can adjust your font, font size, color, whatever your little heart desires.
Once you're done, make sure to hit the "OK" button in the lower right corner of the window where you just made all your adjustments. Your new settings should be reflected!
:\
Even though Jason is correct in his directions, he even answered your question in a round about way.
all text editor font is the same
when you have changed one of the font properties.
So in short. No you can not adjust individual fonts for items in the actual text editor, though you can adjust almost everything else through the Option dialog.
Hope this helps.

More screen space in MSVS?

I am using visual studios 2008. My laptop has the max screen res of 1366x768.
What can i do to get more reading space? i was thinking of making the font smaller but it would be more helpful if i can make everything smaller (toolbar icons, text, etc)
The only improvement i done so far was remove a bunch of things under the toolbar so i have only one line. Actually for this project i remove the standard bar so i have have the solution and text directly under the menu with no toolbar. What else can i do to maximize reading space.
Tools > Options > Environment > General > Uncheck "Show status bar"
Tools > Options > Text Editor > All Languages > Uncheck "Navigation bar"
Install the "Hide Main Menu" extension available here.
Enable Auto-hide the taskbar in your Windows Taskbar properties.
That should get you at least 5-7 more lines.
Dual screens. The more pixels the better. I like 1920x1280 extended to across a matched monitor with vertically split tabs.
Probably not the answer you are looking for, but really, it HELPS A LOT.
Ok ok:
Try Lucida Console as a font - it's readable at 8pt - and fixed width!
Hit Alt+Shift+Enter to get into Full Screen mode.
Float all your "helper" windows and use Ctrl+Tab to get to them. (Click using mouse)
Pin your Windows Task Bar to the left or right of your screen to give more vertical reading space.
What I do is unpin all the various tool windows and views. Unpin the Solution Explorer, Properties viewer, Output etc. and the Toolbar. This leaves you with just the coding window and small bars around that allow you to hover over the edges of the window and see everything you just unpinned.
set the Solution explorer on the right to Auto-Hide, close the error window when possible (as in when you're not fixing errors), and try and drop the number of toolbars vertically to 1. You can also change the size of the text down by going to Tools > Options > Environment > Fonts and colors but i wouldn't shrink the text unless you have good vision. I recommend Consolas 12 Point for your code; it's a bit big but very nice looking!
I got rid of the toolbars altogether and made things like the Solution Explorer autohide. I came to the realisation that the only toolbar button I ever used was a custom tool one I'd put there (I use the menu for that now). I'm running at 1920x1200 so real estate wasnt an issue - I just wanted less visual distractions. Just me and the code.

Resources