Sublime Forum

Let us use two-column layout to view more of a single file

#1

Could you give us the ability to use two-column layout to view more of a single file? This would be super helpful for wide screen monitors while handling code that is narrow, such as CSS and CSS preprocessor code, JSON data, etc. Right now (as far as I know of Sublime Text) I’m able to show different files in each column, but I can’t:

  • show a large contiguous chunk of a single file where the content wraps across two columns

  • show two different parts of a single file of code

Please consider this feature. Thanks!

0 Likes

#2

That is very possible,
Clone File: you need to go to Main menubar -> “New View Into File” (we disagree with that command name), basically this opens a new tab(view) that will work on same file(buffer), changes on one instance will propagate into the other tab(view), aka a real Clone.
Columns: So then you go to Main menubar -> View -> Layout -> “Columns 2”, and now you can drag and drop the cloned file into the other column.

This will work just fine.

However there are some possible edge case with problems:

  • You may be able to open a file twice but in two instances (two buffers, not a real clone), idk by using drag and drop or maybe File -> Open. So when you save changes in one instance, it will overwrite the other instance. To solve this you may install package: github.com/titoBouzout/PreventFakeClones (Prevents opening the same file twice, if does not share a buffer (ie is not a clone/duplicate or cloned view/tab/file).
  • Sync scroll, to sync the scroll position and keep folding, selections etc, you may use github.com/titoBouzout/BufferScroll
0 Likes