Home Download Buy Blog Forum Support

Simpler split view

Simpler split view

Postby Jacket on Thu Mar 06, 2014 11:19 pm

Hello,

My first post here...
I recently switched to MAC from PC (using PCs for 20+ years, developing since 7). I've been evaluating text editors for about a week. I've stumbled on ST and purchased it in less than 3 hours. It had everything I need. All other text editors missed something.
I love everything about it besides one thing - splitting a single file in two.
Now I know this can be achieved here with layouts but it's a quite cumbersome to do and also not working quite as expected.

Here's my use case - I work mainly with huge files (10-20k+ lines), containing both client and server code (usually javascript, php). When I code some new functionality I usually work on both client and server simultaneously. Being in a single file I need to work on very different positions. The split view here is a real life saver. But most of the time I don't need it, because it takes precious vertical space. I also usually keep a lot of open files and only some of them are like this.
The current implementation in BBEdit is exactly what I need. It's done via simple divider above the scrollbar which you just drag to whatever position you need and then when you finish you just discard it by dragging the divider all the way to the top. It is also aware of the current file, so file A is split, but file B isn't. On Windows I have used EditPlus for years and it had the same implementation. The selection highlighting is also very important to work in spilt view - when I select text in the top pane it should be highlighted in the bottom one and vice versa. This is again a life saver when you code client/server functions and you are reusing variable names.

Is there something similar planned for the future? Can this be achieved via plugin?
I really love ST and this is the only thing that's making me a lot less productive than before.
Jacket
 
Posts: 4
Joined: Thu Mar 06, 2014 10:03 pm

Re: Simpler split view

Postby tito on Fri Mar 07, 2014 7:15 am

This is really a good idea, not sure if some package already do this. But seems doable.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Simpler split view

Postby FichteFoll on Tue Mar 11, 2014 3:17 am

I'm not exactly sure what you are proposing, so let me phrase it like this: You want to be able to have certain files in a (vertically) split clone view and have that disappear when switching tabs?
FichteFoll
 
Posts: 402
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Simpler split view

Postby Jacket on Tue Mar 11, 2014 8:35 am

Something like this. It's basically a lot easier approach of splitting the current file in two, working like that for the current task and then easily remove split. Like I said, it's exactly what how BBEdit is doing it (and EditPlus on Windows). I just found a similar topic in the forum, but I'm not sure if it will resolve this case... https://www.sublimetext.com/forum/viewt ... f=2&t=7347
Jacket
 
Posts: 4
Joined: Thu Mar 06, 2014 10:03 pm

Re: Simpler split view

Postby Jacket on Tue Mar 11, 2014 11:30 am

The more I need to do this in ST, the more I'm going crazy, sorry :(
There are also some bugs with search, but they are minor.

What's happening right now - I'm working in a single huge file on a single layout. Suddenly I need to jump to another place in the file to add some functions, but I also need to work on the same position as I am now, simultaneously. What I do now:

1. Open View -> Layout -> Rows: 2 (shortcut is almost impossible to press with one hand).
2. Click again inside the file from Group 1, because the focus automatically shifts to the new empty group (why?)
3. Go to File -> New View Into File (no shortcut for that and is not available if you skip 2.)
4. Drag the new tab into the second row.
5. In the new view into the same file, I am positioned at the top of the file instead of the last used position, so I have to search where I am.

Also the tabs are taking way too much vertical space, so I'm forced to use the side bar and turn off tabs

What I was doing with BBEdit and EditPlus before that.

1. Drag and drop the divider above the scroll bar to the middle of the screen - That's it!
The view is automatically split, the file is the same and the position of the file is if was a continuous file, just you can now scroll independently the two parts.

When you need to do this countless times a day it becomes a huge issue. Is there some other workflow that I'm not aware of in ST which can help in this case? I can't be the only one with this issue.
Jacket
 
Posts: 4
Joined: Thu Mar 06, 2014 10:03 pm

Re: Simpler split view

Postby bizoo on Tue Mar 11, 2014 12:27 pm

Create your own plugin to do exactly what you want, something like:
Code: Select all
import sublime, sublime_plugin

class SplitViewCommand(sublime_plugin.WindowCommand):
    def run(self):

        if self.window.num_groups() == 1:
            self.window.run_command('clone_file')
            self.window.run_command('set_layout',
                            {
                            "cols": [0.0, 1.0],
                            "rows": [0.0, 0.5, 1.0],
                            "cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
                            })
            self.window.run_command('focus_group', {"group": 0})
            self.window.run_command('move_to_group', {"group": 1})
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Simpler split view

Postby FichteFoll on Tue Mar 11, 2014 3:46 pm

You should take a look at https://sublime.wbond.net/packages/Origami, maybe it can help you simplify the process. (And I find alt+shift+2 not hard to press at all with one hand.)
FichteFoll
 
Posts: 402
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Simpler split view

Postby Jacket on Wed Mar 12, 2014 10:16 pm

Origami is close, didn't know about that. Although it's a bit of an overkill and still not working as expected (selection highlight doesn't work across panes, but I guess I will have to suck it up and deal with this way. Thank you for the link.
Jacket
 
Posts: 4
Joined: Thu Mar 06, 2014 10:03 pm

Re: Simpler split view

Postby skuroda on Thu Mar 13, 2014 8:09 am

There is an on_selection_modified event listener for plugins. You could probably use that to manage highlighting for multiple views into the same file.
skuroda
 
Posts: 685
Joined: Fri Oct 05, 2012 8:11 am


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests