https://github.com/clementvidon/vim-reselect-two
Improved vim reselect-Visual gv - restore up to the last 2 visual selections
https://github.com/clementvidon/vim-reselect-two
Last synced: 4 months ago
JSON representation
Improved vim reselect-Visual gv - restore up to the last 2 visual selections
- Host: GitHub
- URL: https://github.com/clementvidon/vim-reselect-two
- Owner: clementvidon
- License: other
- Created: 2024-01-17T02:30:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-18T15:17:09.000Z (over 1 year ago)
- Last Synced: 2025-03-01T14:18:38.143Z (7 months ago)
- Language: Vim Script
- Homepage:
- Size: 77.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reselect Two
## Description
This plugin allows you to **restore**, not only the **last selection area** (like does the '**gv**' command) but also the previous one: the **penultimate selection area** (with '**gV**'). See `:h reselect-Visual`, `:h reselect-two`.
### Examples
| Selection Area | Reselection |
| ----------------- | -------------------------------------- |
| "`HELL`o world!" | **gv** -> `HELL`, **gV** -> `HELL` |
| "hello `WORLD`!" | **gv** -> `WORLD`, **gV** -> `HELL` |
| "`HELLO` world!" | **gv** -> `HELLO`, **gV** -> `WORLD` |Here we create two selections and alternate from one to the other using **gv** and **gV**.

## Get Started
* Install with *vim-plug* or any other plugin manager.
`Plug 'clemedon/vim-reselect-two'`
* Read the man: `:h reselect-two`
## Contribute
This is a **work in progress** and may have bugs. **Contributions are welcome**!
## Dev Notes
### Issue
- 240116 **Cursor position** should be restored when the selection is restored.
### Alternative Solution
- 240116 When selection area start, save all keys pressed until the end of the
selection `ModeChanged`, alongside with `visualmode()` and beg position.
Replay them like a macro when the selection is restored.