ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Scroll​Offset

by SublimeText ST2/ST3

No description provided

Details

  • 2015.03.04.02.36.40
  • github.​com
  • github.​com
  • 3 years ago
  • 2 hours ago
  • 7 years ago

Installs

  • Total 2K
  • Win 545
  • OS X 745
  • Linux 258
Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3
Windows 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 2 0 0 1 0 1 0 0 1
OS X 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 1 0 2 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

ScrollOffset

ScrollOffset automatically scrolls the buffer when the insertion point gets near the edge, similar to how vim's scrolloff works. ScrollOffset works with multiple selections, and you can change how far from the edge you'd like to stay.

This Plugin is implemented using Layout-Coordinates, so it also works when you have word_wrap enabled.

When you use multiple selections which do not fit into the viewport, Sublimes default behviour is used. This might change in future versions - you find a TODO in the code where to add the logic for such behaviour.

Ignoring Mouse Input

ScrollOffset runs whenever the selection changes. If you would like to ignore mouse input for ScrollOffset purposes, you must also install MouseEventListener. Once MouseEventListener is installed, ScrollOffset will automatically start ignoring mouse input.

However, selecting more than the viewport can display still feels a bit awkward. Since Sublime does not offer a possibility to detect mouse dragging, one can not implement Sublimes default behaviour when it comes to those kind of selections. Just try it out whether it's a hassle for you.

Install

This plugin is available through Package Control, which is available here:

http://wbond.net/sublime_packages/package_control

As mentioned above, installing MouseEventListener is good idea.

Manual Install

Go to your Packages subdirectory under ST2's data directory:

  • Windows: %APPDATA%\Sublime Text 2
  • OS X: ~/Library/Application Support/Sublime Text 2
  • Linux: ~/.config/sublime-text-2
  • Portable Installation: Sublime Text 2/Data

Then clone this repository:

git clone git://github.com/Wolff09/ScrollOffset.git

That's it!