From 894f58a9887ad91cb2567b346907b9388debf0c5 Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Sat, 25 Mar 2023 18:06:30 +0100 Subject: updated keybindings docu --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index a483d8b..6cb5e05 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,14 @@ Map keys in your `.vimrc` to trigger `:AI` command. " complete text on the current line or in visual selection nnoremap a :AI xnoremap a :AI + +" edit text with a custom prompt +xnoremap s :AIEdit fix grammar and spelling +nnoremap s :AIEdit fix grammar and spelling + +" trigger chat +xnoremap c :AIChat +nnoremap c :AIChat ``` ### Completion configuration @@ -141,19 +149,14 @@ let g:vim_ai_chat = { ### Custom commands -To customize and re-use prompts it is useful to put some context to the language model. You can do it with prepending text to `:AI` command. +To customize and re-use prompts it is useful to put some context in it. You can do it by prepending text to AI commands. ```vim -" key binding with custom context -xnoremap s :AIEdit fix grammar and spelling and use formal language -nnoremap s :AIEdit fix grammar and spelling and use formal language +command! -range -nargs=? AITranslate ,call AIEditRun(, "Translate to English: " . ) -" key binding to trigger chat -xnoremap c :AIChat -nnoremap c :AIChat +command! -range -nargs=? AICode ,call AIRun(, "Programming syntax is " . &filetype . ", " . ) -" command with custom context (vim-ai functions: AIRun, AIEditRun, AIChatRun) -command! -range -nargs=? AICode ,call AIRun(, "Programming syntax is " . &filetype . ", " . ) +" available functions are: AIRun, AIEditRun, AIChatRun ``` -- cgit v1.2.3