From d26ea1e5a616a6f611ada183f859c5a9c4fd4837 Mon Sep 17 00:00:00 2001 From: lohhiiccc <96543753+lohhiiccc@users.noreply.github.com> Date: Thu, 21 Aug 2025 17:18:08 +0200 Subject: [PATCH] docs: Add new commands and mappings for begin/end-of-line insertion - Document new commands: :InsertCharBegin [count] [char], :InsertCharEnd [count] [char] - Update mappings to support begin/end-of-line insertion with [count] - Add configuration options for I and A mappings - Document static cursor option (g:singlechar_static_cursor) - Clarify usage and mapping examples for all new features --- doc/singlechar.txt | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/doc/singlechar.txt b/doc/singlechar.txt index ab2e7eb..8a78a85 100644 --- a/doc/singlechar.txt +++ b/doc/singlechar.txt @@ -6,7 +6,7 @@ Author: lohhiiccc Version: 1.0.0 License: MIT -Last Change: 2025-08-19 +Last Change: 2025-08-21 CONTENTS *singlechar-contents* @@ -79,8 +79,10 @@ COMMANDS *singlechar-commands The plugin provides two commands: -`:InsertCharAt [count]` - Insert a character at the cursor position -`:InsertCharAfter [count]` - Insert a character after the cursor position +`:InsertCharAt [count] [char]` - Insert a character at the cursor position +`:InsertCharAfter [count] [char]` - Insert a character after the cursor position +`:InsertCharBegin [count] [char]` - Insert a character at the beginning of the line +`:InsertCharEnd [count] [char]` - Insert a character at the end of the line The optional count parameter specifies how many times to insert the character. @@ -89,8 +91,10 @@ MAPPINGS *singlechar-mappings By default, the plugin defines these mappings: -`i` - Map to `:InsertCharAt` -`a` - Map to `:InsertCharAfter` +`[count]i` - Map to `:InsertCharAt [count]` +`[count]a` - Map to `:InsertCharAfter [count]` +`[count]I` - Map to `:InsertCharBegin [count]` +`[count]A` - Map to `:InsertCharEnd [count]` =============================================================================== CONFIGURATION *singlechar-configuration* @@ -99,6 +103,8 @@ Customizing mappings: > " Must be set before the plugin is loaded let g:singlechar_map_insert_at = 'i' " Default let g:singlechar_map_insert_after = 'a' " Default + let g:singlechar_map_insert_begin = 'I' " Default + let g:singlechar_map_insert_end = 'A' " Default < Disabling default mappings: > " Disable default mappings @@ -107,7 +113,13 @@ Disabling default mappings: > " Create your own mappings nnoremap ,i ":InsertCharAt " .. v:count1 .. "" nnoremap ,a ":InsertCharAfter " .. v:count1 .. "" + nnoremap ,I ":InsertCharBegin " .. v:count1 .. "" + nnoremap ,A ":InsertCharEnd " .. v:count1 .. "" < +Set static cursor option: > + " When enabled, cursor returns to its original position after insertion + let g:singlechar_static_cursor = 1 + Changing the prompt message: > let g:singlechar_prompt = 'Character to insert (Esc to cancel): ' <