Xcode 11 vertical position of editors - xcode

In Xcode 10 (and earlier) we could have two editors vertically stacked on top of each other. I have not managed to do that in Xcode 11, only horizontally stacked, which is not optimal using my rotated monitor (using my monitor "in portrait" mode).
Is it possible to vertically align editors?

Choosing File > New > Editor Below will add an editor below the current editor and tell Xcode to vertically stack future editors for that project. You can also choose View > Change Editor Orientation to toggle stacking editors vertically and horizontally.

Thanks to #Mark's answer I knew that it was possible to do vertical alignment of editors, but just now I also discovered that the good old shortcut gets updated according to current Editor aligment.
CMD + SHIFT + O ('Open quickly')
Enter name of type/file you would like to open in a new editor, select the file in the list
Followed by
ALT + ENTER to open the selected file in a new editor (using latest preferred alignemt)

Related

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.

Zoom only Text in Visual Studio Code

Is there a way to make Vs-code on Mac only zoom the text/file pane of the window? When I hit Command ⌘+ to zoom, it'll zoom all of the window, ie. also the icons on the left hand side and the file pane on the left as well.
Compare these two screen shots, maybe ;)
Vs-code window, normal
Vs-code window, zoomed in
I'd only like the source file (nfsd.sh in the screen shot) to be zoomed.
Answered in https://stackoverflow.com/a/41684631/5295392:
Out of Box solution for zoom in/out for text only:
Ctrl + Shift + P
Type (Open User Settings)
Search (Edit settings.json)
Add "editor.mouseWheelZoom": true
Save it.
You can use your mouse wheel to zoom in or zoom out only text in the text box.
Open your settings.json file and increase editor.fontSize to increase the size of the text on the source file.
Ctrl + Shift + P
Search 'Zoom'
Pick "Editor Font Zoom In"
Repeat till you get what you want.
On Mac, while pressing the command key, slide two fingers upward to zoom out. Slide downward to zoom in.

How to make VSCode editor stop scrolling past bottom of a file?

In the VSCode editor when you pull the scroll bar down to the bottom of the file, all you see is a blank page, since the text has scrolled up past the top of the text editor window. This makes scrolling to the bottom difficult because you can't just pull the scroll bar quickly all the way down but have to carefully position the cursor so you can still see your code.
Very similar to How to make Visual Studio editor stop scrolling past bottom of a file?, but comments have pointed out that question/answer is for Visual Studio. This answer is for VSCode on the macOS and Windows.
The correct answer is seen here: https://stackoverflow.com/a/40588828/1189470
There is a configuration option provided in VSCode for the functionality you specified. To enable it, go to File -> Preferences -> user settings
On the right side of the editor in settings.json paste the below line at the bottom (before closing bracket), save and close.
"editor.scrollBeyondLastLine": false
This will prevent the editor from scrolling beyond the last line.
This is now exposed as a simple checkbox labeled "Editor: Scroll Beyond Last Line" in File/Apple -> Preferences.
If just for readability you would like some space at the bottom of the file - a configurable amount - try this setting as of v1.43:
editor.padding.bottom in pixels
Editor> Padding: Bottom
Controls the amount of space between the bottom edge of the editor and
the last line.
and/or
editor.padding.top // but this isn't sticky in the sense that you can scroll right past the padding top and it is gone. It doesn't stay.

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: How can I see the same file in two separate tab groups?

I want to be able to edit one method while looking at another method in the same file, as reference.
Can this be done?
You can open the file in another tab (Window -> New Window).
Doing so you have two copies of the same file. Then you can right-click the tab bar and select New Vertical Tab Group (or New Horizontal Tab Group, the one you like more).
Hope I understood you question..
Be on the tab you want to duplicate,then click in the menu bar at the top onWindow > New Window
Finally drag & drop the second window to the the left or right side to show both views next to each other.
Et voila, there you have it :)
EDIT
It seems that this function is not implemented in all version of VS.
In my case (V 15.4.2 (2017), V 15.9.7 (2017) & V 16.2.5 (2019)) it just works fine.
Only vertically that I'm aware. When looking at the code, right above the vertical scroll bar is a small rectangle, drag it down to get a split view of the file.
You simply use the small drag arrows icon at the top right corner of your file window as depicted in the following screenshots:
1) View the same document side-by-side (with a fix for Visual Studio 2017)
It is possible to do this using New Window and New Vertical Tab Group, however, in my Visual Studio 2017 the New Window command was missing from the Window menu. To use it, first you must add the command to a menu or assign a shortcut to it.
To add New Window to your Window menu follow this sequence, starting with the Tools menu:
Tools > Customize > Commands > Menu Bar > Window > Add Command > Window > New Window
FYI In the Commands step you decide where to put the New Window command. The sequence I gave above puts it unceremoniously at the top of the Window menu.
To view the same document side-by-side
Open the document you want to view side-by-side
Select your recently added New Window command (perhaps it's in Window > New Window)
Right click the new tab and select New Vertical Tab Group or select that command from the Window menu
2) View the same document above-one-another
If you wish to view the same document in two views on top of each other use the Window > Split command or click-and-drag the double-arrow at the top of the scroll bar for any window.
3) Get creative
FYI You can even combine the two view options to have three, four or even more views of the same document on a particularly wide monitor. On mine (2560 x 1080) I can comfortably get three side-by-side views going and split them vertically, if desired.
One can install VsVim extension and :sp :vsp does the trick.
In Visual Studio 15 you can just click inside the document and then "Window → Split"

Resources