diff --git a/README.md b/README.md index f9f31f2..55aa968 100644 --- a/README.md +++ b/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: - `3i,` will insert three commas at the cursor position - `5a.` 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 diff --git a/doc/singlechar.txt b/doc/singlechar.txt index ca88bb4..17b0258 100644 --- a/doc/singlechar.txt +++ b/doc/singlechar.txt @@ -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: > 5i- " Insert 5 hyphens at cursor position 3a. " 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 3a. After: Some text... < +Dot-repeat: > + Action: Press 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*