Activity Bar width in Visual Studio Code - user-interface

Is there a way to selectively change the width of the Activity Bar in VSCode (v. 1.14)? I have a 1366×768 screen where every pixel counts, so I would like to make this bar narrow and icons smaller, by at least 50%. In comparison to vertical OS interface elements, e.g. Windows 10 Taskbar or Plasma 5 panel it looks monstrous and out of place:
I've been also trying to find a solution for the Insider version of VSCode, but apart from just hiding it I haven't discovered anything relevant yet.
I have "window.zoomLevel": 0 set in settings.json.

I recommend the excellent extension Activitus Bar. It recreate the activity bar buttons on the status bar:
Then, you just hide this enormous, gigantic activity bar. Happying code!

EDIT (03/03/20): You can also use the customize-ui addon that allows more fine-grained font sizes and other goodies
You can also use the negative zoom trick in settings.json:
{
"window.zoomLevel": -1,
"editor.fontSize": 13,
"terminal.integrated.fontSize": 16,
}
The whole editor will get smaller so you need to compensate editor.fontSize and terminal.integrated.fontSize
This allows for smaller activity bar (unfortunately it acts on everything (icons size, font-size ...)) but I much prefer this than the defaults.

Not solving your exact question but another good solution...
Install the Customize UI extension.
In Settings (UI) go to the Customize UI settings and set Activity Bar to "bottom".
Completely close VSCode and reopen.

Not exactly what was asked, but instead of hiding it completely, I added a keyboard shortcut to be able to toggle the bar.
On macOS: Code > Preferences > Keyboard shortcuts > search for: Toggle Activity Bar Visibility
On Linux: File > Preferences > Keyboard shortcuts > search for: Toggle Activity Bar Visibility
Alternatively, you can get to Keyboard shortcuts by pressing ctrl + k and then ctrl + s.
I set it to Option + B just like Command + B for the Side Bar toggle and show it just when I need something there.

Wanted to add more to Akelian answer:
On Windows/Linux - File > Preferences > Settings
On macOS - Code > Preferences > Settings
{
"window.zoomLevel": -1,
"editor.fontSize": 13,
"terminal.integrated.fontSize": 16,
"workbench.activityBar.visible": false,
}
Setting false to "workbench.activityBar.visible" removes the sidebar completely
https://code.visualstudio.com/docs/getstarted/settings

Related

SSIS keyboard shortcuts for packages layout

I am making a few edits on huge DTSX packages in Visual Studio (SSIS), and my target is to make a more tidy layout of the flows.
For this reason, I use to select part of the flows and then use the following menu:
Format > Auto Layout > Diagram
Format > Align > Center
Format > Make Same Size > Both
Format > Horizontal Spacing > Make Equal
Format > Vertical Spacing > Make Equal
Is there a key shortcut for these commands?
I looked over Google and the official Microsoft documentation, but I didn't find anything helpful in this direction.
By default, there are no default keyboard shortcuts assigned for the layout commands:
You can assign your own shortcuts!
In the top menu strip, go to Tools > Options.
Once the options dialog is shown, click on the keyboard section. And select the command you are looking to assign the shortcuts. In the "Show commands containing", type Format. to find the commands related to formatting, e.g. Format.Diagram, Format.MakeHorizontalSpacingEqual, etc. Then press the shortcut you want and click on the assign button (as shown below).
After assigning the shortcuts, you check the command you selected in the menu strip and note that the keyboard shortcut is shown beside it.

My terminal in VS Code has a tiny font after installing zsh and changing font style

If you look at the VS Code terminal - its too tiny.
Here're the user settings that I have modified to create this result. I have searched how to change terminal fonts at VS Code, but I have followed all instructions pertaining to
terminal.integrated.fontSize and this doesn't help at all - it only lengthens the line.
Please advise - thanks in advance.
I'm sure there are a few answers to this. But to solve mine, I had to change the terminal.integrated.fontFamily. Try these themes "Monaco" for instance. Add this line to your settings.
"terminal.integrated.fontFamily": "Monaco"
If the font size does not change and only increases the letter spacing, try a few checks:
Save the settings and close VS Code editor and re-open a new one.
Try restarting VS Code.
The Font family theme that you select plays a huge role in how it renders.
Check this font family themes that you can test.
This is my current setting as far as basic visuals for CLI and the editor:
"explorer.confirmDelete": false,
"workbench.sideBar.location": "left",
"workbench.statusBar.visible": true,
"editor.fontFamily": "Monaco",
"editor.fontSize": 12,
"terminal.integrated.fontFamily": "Hack",
"terminal.integrated.fontSize": 10,
"terminal.integrated.lineHeight":1,
"editor.tabSize": 2,
Again, these are checks you can do. I hope this helps cause it definitely took me a while to change my view of VS Code terminal above to the one I have below now:
Code > Preferences > Settings > Features > Terminal. Here you can find Integrated: Font Size and change it to your desired size
Go to Terminal >> Settings >>> font size as described in above screen shot and try updating desired font size and weight
Set the terminal.integrated.fontsize in your user settings to override the original value. I have mine set to 20. I am old ;)
Code > Preferences > Settings > Search "terminal font size" on the bar > change font size
Also use FontSize Shortcuts, then
Use Ctrl + + for incrementation font size,
Use Ctrl + - for decrementation font size.
Open the Command Palette:
Windows: Ctrl + Shift + P
macOS: Command + Shift + P
Enter Open Settings (JSON)
Add terminal.integrated.fontSize to the file.
All you have to do is add this line to the file and save:
"terminal.integrated.fontSize": 16
Just zoom the whole VS Code's UI in or out with CTRL + + or CTRL + - respectively and than adjust font sizes we do have control over in settings.json file.
Use Ctrl + + for incrementation font size,
Use Ctrl + - for decrementation font size.

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.

Can I quickly dial up font sizes for the VS IDE without a mouse?

Maybe this isn't a "programming question" per se, but it relates to the coding process:
One of the really neat features I like about the WPF-ized VS IDE is being able to hit Ctrl (I think it is) and thumb the mouse wheel to quickly change font size in the code editor.
For work (desktop PC) that works great, but at home, on my laptop, I can't figure out how to accomplish it (other than going into Properties or whatever and changing font size there, which is obviously way less "handy" (no pun intended)).
Is there a quick way to change edit font size without resorting to the dialog accessed via the menu?
You can set the shortcut in the Tools -> Options -> Environment -> Keyboard shortcuts for View.ZoomIn and View.ZoomOut. I think they are by default: CTRL + Shift + Comma for zoom out and CTRL + Shift + Period for zoom in .
http://weblogs.asp.net/jgalloway/archive/2010/04/15/visual-studio-2010-zooming-keyboard-commands-global-zoom.aspx
Tools -> Options -> Environment -> Format is the place where you can change as per your need
If you don't have a scroll wheel, you'll have to create your own macro to do this. Check out the first answer in this post:
Shortcut for changing font size in Visual Studio

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