diff --git a/README.md b/README.md index 46b3a0e..48b6a5b 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,16 @@ git clone https://tpope.io/vim/repeat.git ## Usage -By default, the plugin provides two mappings: +By default, the plugin provides four mappings: +> [optional param] +> (param) -- `i` - Insert a character at the cursor position -- `a` - Insert a character after the cursor position +> `[count](char)` + +- `[count]i(char)` - Insert a character at the cursor position +- `[count]a(char)` - Insert a character after the cursor position +- `[count]I(char)` - Insert a character at the beginning of the line +- `[count]A(char)` - Insert a character at the end of the line After pressing the mapping, you'll see a prompt asking for the character to insert. Press any character and it will be inserted without entering insert mode. @@ -63,8 +69,13 @@ You can customize the plugin by setting these variables in your vimrc: ```vim " Change the mappings (before loading the plugin) -let g:singlechar_map_insert_at = 'i' " Default -let g:singlechar_map_insert_after = 'a' " Default +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 + +" Set the static cursor (no cursor move during singlechar actions) +let g:singlechar_static_cursor = 1 " Change the prompt message let g:singlechar_prompt = 'Press the character to insert - Press Esc to cancel...' " Default @@ -84,9 +95,14 @@ let g:singlechar_warning_message = 'Only the first character will be taken: {cha The plugin provides these commands: -- `:InsertCharAt [count]` - Insert a character at the cursor position -- `:InsertCharAfter [count]` - Insert a character after the cursor position +> [optional param] +> (param) + +- `: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 ## License -MIT License +[MIT License](https://github.com/lohhiiccc/vim-singlechar/blob/main/LICENSE)