Feature/vim repeat #1
2 changed files with 35 additions and 1 deletions
17
README.md
17
README.md
|
|
@ -13,6 +13,7 @@ A simple Vim plugin that lets you insert single characters without leaving norma
|
|||
- Stay in normal mode for efficient editing
|
||||
- Minimal workflow interruption
|
||||
- Works with Vim 9+
|
||||
- **Supports [`vim-repeat`](https://github.com/tpope/vim-repeat) for `.` repeat functionality**
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
@ -26,6 +27,16 @@ cp -r vim-singlechar ~/.vim/pack/plugins/start/
|
|||
cd -
|
||||
```
|
||||
|
||||
### Optional: Install [vim-repeat](https://github.com/tpope/vim-repeat)
|
||||
|
||||
For seamless repeat (`.`) support, install [vim-repeat](https://github.com/tpope/vim-repeat):
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.vim/pack/tpope/start
|
||||
cd ~/.vim/pack/tpope/start
|
||||
git clone https://tpope.io/vim/repeat.git
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
By default, the plugin provides two mappings:
|
||||
|
|
@ -42,6 +53,10 @@ You can use a count before the mapping to insert the character multiple times:
|
|||
- `3<Leader>i,` will insert three commas at the cursor position
|
||||
- `5<Leader>a.` will insert five periods after the cursor position
|
||||
|
||||
### Repeat last insert with `.`
|
||||
|
||||
If [vim-repeat](https://github.com/tpope/vim-repeat) is installed, you can repeat the last character insertion with `.` in normal mode.
|
||||
|
||||
## Configuration
|
||||
|
||||
You can customize the plugin by setting these variables in your vimrc:
|
||||
|
|
@ -67,4 +82,4 @@ The plugin provides these commands:
|
|||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
MIT Licens
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ REQUIREMENTS *singlechar-requiremen
|
|||
|
||||
- Vim 9.0 or newer
|
||||
- Vim compiled with `+eval` feature
|
||||
- [vim-repeat](https://github.com/tpope/vim-repeat/) (optional, for dot-repeat support)
|
||||
|
||||
===============================================================================
|
||||
INSTALLATION *singlechar-installation*
|
||||
|
|
@ -43,6 +44,13 @@ Manual installation: >
|
|||
mkdir -p ~/.vim/pack/plugins/start/
|
||||
cp -r vim-singlechar ~/.vim/pack/plugins/start/
|
||||
<
|
||||
|
||||
To enable dot-repeat (`.`) for character insertions, install vim-repeat: >
|
||||
mkdir -p ~/.vim/pack/tpope/start
|
||||
cd ~/.vim/pack/tpope/start
|
||||
git clone https://tpope.io/vim/repeat.git
|
||||
<
|
||||
|
||||
===============================================================================
|
||||
USAGE *singlechar-usage*
|
||||
|
||||
|
|
@ -60,6 +68,12 @@ You can use a count before the mapping to insert the character multiple times: >
|
|||
5<Leader>i- " Insert 5 hyphens at cursor position
|
||||
3<Leader>a. " Insert 3 periods after cursor position
|
||||
<
|
||||
|
||||
Dot-repeat support (`.`):
|
||||
|
||||
If [vim-repeat](https://github.com/tpope/vim-repeat/) is installed,
|
||||
you can use the `.` key to repeat the last single character insertion (with count and position).
|
||||
|
||||
===============================================================================
|
||||
COMMANDS *singlechar-commands*
|
||||
|
||||
|
|
@ -110,10 +124,15 @@ Adding multiple periods: >
|
|||
Action: Position cursor at the end, press 3<Leader>a.
|
||||
After: Some text...
|
||||
<
|
||||
Dot-repeat: >
|
||||
Action: Press <Leader>i? to insert a question mark, then press . to repeat the insertion at the next location.
|
||||
<
|
||||
|
||||
===============================================================================
|
||||
TIPS & TRICKS *singlechar-tips*
|
||||
|
||||
- The plugin works well with Vim's macro recording feature
|
||||
- For fast repetitive edits, use dot-repeat (`.`) if vim-repeat is installed
|
||||
|
||||
===============================================================================
|
||||
LICENSE *singlechar-license*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue