An open API service indexing awesome lists of open source software.

https://github.com/evanrelf/byline.kak

Expand and shrink line-based selections with `x` and `X`
https://github.com/evanrelf/byline.kak

kakoune plugin

Last synced: 4 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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](https://github.com/andreyorst/plug.kak) (recommended)

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

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

### Manually

Download plugin:

```bash
$ 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:

```kakoune
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 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
```