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

Sticky​Lines

by klmp200 ST4 New

Never loose track of the current class you're editing

Details

Installs

  • Total 4
  • Win 0
  • Mac 4
  • Linux 0
Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28
Windows 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 4 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 0 0 0 0 0 0 0 0 0 1 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

StickyLines

This plugins aim at always knowing in which class you are located :

  • With a Sticky Scroll like behavior like it exists in VS Code
  • With an on demand popup

Installation

This plugin requires Sublime Text >= 4132.

Package Control

The easiest way to install is using Package Control. It's listed as NeoCodeMap.

  1. Open Command Palette using ctrl+shift+P (Linux/Windows) or cmd+shift+P (OSX) or menu item Tools -> Command Palette....
  2. Choose Package Control: Install Package.
  3. Find StickyLines and hit Enter.

Manual install

Clean repository in your Packages directory.

Usage

Sticky Scroll

Sticky scroll preview

This is the main feature of the plugin. This adds a Phantom at the top your code with the truncated context stack of the current function you are in.

Basically, if you're inside a big class or nested functions, it keeps track of them and display those class and function definition that are out of your viewport at the top.

This is language independent and works as long as the language is supported by Sublime Text.

Note: context depth is tracked through indentation level. This won't work if your code isn't indented properly.

About performances and jitteriness

There is no way in the Sublime API to react to viewport change. This means that this plugin requires a periodic task to work.

Impact on performances should be minimal but this is important to keep in mind.

The lack of proper UI feature and the use of phantoms also creates some jittering effect on the text buffer. I tried to reduce it at a maximum with some stabilization features but it can only go so far.

For all of this reasons, if you're only interested by the Popup feature or want to completely disable the background periodic task when not needing the plugin, you can set sticky_lines_auto_follow to false or type StickyLines: Toggle Auto Follow in the command palette (sticky_lines_toggle_auto_follow command).

Usage

The default behavior is to always be activated on every view depending on sticky_lines_enabled_globally setting. It's default is true.

You can change this by going through the settings or using the command palette with StickyLines: Toggle Globally (sticky_lines_toggle_globally command).

You can override this behavior by toggling this on specific views with StickyLines: Toggle on View (sticky_lines_toggle_on_view command).

Popup

Popup preview

This plugin also provides a nice popup that shows those same info but on a popup under your cursor. It has to be called manually with StickyLines: Show Popup (sticky_lines_show_popup command).

Note: this also relies on code being indented properly.

Command Palette

Press ctrl+shift+P (Linux/Windows) or cmd+shift+P (OSX). Type stickylines to see available commands:

  • Toggle Globally (sticky_lines_toggle_globally): Change default enable behavior of the sticky scroll feature on all views.
  • Toggle on View (sticky_lines_toggle_on_view): Change enable behavior of the sticky scroll feature on the current view.
  • Toggle Auto Follow (sticky_lines_toggle_auto_follow): Enable/Disable the sticky scroll feature completely.
  • Show Popup (sticky_lines_show_popup): Display the stack context popup under your cursor.

Preferences

Preference Description Default
sticky_lines_auto_follow Enables auto follow periodic task Disabling this settings basically disables sticky lines features Other features like on demand context are still available true
sticky_lines_enabled_globally Default behavior of sticky lines on a view This can be overridden on a per view basis true