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

Expand Selection to Line Upwards

by Aaron Fu Lei ST3

A Sublime Text 3 plugin that expands selection to line upwards.

Details

Installs

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

Expand Selection to Line Upwards

A Sublime Text 3 plugin.

Like the built-in Expand Selection to Line command. But will expand upwards (instead of downwards).

screencast

Installation

Package Control

Usage

  1. Keyboard Shortcut

    Default

    • Linux / Windows: Ctrl + Alt + L
    • macOS: Cmd + Opt + L
  2. Main Menu

    Selection --> Expand Selection to Line (Upwards)

Keyboard Shortcut

The default keyboard shortcut has no conflict with other default keyboard shortcuts in Sublime Text 3.

Linux / Windows

{ "keys": ["ctrl+alt+l"], "command": "expand_selection_to_line_upwards" },

macOS

{ "keys": ["super+alt+l"], "command": "expand_selection_to_line_upwards" },

However, it is recommended to use Ctrl + Shift + L as the keyboard shortcut, as Ctrl + L is the shortcut for the built-in Expand Selection to Line, and adding a Shift to it conventionally suggests going backwards.

But this will require changing the default keyboard shortcut for Selection --> Split into Lines.

Interested users may set this up in Preferences --> Key Bindings using the information below.

Linux / Windows

{ "keys": ["ctrl+shift+l"], "command": "expand_selection_to_line_upwards" },
{ "keys": ["ctrl+alt+l"], "command": "split_selection_into_lines" },

macOS

{ "keys": ["super+shift+l"], "command": "expand_selection_to_line_upwards" },
{ "keys": ["super+alt+l"], "command": "split_selection_into_lines" },

What If I Over-expanded?

Use Soft Undo.

By default, it's Ctrl + U on a Linux / Windows PC, and Cmd + U on a Mac.

Technical Notes

  1. After expansion, the cursor will be placed at the beginning of the line.

  2. This plugin works properly under empty selection (i.e. just a cursor, no selection), one selection, and multiple selections.

  3. Each Soft Undo undoes one expansion (i.e. shrinks one line).

Author

Aaron Fu Lei

License

MIT