diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-04-04 21:15:20 +0200 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2023-04-04 21:15:20 +0200 |
| commit | e7cdbfb658e903452232f15c4f355bdefcbeacd9 (patch) | |
| tree | ec529563e15bb987ff2c044078a7114fd8d47b19 /README.md | |
| parent | c1868ed4dcbb8acaf637b129f8a0f717a41cf5f2 (diff) | |
| parent | 95d1df263e27a06d3bc6f50f345c79ca0a3cc0b7 (diff) | |
| download | vim-ai-e7cdbfb658e903452232f15c4f355bdefcbeacd9.tar.gz | |
Merge branch 'main' into next
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 42 |
1 files changed, 41 insertions, 1 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 + +`:AIRedo` - repeat last AI command + +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. + ## Configuration ### Key bindings @@ -94,6 +100,40 @@ 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> +``` + + +### Interface configuration + +Default interface configuration: + +```vim +let g:vim_ai_chat = { +\ "ui": { +\ "open_chat_command": "below new | call vim_ai#MakeScratchWindow()", +\ }, +\} +``` + +Tips: + +```vim +" restore conversation from the file +let g:vim_ai_chat = { +\ "ui": { +\ "open_chat_command": "below new /tmp/last_conversation.aichat", +\ }, +\} + +" open chat in a new tab +let g:vim_ai_chat = { +\ "ui": { +\ "open_chat_command": "tabnew | call vim_ai#MakeScratchWindow()", +\ }, +\} ``` ### Completion configuration |