In VS Code can I change the width of the split editor panel with a shortcut or command? - visual-studio-code

In VS Code When I have a vertical editor split with 2 panels I would like to be able to change the right panel's width to a predefined total window width % using a shortcut.
Say I would like to have one shortcut to show the right panel at 50% of the overall VSC width. Then the second shortcut is 30%, the third is 80% and the 4th is 0%.
At the same time I would not like to have any files from the right editor panel joined or closed when I change the panel's width.
Is it posssible with the built-in commands of extensions?

I discovered the VS Code behavior that partially resembles the feature I described above.
To see this we have to split the editor in 2 panels (View->Editor Layout->Two Columns), open some file in the right hand one, manually move its border to the farthest right. Then as we switch between the panels with Ctrl-1 and Ctrl-2 (Windows) the respective active panel will restore its maximum width and the other will get the minimum width.
This does not fully solve my problem but at least alleviates the pain.

Related

vscode: fastest way to set the windows' sizes

I'm using vscode to code and I open usually one, two or three windows.
When I open only one window, it will fill in the whole interface of vscode.
When I open another one or two windows, they will seperate the interface equally, which is not what I expected.
I want to get a way to resize two or three windows fast.
For example, if there are two windows, I want the width of the first window to be 300 and the second to be 200. And if there are three windows, I want their widths to be 150, 150 and 200. Of course, these numbers are simply an example because the max width isn't 500. But I always make my vscode maximized so fixed numbers would be fine to me.
When I open the second or the third window, I have to resize them with the mouse everytime, this is kind of boring. Is there any better way to resize the windows?
For example, if there are two or three windows, vscode can resize them automatically? Or some shortcuts to resize two or three windows?

VSCode: Individual zoom levels for each open VSCode window (Multiple monitor setup with vertical monitor)

I have a 2 monitor setup. One monitor I have setup as vertical as it's easier to read through long code.
The way I have VSCode setup, is that I have 2 separate VSCode windows open for the same workspace (by pressing CTRL + K, then O). One window on the regular monitor, and one for the vertical one. All works fine.
However the issue that I have, is that on the vertical monitor, due to the aspect ratio, the font size of VSCode is too big so I have to zoom out a bit with the built in VSCode zoom function (CTRL +/-). This works fine and I can adjust it so it's perfectly readable. Unfortunately when I zoom, it zooms on all open VSCode windows, including the window on my main monitor. The text there then becomes too small.
How can I have individual zoom levels for each open VSCode window?
There is a setting Editor: Mouse Wheel Zoom. If you turn this on you can zoom with the Ctrl key and mouse scroll wheel, and it only affects the code editors in the current VSCode window.
Dude I am planning to buy a monitor and placing it Vertically so that's why I am confirming how to see the code in the vertical format. Like I use ESLint to prettify my code and I want to set the width of my code to de static so that it should not exceed.
AND on to your problem, there is a setting in VS code to set the font of your code changes with the scroll you should use that.
That will be the bare minimum to work.
Hope this helped.
Short Answer
ctrl + shift + p
type editor font...
Choose among the three options.
This gives us individual editor font zoom levels per workspace window.
Longer Answer
The original question has two bits:
"have 2 separate VSCode windows open for the same workspace",
"individual zoom levels for each open VSCode window?"
While VSCode doesn't support individual window zoom levels per workspace, it does support individual editor font zoom levels per workspace. That's what the short answer provides.
See https://github.com/microsoft/vscode/issues/72011

VSCODE : Prevent Double Clicking from Expanding Pane

In vscode when you are working with multiple panes split both horizontally and vertically or a combination of the two, and you double click inside of a pane i.e. the content body it automatically expands. This pushes around all of your panes which sucks to continuously reorganize.
Is there a way to shut this off? I can not find the setting.
Here is a gif of what this looks like http://recordit.co/ClOxfe0CYz
Try resetting the editor sizes with the "Reset Editor Group Sizes" from the command palette. Thereafter, the focused editor will not expand in size.
Maximizing the focused editor only starts to work if one of the editors was previously minimized or maximized. See how to maximize an editor.
I found that double click on any tab(when you have any tab split) will Toggle auto group size what you experience I believe. So if this happens just double click again on any tab to disable auto resizing.
After some searching in the settings I was able to resolve this by disabling:
Workbench > Editor: Centered Layout Auto Resize

How can I scroll left and right in Eclipse editor with the keyboard without moving the cursor?

To scroll within the Eclipse editor without moving the cursor up and down one can use CTRL+Down or CTRL+Up. But what about left and right?
It is not possible. If you search keys in Eclipse's Preferences, you will find out that you only have Scroll up and Scroll down that you can set hotkeys on.
My recommendation would be changing the maximum line length in the editor.
Make your code shorter. After all, looooong lines of code are not so readable.
Also, resize your editor area. If you feel strangled, remove the Outline, TaskList, and Build view from your right side of Eclipse, and enlarge the editor.

emacs: x-popup-menu max size constraints?

I'm working on an intellisense or code-completion capability for C#.
So far, so good. Right now I have basic completion working. There are 2 ways to request completion. The first cycles through all the potential matches. The second presents a popup menu of the matches. It works for types:
And also for local and instance variables:
I'm confronting two problems with x-popup-menu:
the popup menu can expand to consume all available screen space, when the number of choices is large. Literally it can consume the entire screen, and obscure everything else, including the entire emacs window and every other window.
The silly thing is, it's scrollable. First it expands to consume all available space, then it also becomes scrollable. Seems like it would make sense for it to expand to a certain point, and then become scrollable, rather than expanding to take all available space.
Is there a way I can limit the maximum size of x-popup-menu?
To specify the position of the popup menu, I pass in a position, and x-popup-menu uses that as the *middle*, not the left, of the top line of the menu. Why middle? who knows.
What this means is, if I specify (40 . 60) for the location of the menu, and the menu happens to be 100 pixels wide, the menu will extend beyond the left border of the emacs window. You can see this in the 2nd image above.
If I knew how wide the popup would be before specifying the position, I could compensate. But I don't.
Is there a workaround? Is there a way to get x-popup-menu to take its position as the LEFT rather than the middle?
Addendum: Doc for x-popup-menu
x-popup-menu is a built-in function in `C source code'.
(x-popup-menu POSITION MENU)
Pop up a deck-of-cards menu and return user's selection.
PO SITION is a position specification. This is either a mouse button
event or a list ((XOFFSET YOFFSET) WINDOW) where XOFFSET and YOFFSET
are positions in pixels from the top left corner of WINDOW's frame
(WINDOW may be a frame object instead of a window). This controls the
position of the center of the first line in the first pane of the
menu, not the top left of the menu as a whole. If POSITION is t, it
means to use the current mouse position.
Some people like Emacs because it doesn't provide popup windows (see e.g. this blog entry). The more "emacsy" way of presenting your list of possible completions is to show them in a split buffer. That way you would automatically avoid all of the above issues (screen real estate & scrolling) and would probably attract more of the die-hard Emacs users.
But that's pure speculation :-)
You can base your autocompletion backend on company or autocomplete where display of suggestions is handled for you.