z_mirror/kak-mirror
git clone https://git.raiguard.me/z_mirror/kak-mirror
1f5ea04
trunk
kak-mirror
A kakoune plugin to grow / shrink selections in both directions or surround them.
A fork of kakoune-mirror by Delapouite with several compatibility fixes.
Installation
Source mirror.kak in your kakrc, or use a plugin manager.
Usage
This plugin provides a mirror user-mode. Recommended usage is to bind this user mode to ' in normal mode:
map global normal "'" ': enter-user-mode -lock mirror<ret>'
Grow / shrink
If you type l it grows the selections one char to their right, but also one char to their left.
To shrink it one char, use h.
When the cursor is before the anchor, it does the opposite.
Example: the current selection is the middle l. Typing 'llhh would produce these visual steps:
he[l]lo h[ell]o [hello] h[ell]o he[l]lo
You can also use w to grow one word to the right and it automatically do a b on the left.
It works vertically with j and k. Or J and K for full lines.
Hitting c will expand by columns above and below.
Finally you can also do it for paragraphs or sentences with p and s.
Surround
Pairwise characters like braces, brackets or quotes can be added, replaced or removed.
Example: starting from the world hello selected.
First, let's surround it with double quotes and parentheses '"(
[hello]
["hello"]
[("hello")]
Oops, you meant to surround the double quotes with spaced-braces! Press d to remove the parens, then }
["hello"]
[{ "hello" }]
See Also
Contributing
Please send questions, requests, bug reports, and patches to the mailing list.
1# kak-mirror 2 3A [kakoune](http://kakoune.org) plugin to grow / shrink selections in both directions or surround them. 4 5A fork of [kakoune-mirror by Delapouite](https://github.com/Delapouite/kakoune-mirror) with several 6compatibility fixes. 7 8## Installation 9 10Source `mirror.kak` in your `kakrc`, or use a plugin manager. 11 12## Usage 13 14This plugin provides a `mirror` user-mode. Recommended usage is to bind this user mode to `'` in normal mode: 15``` 16map global normal "'" ': enter-user-mode -lock mirror<ret>' 17``` 18 19### Grow / shrink 20 21If you type `l` it grows the selections one char to their right, but also one char to their left. 22To shrink it one char, use `h`. 23When the cursor is before the anchor, it does the opposite. 24 25**Example**: the current selection is the middle `l`. Typing `'llhh` would produce these visual steps: 26``` 27he[l]lo 28h[ell]o 29[hello] 30h[ell]o 31he[l]lo 32``` 33 34You can also use `w` to grow one word to the right and it automatically do a `b` on the left. 35 36It works vertically with `j` and `k`. Or `J` and `K` for full lines. 37Hitting `c` will expand by columns above and below. 38 39Finally you can also do it for paragraphs or sentences with `p` and `s`. 40 41### Surround 42 43Pairwise characters like braces, brackets or quotes can be added, replaced or removed. 44 45**Example**: starting from the world `hello` selected. 46 47First, let's surround it with double quotes and parentheses `'"(` 48 49``` 50[hello] 51["hello"] 52[("hello")] 53``` 54 55Oops, you meant to surround the double quotes with spaced-braces! Press `d` to remove the parens, then `}` 56 57``` 58["hello"] 59[{ "hello" }] 60``` 61 62## See Also 63 64- [kakoune-expand](https://github.com/occivink/kakoune-expand) 65- [kakoune-text-objects](https://github.com/Delapouite/kakoune-text-objects) 66- [kakoune-surround](https://github.com/h-youhei/kakoune-surround) 67- [move-line.kak](https://github.com/alexherbo2/move-line.kak) 68- [auto-pairs.kak](https://github.com/alexherbo2/auto-pairs.kak) 69- [surround.kak](https://github.com/alexherbo2/surround.kak) 70 71## Contributing 72 73Please send questions, requests, bug reports, and patches to the 74[mailing list](https://lists.sr.ht/~raiguard/public-inbox).