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