Skip to content

evanrelf/byline.kak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

byline.kak

Expand and shrink line-based selections with x and X.

TL;DR: x drags the cursor down, X drags the cursor up. See the "Examples" section below for a more detailed explanation.

Previously named expand-line.kak.

Installation

Using plug.kak (recommended)

With plug.kak installed, add to your kakrc file:

plug "evanrelf/byline.kak" config %{
  require-module "byline"
}

Manually

Download plugin:

$ curl -L https://raw.githubusercontent.com/evanrelf/byline.kak/main/rc/byline.kak -o ~/.config/kak/plugins/byline.kak --create-dirs

Add to your kakrc file:

source ~/.config/kak/plugins/byline.kak
require-module "byline"

Usage

Use x and X to drag the cursor down and up by lines, respectively. This expands or contracts your selection by lines, based on the direction of your selection.

Examples

Press x to drag the cursor (|) down

  • Initial selection → Pressed x → Pressed x
Expand downwards
[T|he quick brown
fox jumps over
the lazy dog
[The quick brown|
fox jumps over
the lazy dog
[The quick brown
fox jumps over|
the lazy dog
  • Initial selection → Pressed x → Pressed x
Contract downwards
|The quick brown
fox jumps over
the lazy dog]
The quick brown
|fox jumps over
the lazy dog]
The quick brown
fox jumps over
|the lazy dog]

Press <a-;> to swap the cursor (|) with the anchor ([ or ])

• Initial selection → Pressed <a-;> → Pressed <a-;>
[The quick brown|
fox jumps over
the lazy dog
|The quick brown]
fox jumps over
the lazy dog
[The quick brown|
fox jumps over
the lazy dog

Press X to drag the cursor (|) up

  • Initial selection → Pressed X → Pressed X
Expand upwards
The quick brown
fox jumps over
|the lazy dog]
The quick brown
|fox jumps over
the lazy dog]
|The quick brown
fox jumps over
the lazy dog]
  • Initial selection → Pressed X → Pressed X
Contract upwards
[The quick brown
fox jumps over
the lazy dog|
[The quick brown
fox jumps over|
the lazy dog
[The quick brown|
fox jumps over
the lazy dog

About

Expand and shrink line-based selections with `x` and `X`

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published