diff options
| -rw-r--r-- | README.md | 11 | ||||
| -rw-r--r-- | doc/vim-ai.txt | 9 |
2 files changed, 18 insertions, 2 deletions
@@ -49,7 +49,6 @@ Plug 'madox2/vim-ai', { 'do': './install.sh' } ### :AIChat - `:AIChat` - continue or start a new conversation. `(visual selection)? :AIChat {instruction}?` - start a new conversation given the selection, the instruction or both @@ -76,6 +75,13 @@ You are a Clean Code expert, I have the following code, please refactor it in a Supported chat roles are **`>>> system`**, **`>>> user`** and **`<<< assistant`** +### :AIRedo + +Use this immediately after `AI`/`AIEdit`/`AIChat` command in order to re-try or get an alternative completion. +Note that the randomness of responses heavily depends on the [`temperature`](https://platform.openai.com/docs/api-reference/completions/create#completions/create-temperature) parameter. + +`:AIRedo` - repeat last AI command + ## Configuration ### Key bindings @@ -94,6 +100,9 @@ nnoremap <leader>s :AIEdit fix grammar and spelling<CR> " trigger chat xnoremap <leader>c :AIChat<CR> nnoremap <leader>c :AIChat<CR> + +" redo last AI command +nnoremap <leader>r :AIRedo<CR> ``` ### Completion configuration diff --git a/doc/vim-ai.txt b/doc/vim-ai.txt index 24a1ebe..d0519fd 100644 --- a/doc/vim-ai.txt +++ b/doc/vim-ai.txt @@ -54,7 +54,6 @@ https://platform.openai.com/docs/api-reference/completions *:AIChat* - :AIChat continue or start a new conversation. (selection)? :AIChat {instruction}? start a new conversation given the selection, the instruction or both @@ -72,6 +71,11 @@ Options: > Check OpenAI docs for more infomration: https://platform.openai.com/docs/api-reference/chat + *:AIRedo* + +:AIRedo repeat last AI command in order to re-try + or get an alternative completion. + CONFIGURATION *vim-ai-config* To customize the default configuration, initialize the config variable with @@ -100,6 +104,9 @@ Examples how configure key bindins and customize commands: > xnoremap <leader>c :AIChat<CR> nnoremap <leader>c :AIChat<CR> + " redo last AI command + nnoremap <leader>r :AIRedo<CR> + " command with custom context (vim-ai functions: AIRun, AIEditRun, AIChatRun) command! -range -nargs=? AICode <line1>,<line2>call AIRun(<range>, "Programming syntax is " . &filetype . ", " . <f-args>) |