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`
- Host: GitHub
- URL: https://github.com/evanrelf/byline.kak
- Owner: evanrelf
- License: isc
- Created: 2020-11-11T08:25:18.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-27T04:36:55.000Z (over 2 years ago)
- Last Synced: 2025-02-15T06:14:15.482Z (5 months ago)
- Topics: kakoune, plugin
- Language: KakouneScript
- Homepage:
- Size: 25.4 KB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 xExpand 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 xContract 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 XExpand 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 XContract 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
```