We all know how to get 2 split views of a text file when editing – but what if we want 3, or 4, or more?
I recently edited a file I wanted to see several views of. Keeping a window open for each section of the file made cut and paste very easy. Problem was, I couldn’t find any editor that did that. Notepad++, PSPad, even that editor in Visual Studio seemed to only split a single time – so two views of a single file at most.
Eventually, I downloaded the Windows version of emacs, which does offer this option; however, it kept crashing on exit, and the keys are non-standard to Windows, which made it annoying to set up Ctrl-V, Ctrl-C, etc (not impossible, mind you, just annoying – check their menu option ‘Options; Use CAU Keys’ if you go this route).
Today while idly browsing the web (and avoiding work) I came across another option – Visual Studio once again. Tried it, and it worked a treat. Best of all, it’s an environment I’m familiar with so no cases of “why did this happen?” when I pressed familiar keyboard shortcuts.
Here’s the steps to set it up:
- Load the file you want to edit in VS (I use VS2015, but I’ve read VS2010 and on supports it) or drag and drop from explorer.
- Click on its tab.
- Use menu option Window; New Window to duplicate the contents into a second window. Same file, but two views of it (you can prove it by typing in one and watching it change in the other.)
- Right click on the tab you want to move and select New Vertical Tab Group (or New Horizontal Tab Group). Whether you pick vertical or horizontal is up to you, but apparently once you do one window this way, all the subsequent windows need to be the same orientation.
- Rinse and repeat: Duplicate the window with New Window, then move it with New Vertical Tab Group or New Horizontal Tab Group.
One other point: If you’re using wide scroll bars (I like the “Wide” Source Overview option,) just right click on the scroll bars to change them via Scroll Bar Options to make them thinner, with more room for text. But if you turn them off like I did, no more right clicking, so just go to the same option is found via the menu Tools; Options; Text Editor; All Languages; Scroll Bars.