Home Download Buy Blog Forum Support

Scroll multiple columns (like BBEdit synchro scroll)?

Scroll multiple columns (like BBEdit synchro scroll)?

Postby jvo on Fri Jan 13, 2012 3:21 am

It seems like ST2 should do this. I just haven't hit upon the correct keystroke combo. It would be really great if it could do this across multiple columns, but just 2 would be great. Thanks for any help
jvo
 
Posts: 1
Joined: Fri Jan 13, 2012 3:19 am

Re: Scroll multiple columns (like BBEdit synchro scroll)?

Postby hubert on Wed Feb 22, 2012 8:03 am

hubert
 
Posts: 31
Joined: Mon Jan 09, 2012 12:12 pm

Re: Scroll multiple columns (like BBEdit synchro scroll)?

Postby bizoo on Wed Feb 22, 2012 9:30 am

This is a very basic plugin that synchronized cursor movements (triggered by keyboard only, not mouse scrolling, look at the keybindings) across all groups.
It may be useful...

Code: Select all
import sublime, sublime_plugin

class SynchViewCommand(sublime_plugin.WindowCommand):
   def run(self, cmd="", **kwargs):
      if cmd:
         grpcount = self.window.num_groups()
         if grpcount > 1:
            for grp in range(grpcount):
               synchview = self.window.active_view_in_group(grp)
               if synchview:
                   synchview.run_command(cmd, kwargs)


Code: Select all
   { "keys": ["shift+alt+up"], "command": "synch_view", "args": {"cmd": "move", "by": "lines", "forward": false} },
   { "keys": ["shift+alt+down"], "command": "synch_view", "args": {"cmd": "move", "by": "lines", "forward": true} },
   { "keys": ["shift+alt+pageup"], "command": "synch_view", "args": {"cmd": "move", "by": "pages", "forward": false} },
   { "keys": ["shift+alt+pagedown"], "command": "synch_view", "args": {"cmd": "move", "by": "pages", "forward": true} },
   { "keys": ["ctrl+shift+alt+home"], "command": "synch_view", "args": {"cmd": "move_to", "to": "bof", "extend": false} },
   { "keys": ["ctrl+shift+alt+end"], "command": "synch_view", "args": {"cmd": "move_to", "to": "eof", "extend": false} }
bizoo
 
Posts: 859
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Scroll multiple columns (like BBEdit synchro scroll)?

Postby gableroux on Tue May 29, 2012 3:04 am

It's not working for me (installed from sublime package: https://github.com/atbell/SublimeSynchroScroll)

I'm on a mac, I tried to add the keys to my user file but it didn't work neither.
I'll try later on my pc.

Maybe I'm doing it wrong tho.
In soviet Russia, the code compiles you.
gableroux
 
Posts: 3
Joined: Tue May 29, 2012 3:00 am

Re: Scroll multiple columns (like BBEdit synchro scroll)?

Postby bizoo on Tue May 29, 2012 7:00 am

Didn't try it but as it's the same code as mine that work fine, it must work.

Try typing this 2 lines in the console to activate logging:
Code: Select all
sublime.log_input(True)
sublime.log_commands(True)

And try again.
The console show you the keys you press (from ST2 view) and the command that is executed.
Maybe the keybindings doesn't work on OSX.

Type the same lines with a False argument to deactivate the logging.
bizoo
 
Posts: 859
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 8 guests

cron