Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code method to split screen HORIZONTAL when comparing files

In Visual Studio code, when comparing two files (eg in GitLens, or just a direct compare), is there a way to change the comparison split from vertical to horizontal? (so the lines still scroll together, but lines are longer, and less of them on the screen...)

like image 681
Fred Avatar asked Sep 12 '25 09:09

Fred


2 Answers

This cannot be done for diff editors. The best you can do on diffs is the setting: Diff Editor: Render Side By Side switch to inline.

There is an issue on the backlog you can upvote:

See git diff of two files in horizontal layout.


For other types of file splits:

View/Editor Layout/Flip Layout will toggle between horizontal and vertical splitting.

Or Shift+Alt+0 (that is a zero) will do the same - that command is workbench.action.toggleEditorGroupLayout if you want to rebind it to something else.


You can permanently change the upper right split icon to horizontal if that is what you want with this setting:

Workbench › Editor: Open Side By Side Direction

Controls the default direction of editors that are opened side by side (e.g. from the explorer). By default, editors will open on the right hand side of the currently active one. If changed to down, the editors will open below the currently active one.

like image 194
Mark Avatar answered Sep 14 '25 21:09

Mark


Apart from the other answers, you may also need to uncheck this:

Diff Editor: Use Inline View When Space Is Limited

like image 44
Saty Avatar answered Sep 14 '25 21:09

Saty